Fixed a bug about setting "default" ACL on Linux directories.

This commit is contained in:
Thomas Schmitt 2009-02-09 11:17:33 +01:00
parent b1f8161006
commit b09dcd5246
3 changed files with 10 additions and 4 deletions

View File

@ -372,7 +372,7 @@ int aaip_set_attr_list(char *path, size_t num_attrs, char **names,
size_t *value_lengths, char **values, int flag)
{
int ret, has_default_acl= 0;
size_t i, consumed, acl_text_fill, list_size= 0, acl_idx= 0;
size_t i, consumed, acl_text_fill, list_size= 0, acl_idx= 0, h_consumed;
char *acl_text= NULL, *list= NULL;
#ifdef Libisofs_with_aaip_xattR
@ -469,7 +469,7 @@ int aaip_set_attr_list(char *path, size_t num_attrs, char **names,
free(acl_text);
acl_text= NULL;
ret= aaip_decode_acl((unsigned char *) (values[i] + consumed),
value_lengths[i] - consumed, &consumed,
value_lengths[i] - consumed, &h_consumed,
NULL, 0, &acl_text_fill, 1);
if(ret <= 0)
{ret= -2; goto ex;}
@ -477,7 +477,7 @@ int aaip_set_attr_list(char *path, size_t num_attrs, char **names,
if(acl_text == NULL)
{ret= -1; goto ex;}
ret= aaip_decode_acl((unsigned char *) (values[i] + consumed),
value_lengths[i] - consumed, &consumed,
value_lengths[i] - consumed, &h_consumed,
acl_text, acl_text_fill, &acl_text_fill, 0);
if(ret <= 0)
{ret= -2; goto ex;}

View File

@ -4351,6 +4351,7 @@ int iso_node_set_acl_text(IsoNode *node,
* Like iso_node_get_permissions but reflecting ACL entry "group::" in S_IRWXG
* rather than ACL entry "mask::". This is necessary if the permissions of a
* node with ACL shall be restored to a filesystem without restoring the ACL.
* The same mapping happens internally when the ACL of a node is deleted.
* If the node has no ACL then the result is iso_node_get_permissions(node).
* @param node
* The node that is to be inquired.

View File

@ -2160,8 +2160,13 @@ int iso_local_set_attrs(char *disk_path, size_t num_attrs, char **names,
ret = aaip_set_attr_list(disk_path, num_attrs, names, value_lengths,
values, (flag & (8 | 32)) | !(flag & 1));
if (ret <= 0)
if (ret <= 0) {
if (ret == -1)
return ISO_OUT_OF_MEM;
if (ret == -2)
return ISO_AAIP_BAD_AASTRING;
return ISO_AAIP_NO_SET_LOCAL;
}
return 1;
#else /* Libisofs_with_aaiP */