sadanand48 commented on PR #8453:
URL: https://github.com/apache/ozone/pull/8453#issuecomment-2894149183

   I looked into this and the reason for the corner case of put-object allowing 
a key like "sample:/" is because if the --body is not provided , it gets 
translated into a CreateDirectory operation for an FSO bucket
   
   ``` bash
   $ aws s3api --endpoint http://xx:9878 put-object --bucket buck2 --key 
sample:/
   
   $ aws s3api --endpoint http://xx:9878 delete-object --bucket buck2 --key 
sample:/
   
   An error occurred (500) when calling the DeleteObject operation (reached max 
retries: 2): Internal Server Error
   ```
   The keyName check is controlled by a flag 
ozone.om.keyname.character.check.enabled which was introduced  
[here](https://github.com/apache/ozone/pull/812#pullrequestreview-398337563)  
and defaults to false.
   But the logic in OmDeleteKeyRequest  is different i.e it does not call the 
same 
[validateKey()](https://github.com/apache/ozone/blob/eeb98c7921e70716623219e1309d4012c299dba5/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMDirectoryCreateRequest.java#L100)
 method but instead calls 
[validateAndNormalizeKey](https://github.com/apache/ozone/blob/eeb98c7921e70716623219e1309d4012c299dba5/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyDeleteRequest.java#L86)
 which internally only validates if the bucket is FSO.
   
   To not allow these chars in the first place, I feel one should tune this 
config to true for stricter char check. 
   
   @adoroszlai what do you think?. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to