New options -setfattr, -setfattr_r, new find -exec setfattr

This commit is contained in:
2009-02-09 18:59:41 +00:00
parent fdabb16ad4
commit f4e0f103da
3 changed files with 84 additions and 39 deletions

View File

@@ -1885,6 +1885,7 @@ int Xorriso_node_get_dev(struct XorrisO *xorriso, IsoNode *node,
/* @param flag bit0= *node is already valid
bit1= add extra block for size estimation
bit2= complain loudely if path is missing in image
bit3= stbuf is to be used without eventual ACL
*/
int Xorriso_fake_stbuf(struct XorrisO *xorriso, char *path, struct stat *stbuf,
IsoNode **node, int flag)
@@ -1907,7 +1908,10 @@ int Xorriso_fake_stbuf(struct XorrisO *xorriso, char *path, struct stat *stbuf,
/* >>> stbuf->st_dev */
/* >>> stbuf->st_ino */
stbuf->st_mode= iso_node_get_permissions(*node) & 07777;
if(flag & 8)
stbuf->st_mode= iso_node_get_perms_wo_acl(*node) & 07777;
else
stbuf->st_mode= iso_node_get_permissions(*node) & 07777;
if(LIBISO_ISDIR(*node))
stbuf->st_mode|= S_IFDIR;
else if(LIBISO_ISREG(*node))
@@ -2927,12 +2931,8 @@ int Xorriso_restore_properties(struct XorrisO *xorriso, char *disk_path,
#endif /* Xorriso_with_aaiP */
if(is_dir && (flag&2)) {
/* >>> ??? need to stack ACL ? */
/* >>> ??? eventually obtain stbuf wo ACL */
ret= Xorriso_fake_stbuf(xorriso, "", &stbuf, &node, 1);
ret= Xorriso_fake_stbuf(xorriso, "", &stbuf, &node,
1 | ((!!(xorriso->do_aaip & 2)) << 3));
if(ret<=0)
{ret= 0; goto ex;}
ret= Permstack_push(&(xorriso->perm_stack), disk_path, &stbuf, 0);
@@ -6504,6 +6504,9 @@ int Xorriso_findi_action(struct XorrisO *xorriso, struct FindjoB *job,
ret= Xorriso_setfacl(xorriso, (void *) node, show_path, target, text_2,0);
} else if(action == 26) {
ret= Xorriso_getfattr(xorriso, (void *) node, show_path, 0);
} else if(action == 27) {
ret= Xorriso_path_setfattr(xorriso, (void *) node, show_path,
target, strlen(text_2), text_2, 0);
} else { /* includes : 15 in_iso */
sprintf(xorriso->result_line, "%s\n", Text_shellsafe(show_path, sfe, 0));
Xorriso_result(xorriso, 0);
@@ -9099,7 +9102,7 @@ ex:;
}
/* @param node Opaque handle to IsoNode which is to be manipulated
/* @param in_node Opaque handle to IsoNode which is to be manipulated
instead of path if it is not NULL.
@param path is used as address if node is NULL.
@param num_attrs Number of attributes
@@ -9151,6 +9154,7 @@ ex:;
return(ret);
}
/*
@param flag
Bitfield for control purposes