diff --git a/include/ntfs-3g/endians.h b/include/ntfs-3g/endians.h index 6b795adc..84c39c9b 100644 --- a/include/ntfs-3g/endians.h +++ b/include/ntfs-3g/endians.h @@ -308,4 +308,6 @@ #define be16_eq(a, b) ((a) == (b)) +#define be32_eq(a, b) ((a) == (b)) + #endif /* defined _NTFS_ENDIANS_H */ diff --git a/libntfs-3g/acls.c b/libntfs-3g/acls.c index 7ab9d617..fe8ba09c 100644 --- a/libntfs-3g/acls.c +++ b/libntfs-3g/acls.c @@ -243,27 +243,27 @@ static int is_world_sid(const SID * usid) /* check whether S-1-1-0 : world */ ((usid->sub_authority_count == 1) && be16_eq(usid->identifier_authority.high_part, const_cpu_to_be16(0)) - && (usid->identifier_authority.low_part == const_cpu_to_be32(1)) + && be32_eq(usid->identifier_authority.low_part, const_cpu_to_be32(1)) && le32_eq(usid->sub_authority[0], const_cpu_to_le32(0))) /* check whether S-1-5-32-545 : local user */ || ((usid->sub_authority_count == 2) && be16_eq(usid->identifier_authority.high_part, const_cpu_to_be16(0)) - && (usid->identifier_authority.low_part == const_cpu_to_be32(5)) + && be32_eq(usid->identifier_authority.low_part, const_cpu_to_be32(5)) && le32_eq(usid->sub_authority[0], const_cpu_to_le32(32)) && le32_eq(usid->sub_authority[1], const_cpu_to_le32(545))) /* check whether S-1-5-11 : authenticated user */ || ((usid->sub_authority_count == 1) && be16_eq(usid->identifier_authority.high_part, const_cpu_to_be16(0)) - && (usid->identifier_authority.low_part == const_cpu_to_be32(5)) + && be32_eq(usid->identifier_authority.low_part, const_cpu_to_be32(5)) && le32_eq(usid->sub_authority[0], const_cpu_to_le32(11))) #if !POSIXACLS /* check whether S-1-5-4 : interactive user */ || ((usid->sub_authority_count == 1) && be16_eq(usid->identifier_authority.high_part, const_cpu_to_be16(0)) - && (usid->identifier_authority.low_part == const_cpu_to_be32(5)) + && be32_eq(usid->identifier_authority.low_part, const_cpu_to_be32(5)) && le32_eq(usid->sub_authority[0], const_cpu_to_le32(4))) #endif /* !POSIXACLS */ ); @@ -279,7 +279,7 @@ BOOL ntfs_is_user_sid(const SID *usid) { return ((usid->sub_authority_count == 5) && be16_eq(usid->identifier_authority.high_part, const_cpu_to_be16(0)) - && (usid->identifier_authority.low_part == const_cpu_to_be32(5)) + && be32_eq(usid->identifier_authority.low_part, const_cpu_to_be32(5)) && le32_eq(usid->sub_authority[0], const_cpu_to_le32(21))); } @@ -297,7 +297,7 @@ static BOOL ntfs_known_group_sid(const SID *usid) /* count == 1 excludes S-1-5-5-X-Y (logon) */ return ((usid->sub_authority_count == 1) && be16_eq(usid->identifier_authority.high_part, const_cpu_to_be16(0)) - && (usid->identifier_authority.low_part == const_cpu_to_be32(5)) + && be32_eq(usid->identifier_authority.low_part, const_cpu_to_be32(5)) && (le32_to_cpu(usid->sub_authority[0]) >= 1) && (le32_to_cpu(usid->sub_authority[0]) <= 6)); }