Commits

Kenny Root  committed 348c8ab

Only set permissions on dirs or files

Traversal would mark directories with the correct permissions, but
they're visited again in post-order which is a different fts_info flag.
Then it would set that to regular file permissions.

Explicitly check to make sure we're looking at a file instead.

Bug: 6478606
Change-Id: I13cab3e69f451da6a994fa974d575ef366f82025

  • Participants
  • Parent commits e5032c4

Comments (0)

Files changed (1)

File VolumeManager.cpp

 
             if (ftsent->fts_info & FTS_D) {
                 result |= fchmod(fd, 0711);
-            } else {
+            } else if (ftsent->fts_info & FTS_F) {
                 result |= fchmod(fd, privateFile ? 0640 : 0644);
             }
             close(fd);