You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Gargi Jaiswal (Jira)" <ji...@apache.org> on 2025/02/07 11:47:00 UTC

[jira] [Created] (HDDS-12244) Fix the regex for illegal keyname character validation

Gargi Jaiswal created HDDS-12244:
------------------------------------

             Summary: Fix the regex for illegal keyname character validation
                 Key: HDDS-12244
                 URL: https://issues.apache.org/jira/browse/HDDS-12244
             Project: Apache Ozone
          Issue Type: Bug
          Components: S3
    Affects Versions: 2.0.0
            Reporter: Gargi Jaiswal
            Assignee: Gargi Jaiswal


The current regular expression to filter the invalid *S3* key name is accepting the key names with *'<'* and *'>'* as the string (eg., ke<y>1.txt) when we set the following congifuration to true{*}:{*}
{code:java}
 OZONE-SITE.XML_ozone.om.keyname.character.check.enabled=true
{code}
{color:#172b4d}On running the key put it is accepting invalid key name:{color}

{color:#172b4d}Command:{color}
{code:java}
bash-5.1$ ozone sh key put /vol1/buck1/ke<>y1 f1.txt
bash-5.1$ ozone sh key put /vol1/buck1/k>ey1 f1.txt  
bash-5.1$ ozone sh key put /vol1/buck1/ke<y1 f1.txt
 {code}
{color:#172b4d}Output needed to be fixed:
1. It is accepting the above mentioned key name and writing the file in it.

You can refer to the [https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html] *aws S3 docs* to see the object key checking guideline.{color}

{color:#172b4d}Proposed fix:
1. Change the regex in *PutKeyHandler* file (constant : {color}
KEYNAME_ILLEGAL_CHARACTER_CHECK_REGEX)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org