voiding to store empty ACL for all directories withou ACL
This commit is contained in:
parent
c801fa60f7
commit
aae339fe49
@ -31,11 +31,13 @@
|
|||||||
with bit15 of flag.
|
with bit15 of flag.
|
||||||
@param flag Bitfield for control purposes
|
@param flag Bitfield for control purposes
|
||||||
bit0= obtain default ACL rather than access ACL
|
bit0= obtain default ACL rather than access ACL
|
||||||
|
behave like bit4 if ACL is empty
|
||||||
bit4= set *text = NULL and return 2
|
bit4= set *text = NULL and return 2
|
||||||
if the ACL matches st_mode permissions.
|
if the ACL matches st_mode permissions.
|
||||||
bit15= free text and return 1
|
bit15= free text and return 1
|
||||||
@return 1 ok
|
@return 1 ok
|
||||||
2 only st_mode permissions exist and bit 4 is set
|
2 only st_mode permissions exist and bit 4 is set
|
||||||
|
or empty ACL and bit0 is set
|
||||||
-1 failure of system ACL service (see errno)
|
-1 failure of system ACL service (see errno)
|
||||||
*/
|
*/
|
||||||
int aaip_get_acl_text(char *path, char **text, int flag)
|
int aaip_get_acl_text(char *path, char **text, int flag)
|
||||||
@ -65,6 +67,8 @@ int aaip_get_acl_text(char *path, char **text, int flag)
|
|||||||
if(!(ret & (7 | 64)))
|
if(!(ret & (7 | 64)))
|
||||||
(*text)[0]= 0;
|
(*text)[0]= 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if(flag & (1 | 16)) {
|
||||||
if((*text)[0] == 0 || strcmp(*text, "\n") == 0) {
|
if((*text)[0] == 0 || strcmp(*text, "\n") == 0) {
|
||||||
acl_free(text);
|
acl_free(text);
|
||||||
*text= NULL;
|
*text= NULL;
|
||||||
|
@ -509,12 +509,16 @@ int lfs_get_aa_string(IsoFileSource *src, unsigned char **aa_string, int flag)
|
|||||||
ret = ISO_FILE_ERROR;
|
ret = ISO_FILE_ERROR;
|
||||||
goto ex;
|
goto ex;
|
||||||
}
|
}
|
||||||
|
if (num_attrs == 0)
|
||||||
|
result = NULL;
|
||||||
|
else {
|
||||||
sret = aaip_encode("AA", num_attrs, names,
|
sret = aaip_encode("AA", num_attrs, names,
|
||||||
value_lengths, values, &result_len, &result, 0);
|
value_lengths, values, &result_len, &result, 0);
|
||||||
if (sret == 0) {
|
if (sret == 0) {
|
||||||
ret = ISO_OUT_OF_MEM;
|
ret = ISO_OUT_OF_MEM;
|
||||||
goto ex;
|
goto ex;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
*aa_string = result;
|
*aa_string = result;
|
||||||
ret = 1;
|
ret = 1;
|
||||||
ex:;
|
ex:;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user