Improved sanity checks on a security descriptor

PERMISSION_HANDLING_BRANCH
Jean-Pierre André 2010-07-22 14:49:46 +02:00
parent f65aa991a9
commit 891b7e97b3
1 changed files with 3 additions and 3 deletions

View File

@ -615,7 +615,6 @@ BOOL ntfs_valid_descr(const char *securattr, unsigned int attrsz)
* old revision and no DACL though SE_DACL_PRESENT is set
*/
if ((attrsz >= sizeof(SECURITY_DESCRIPTOR_RELATIVE))
&& (ntfs_attr_size(securattr) <= attrsz)
&& (phead->revision == SECURITY_DESCRIPTOR_REVISION)
&& (offowner >= sizeof(SECURITY_DESCRIPTOR_RELATIVE))
&& ((offowner + 2) < attrsz)
@ -623,14 +622,15 @@ BOOL ntfs_valid_descr(const char *securattr, unsigned int attrsz)
&& ((offgroup + 2) < attrsz)
&& (!offdacl
|| ((offdacl >= sizeof(SECURITY_DESCRIPTOR_RELATIVE))
&& (offdacl < attrsz)))
&& (offdacl+sizeof(ACL) < attrsz)))
&& (!offsacl
|| ((offsacl >= sizeof(SECURITY_DESCRIPTOR_RELATIVE))
&& (offsacl < attrsz)))
&& (offsacl+sizeof(ACL) < attrsz)))
&& !(phead->owner & const_cpu_to_le32(3))
&& !(phead->group & const_cpu_to_le32(3))
&& !(phead->dacl & const_cpu_to_le32(3))
&& !(phead->sacl & const_cpu_to_le32(3))
&& (ntfs_attr_size(securattr) <= attrsz)
&& ntfs_valid_sid((const SID*)&securattr[offowner])
&& ntfs_valid_sid((const SID*)&securattr[offgroup])
/*