mirror of
https://git.code.sf.net/p/ntfs-3g/ntfs-3g.git
synced 2024-11-23 18:14:24 +08:00
Fixed the maximum size of an ACL
Define the maximum size of an ACL as results from the maximum number of sub-authorities defined in layout.h
This commit is contained in:
parent
6c768f215d
commit
e8170f588f
@ -102,10 +102,11 @@
|
||||
#define ROOT_GROUP_UNMARK FILE_READ_EA /* ACL granted to root as group */
|
||||
|
||||
/*
|
||||
* A type large enough to hold any SID
|
||||
* Maximum SID size and a type large enough to hold it
|
||||
*/
|
||||
|
||||
typedef char BIGSID[40];
|
||||
#define MAX_SID_SIZE (8 + SID_MAX_SUB_AUTHORITIES*4)
|
||||
typedef char BIGSID[MAX_SID_SIZE];
|
||||
|
||||
/*
|
||||
* Struct to hold the input mapping file
|
||||
|
@ -2790,10 +2790,10 @@ char *ntfs_build_descr_posix(struct MAPPING* const mapping[],
|
||||
for (k=0; k<pxdesc->acccnt; k++) {
|
||||
if ((pxdesc->acl.ace[k].tag == POSIX_ACL_USER)
|
||||
|| (pxdesc->acl.ace[k].tag == POSIX_ACL_GROUP))
|
||||
newattrsz += 3*40; /* fixme : maximum size */
|
||||
newattrsz += 3*MAX_SID_SIZE;
|
||||
}
|
||||
/* account for default ACE's */
|
||||
newattrsz += 2*40*pxdesc->defcnt; /* fixme : maximum size */
|
||||
newattrsz += 2*MAX_SID_SIZE*pxdesc->defcnt;
|
||||
newattr = (char*)ntfs_malloc(newattrsz);
|
||||
if (newattr) {
|
||||
/* build the main header part */
|
||||
|
Loading…
Reference in New Issue
Block a user