From 348c8aba0d2df2996e0fe57900ef518c6aeb4b29 Mon Sep 17 00:00:00 2001 From: Kenny Root Date: Thu, 10 May 2012 15:39:53 -0700 Subject: 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 --- VolumeManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VolumeManager.cpp b/VolumeManager.cpp index 3a63a19..fe1ce8e 100644 --- a/VolumeManager.cpp +++ b/VolumeManager.cpp @@ -571,7 +571,7 @@ int VolumeManager::fixupAsecPermissions(const char *id, gid_t gid, const char* f 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); -- cgit v1.1