You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2020/07/17 04:06:03 UTC

[GitHub] [hadoop-ozone] avijayanhwx commented on a change in pull request #1211: HDDS-3969. Add validName check for FileSystem requests

avijayanhwx commented on a change in pull request #1211:
URL: https://github.com/apache/hadoop-ozone/pull/1211#discussion_r456206292



##########
File path: hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicOzoneFileSystem.java
##########
@@ -721,7 +723,13 @@ public String pathToKey(Path path) {
       path = new Path(workingDir, path);
     }
     // removing leading '/' char
-    String key = path.toUri().getPath().substring(1);
+    String key = path.toUri().getPath();
+
+    if (OzoneFSUtils.isValidName(key)) {
+      key = path.toUri().getPath().substring(1);

Review comment:
       Can we just do this here, instead of toUri().getPath() again?
   `    LOG.trace("path for key:{} is:{}", key, path);
       return key.substring(1);
   `




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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