Improved error reporting with problems when extracting xattr or ACL

This commit is contained in:
Thomas Schmitt 2011-08-08 12:42:57 +00:00
parent 920513356b
commit 9f4fb2c69b
1 changed files with 9 additions and 2 deletions

View File

@ -249,7 +249,7 @@ int Xorriso_restore_is_identical(struct XorrisO *xorriso, void *in_node,
int Xorriso_restore_properties(struct XorrisO *xorriso, char *disk_path, int Xorriso_restore_properties(struct XorrisO *xorriso, char *disk_path,
IsoNode *node, int flag) IsoNode *node, int flag)
{ {
int ret, is_dir= 0; int ret, is_dir= 0, errno_copy= 0;
mode_t mode; mode_t mode;
uid_t uid; uid_t uid;
gid_t gid; gid_t gid;
@ -285,10 +285,17 @@ int Xorriso_restore_properties(struct XorrisO *xorriso, char *disk_path,
ret= iso_local_set_attrs(disk_path, num_attrs, names, value_lengths, ret= iso_local_set_attrs(disk_path, num_attrs, names, value_lengths,
values, 0); values, 0);
if(ret < 0) { if(ret < 0) {
errno_copy= errno;
if(ret != (int) ISO_AAIP_NO_SET_LOCAL)
errno_copy= 0;
Xorriso_report_iso_error(xorriso, "", ret,
"Error on iso_local_set_attrs",
0, "FAILURE", 1 | ((ret == -1)<<2) );
sprintf(xorriso->info_text, sprintf(xorriso->info_text,
"Cannot change ACL or xattr of disk file "); "Cannot change ACL or xattr of disk file ");
Text_shellsafe(disk_path, xorriso->info_text, 1); Text_shellsafe(disk_path, xorriso->info_text, 1);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE",0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno_copy,
"FAILURE",0);
{ret= 0; goto ex;} {ret= 0; goto ex;}
} }
} }