OSDN Git Service

Fixed accessing security attributes the old way on ntfs 3.x
authorJean-Pierre André <jpandre@users.sourceforge.net>
Mon, 10 Nov 2014 07:43:32 +0000 (08:43 +0100)
committerJean-Pierre André <jpandre@users.sourceforge.net>
Mon, 10 Nov 2014 07:43:32 +0000 (08:43 +0100)
When the security attribute is present, chkdsk may set a null security id
in the standard attributes, and this should not be considered as an error.
(this partially reverts commit [70e5b1])

libntfs-3g/security.c

index f431a01..e6d0587 100644 (file)
@@ -1881,13 +1881,11 @@ static char *getsecurityattr(ntfs_volume *vol, ntfs_inode *ni)
                 * with a default security descriptor inserted in an
                 * attribute
                 */
-       if (test_nino_flag(ni, v3_Extensions) && vol->secure_ni) {
-               if (ni->security_id) {
-                               /* get v3.x descriptor in $Secure */
-                       securid.security_id = ni->security_id;
-                       securattr = retrievesecurityattr(vol,securid);
-               } else
-                       securattr = (char*)NULL;
+       if (test_nino_flag(ni, v3_Extensions)
+           && vol->secure_ni && ni->security_id) {
+                       /* get v3.x descriptor in $Secure */
+               securid.security_id = ni->security_id;
+               securattr = retrievesecurityattr(vol,securid);
                if (!securattr)
                        ntfs_log_error("Bad security descriptor for 0x%lx\n",
                                        (long)le32_to_cpu(ni->security_id));