New optional tolerance towards failure to restore "default" ACLS on FreeBSD.
This commit is contained in:
parent
ca63dac7e3
commit
2ba54fafe7
@ -648,9 +648,13 @@ ex:;
|
||||
@param flag Bitfield for control purposes
|
||||
bit0= set default ACL rather than access ACL
|
||||
bit5= in case of symbolic link: manipulate link target
|
||||
bit6= tolerate inappropriate presence or absence of
|
||||
directory default ACL
|
||||
@return > 0 ok
|
||||
0 no suitable ACL manipulation adapter available
|
||||
-1 failure of system ACL service (see errno)
|
||||
-2 ACL support not enabled at compile time
|
||||
-2 attempt to manipulate ACL of a symbolic link
|
||||
without bit5 resp. with no suitable link target
|
||||
*/
|
||||
int aaip_set_acl_text(char *path, char *text, int flag)
|
||||
{
|
||||
@ -691,7 +695,7 @@ ex:
|
||||
|
||||
#else /* Libisofs_with_aaip_acL */
|
||||
|
||||
return(-2);
|
||||
return(0);
|
||||
|
||||
#endif /* ! Libisofs_with_aaip_acL */
|
||||
|
||||
@ -739,7 +743,9 @@ static int aaip_extattr_delete_names(char *path, int attrnamespace,
|
||||
bit3= do not ignore eventual non-user attributes.
|
||||
I.e. those with a name which does not begin
|
||||
by "user."
|
||||
bit5= in case of symbolic link: manipulate link target
|
||||
bit5= in case of symbolic link: manipulate link target
|
||||
bit6= tolerate inappropriate presence or absence of
|
||||
directory default ACL
|
||||
@return 1 success
|
||||
-1 error memory allocation
|
||||
-2 error with decoding of ACL
|
||||
@ -852,19 +858,15 @@ int aaip_set_attr_list(char *path, size_t num_attrs, char **names,
|
||||
has_default_acl= (ret == 2);
|
||||
|
||||
#ifdef Libisofs_with_aaip_acL
|
||||
ret= aaip_set_acl_text(path, acl_text, flag & 32);
|
||||
ret= aaip_set_acl_text(path, acl_text, flag & (32 | 64));
|
||||
if(ret <= 0)
|
||||
{ret= -3; goto ex;}
|
||||
#else
|
||||
{ret= -7; goto ex;}
|
||||
#endif
|
||||
|
||||
if(has_default_acl) {
|
||||
|
||||
/* >>> EXTATTR : Give opportunity to ignore default ACLs */;
|
||||
|
||||
if(has_default_acl && !(flag & 64))
|
||||
{ret= -3; goto ex;}
|
||||
}
|
||||
|
||||
ret= 1;
|
||||
ex:;
|
||||
|
@ -423,7 +423,9 @@ ex:
|
||||
bit3= do not ignore eventual non-user attributes.
|
||||
I.e. those with a name which does not begin
|
||||
by "user."
|
||||
bit5= in case of symbolic link: manipulate link target
|
||||
bit5= in case of symbolic link: manipulate link target
|
||||
bit6= tolerate inappropriate presence or absense of
|
||||
directory default ACL
|
||||
@return 1 success
|
||||
-1 error memory allocation
|
||||
-2 error with decoding of ACL
|
||||
@ -557,6 +559,14 @@ int aaip_set_attr_list(char *path, size_t num_attrs, char **names,
|
||||
ret= aaip_set_acl_text(path, acl_text, 1 | (flag & 32));
|
||||
if(ret <= 0)
|
||||
{ret= -3; goto ex;}
|
||||
} else {
|
||||
if(!(flag & 64)) {
|
||||
|
||||
/* >>> ??? take offense from missing default ACL ?
|
||||
??? does Linux demand a default ACL for directories with access ACL ?
|
||||
*/;
|
||||
|
||||
}
|
||||
}
|
||||
ret= 1;
|
||||
ex:;
|
||||
|
@ -868,7 +868,7 @@ int iso_local_set_attrs(char *disk_path, size_t num_attrs, char **names,
|
||||
int ret;
|
||||
|
||||
ret = aaip_set_attr_list(disk_path, num_attrs, names, value_lengths,
|
||||
values, (flag & (8 | 32)) | !(flag & 1));
|
||||
values, (flag & (8 | 32 | 64)) | !(flag & 1));
|
||||
if (ret <= 0) {
|
||||
if (ret == -1)
|
||||
return ISO_OUT_OF_MEM;
|
||||
|
@ -5858,7 +5858,7 @@ int iso_local_get_acl_text(char *disk_path, char **text, int flag);
|
||||
* bit5= in case of symbolic link: manipulate link target
|
||||
* @return
|
||||
* > 0 ok
|
||||
* 0 no ACL manipulation adapter available
|
||||
* 0 no ACL manipulation adapter available for desired ACL type
|
||||
* -1 failure of system ACL service (see errno)
|
||||
* -2 attempt to manipulate ACL of a symbolic link without bit5
|
||||
* resp. with no suitable link target
|
||||
@ -5947,6 +5947,9 @@ int iso_local_get_attrs(char *disk_path, size_t *num_attrs, char ***names,
|
||||
* bit3= do not ignore eventual non-user attributes.
|
||||
* I.e. those with a name which does not begin by "user."
|
||||
* bit5= in case of symbolic link: manipulate link target
|
||||
* bit6= @since 1.1.6
|
||||
tolerate inappropriate presence or absence of
|
||||
* directory "default" ACL
|
||||
* @return
|
||||
* 1 = ok
|
||||
* < 0 = error
|
||||
|
Loading…
Reference in New Issue
Block a user