Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDDS-3969. Add validName check for FileSystem requests #1211

Merged
merged 2 commits into from
Jul 22, 2020

Conversation

bharatviswa504
Copy link
Contributor

What changes were proposed in this pull request?

This Jira is to validate KeyNames which are created with OzoneFileSystem.
Similar to how hdfs handles using DFSUtil. isValidName()

Made only changes in the client.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-3969

How was this patch tested?

Added tests.

Copy link
Contributor

@avijayanhwx avijayanhwx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM +1 (after clean CI).

Minor comment inline.

String key = path.toUri().getPath();

if (OzoneFSUtils.isValidName(key)) {
key = path.toUri().getPath().substring(1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@arp7 arp7 merged commit 854f5d3 into apache:master Jul 22, 2020
rakeshadr pushed a commit to rakeshadr/hadoop-ozone that referenced this pull request Sep 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants