Fixed accessing security attributes the old way on ntfs 3.x

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])
edge.strict_endians
Jean-Pierre André 2014-11-10 08:43:32 +01:00
parent 3bfff8ea3f
commit 3a8d923c13
1 changed files with 5 additions and 7 deletions

View 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));