Bug fix: The function for restoring ACLs and xattr returned error on systems

other than Linux and FreeBSD, even if nothing was to be restored.
This commit is contained in:
Thomas Schmitt 2011-08-08 08:25:18 +02:00
parent b90e613246
commit 6ae8386c23
3 changed files with 24 additions and 2 deletions

View File

@ -89,8 +89,12 @@ int aaip_set_attr_list(char *path, size_t num_attrs, char **names,
continue;
}
/* Extended Attribute */
if(!(flag & 4))
return(-6);
if(flag & 4)
continue;
if(!(flag & 8))
if(strncmp(names[i], "user.", 5))
continue;
return(-6);
}
if(flag & 2)
return(-6);

View File

@ -447,10 +447,26 @@ int aaip_set_attr_list(char *path, size_t num_attrs, char **names,
continue;
}
/* Extended Attribute */
#ifdef Libisofs_aaip_linux_set_attr_list_neW
/* >>> Enable this after release 1.1.4. */
if(flag & 4)
continue;
if(!(flag & 8))
if(strncmp(names[i], "user.", 5))
continue;
#else /* Libisofs_aaip_linux_set_attr_list_neW */
/* <<< This worked well, but obviously only because bit0 is always set */
if((flag & 1) && !(flag & 8))
if(strncmp(names[i], "user.", 5))
continue;
#endif /* ! Libisofs_aaip_linux_set_attr_list_neW */
#ifdef Libisofs_with_aaip_xattR
if(flag & 32)

View File

@ -862,6 +862,8 @@ int iso_local_set_attrs(char *disk_path, size_t num_attrs, char **names,
return ISO_OUT_OF_MEM;
if (ret == -2)
return ISO_AAIP_BAD_AASTRING;
if (ret == -6 || ret == -7)
return ISO_AAIP_NOT_ENABLED;
return ISO_AAIP_NO_SET_LOCAL;
}
return 1;