voiding to store empty ACL for all directories withou ACL

This commit is contained in:
Thomas Schmitt 2009-01-23 13:17:22 +01:00
parent c801fa60f7
commit aae339fe49
2 changed files with 13 additions and 5 deletions

View File

@ -31,11 +31,13 @@
with bit15 of flag.
@param flag Bitfield for control purposes
bit0= obtain default ACL rather than access ACL
behave like bit4 if ACL is empty
bit4= set *text = NULL and return 2
if the ACL matches st_mode permissions.
bit15= free text and return 1
@return 1 ok
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)
*/
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)))
(*text)[0]= 0;
}
}
if(flag & (1 | 16)) {
if((*text)[0] == 0 || strcmp(*text, "\n") == 0) {
acl_free(text);
*text= NULL;

View File

@ -509,11 +509,15 @@ int lfs_get_aa_string(IsoFileSource *src, unsigned char **aa_string, int flag)
ret = ISO_FILE_ERROR;
goto ex;
}
sret = aaip_encode("AA", num_attrs, names,
value_lengths, values, &result_len, &result, 0);
if (sret == 0) {
ret = ISO_OUT_OF_MEM;
goto ex;
if (num_attrs == 0)
result = NULL;
else {
sret = aaip_encode("AA", num_attrs, names,
value_lengths, values, &result_len, &result, 0);
if (sret == 0) {
ret = ISO_OUT_OF_MEM;
goto ex;
}
}
*aa_string = result;
ret = 1;