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

[jira] [Created] (HDDS-2973) Fix root deletion logic in delete API

Ayush Saxena created HDDS-2973:
----------------------------------

             Summary: Fix root deletion logic in delete API
                 Key: HDDS-2973
                 URL: https://issues.apache.org/jira/browse/HDDS-2973
             Project: Hadoop Distributed Data Store
          Issue Type: Bug
            Reporter: Ayush Saxena
            Assignee: Ayush Saxena


Logic to prevent root from being getting deleted seems to be not working.

{code:java}
      if (key.equals("/")) {
        LOG.warn("Cannot delete root directory.");
        return false;
      }

If it is root, the key will be empty not "/", As pathToKey() will remove the "/" and make it "" and there after addTrailingSlashIfNeeded() will not add a slash as it has a check !isEmpty(key) before adding slash.
{code}

Follow up from discussion at [HDDS-2685|https://github.com/apache/hadoop-ozone/pull/321]




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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