Replace all be32 usage of the '==' operation with "be32_eq(...)".

edge.strict_endians
Erik Larsson 2016-01-28 08:28:36 +01:00
parent e616a84f21
commit c29924872f
2 changed files with 8 additions and 6 deletions

View File

@ -308,4 +308,6 @@
#define be16_eq(a, b) ((a) == (b))
#define be32_eq(a, b) ((a) == (b))
#endif /* defined _NTFS_ENDIANS_H */

View File

@ -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));
}