Avoided to store deleted ACL as attribute with empty value

release-1.5.4.branch
Thomas Schmitt 14 years ago
parent dc26d8eefc
commit 7dfec561d9
  1. 3
      doc/susp_aaip_0_2.txt
  2. 6
      libisofs/libisofs.h
  3. 17
      libisofs/node.c

@ -344,6 +344,9 @@ Pending considerations:
- shall "AA" be fixely defined as signature ?
- shall an "ER" be issued at all ?
>>> look into SUSP 1.12 for ES
- shall the tag types ACL_USER and ACL_GROUP with non-numeric qualifier be
revoked ?

@ -4232,6 +4232,12 @@ int iso_node_get_acl_text(IsoNode *node, char **text, int flag);
/* ts A90119 */
/**
* Set the ACL of the given node to the list in parameter text or delete it.
*
* The POSIX permission bits get updated according to the new ACL if neither
* bit0 nor bit1 of parameter flag are set nor parameter text is NULL.
* Note that S_IRWXG permission bits correspond to ACL mask permissions
* if a "mask::" entry exists in the ACL. Only if there is no "mask::" then
* the "group::" entry corresponds to to S_IRWXG.
*
* @param node
* The node that is to be manipulated.

@ -1601,7 +1601,7 @@ int iso_node_set_acl_text(IsoNode *node, char *acl_text, int flag)
#ifdef Libisofs_with_aaiP
size_t num_attrs = 0, *value_lengths = NULL, i, consumed;
size_t num_attrs = 0, *value_lengths = NULL, i, j, consumed;
size_t a_text_fill = 0, d_text_fill = 0;
size_t v_len, acl_len= 0;
char **names = NULL, **values = NULL, *a_text = NULL, *d_text = NULL;
@ -1688,9 +1688,18 @@ int iso_node_set_acl_text(IsoNode *node, char *acl_text, int flag)
/* replace variable value */;
if (values[i] != NULL)
free(values[i]);
values[i] = (char *) acl;
acl = NULL;
value_lengths[i] = acl_len;
if(acl == NULL) { /* delete whole ACL attribute */
for (j = i + 1; j < num_attrs; j++) {
names[j - 1] = names[j];
value_lengths[j - 1] = value_lengths[j];
values[j - 1] = values[j];
}
num_attrs--;
} else {
values[i] = (char *) acl;
acl = NULL;
value_lengths[i] = acl_len;
}
/* Encode attributes and attach to node */
ret = iso_node_set_attrs(node, num_attrs, names, value_lengths, values,

Loading…
Cancel
Save