Followed changes in iso_node_*acl_text API

This commit is contained in:
Thomas Schmitt 2009-01-30 14:56:31 +00:00
parent 2df38d1710
commit 9be23662ce
4 changed files with 36 additions and 41 deletions

View File

@ -15603,10 +15603,10 @@ int Xorriso_option_setfacli(struct XorrisO *xorriso, char *acl_text,
Findjob_destroy(&job, 0);
} else {
ret= 1;
if(access_acl_text == NULL || access_acl_text[0])
ret= Xorriso_setfacl(xorriso, NULL, optv[i], access_acl_text, 0);
if(ret > 0 && (default_acl_text == NULL || default_acl_text[0]))
ret= Xorriso_setfacl(xorriso, NULL, optv[i], default_acl_text, 1);
if(access_acl_text == NULL || access_acl_text[0] ||
default_acl_text == NULL || default_acl_text[0])
ret= Xorriso_setfacl(xorriso, NULL, optv[i],
access_acl_text, default_acl_text, 0);
}
if(ret>0 && !xorriso->request_to_abort)
continue; /* regular bottom of loop */

View File

@ -1 +1 @@
#define Xorriso_timestamP "2009.01.29.210606"
#define Xorriso_timestamP "2009.01.30.145624"

View File

@ -2042,14 +2042,12 @@ int Xorriso_transfer_properties(struct XorrisO *xorriso, struct stat *stbuf,
if((xorriso->do_aaip & 1) && !(flag & 2)) {
a_ret= iso_local_get_acl_text(disk_path, &access_text, 16);
if(a_ret > 0 && (access_text != NULL || (flag & 4)))
a_ret= iso_node_set_acl_text(node, access_text, 0);
if(access_text != NULL)
iso_local_get_acl_text(disk_path, &access_text, 1 << 15);
if(S_ISDIR(stbuf->st_mode) && a_ret >= 0)
d_ret= iso_local_get_acl_text(disk_path, &default_text, 1);
if(d_ret > 0 && (default_text != NULL || (flag & 4)))
d_ret= iso_node_set_acl_text(node, default_text, 1);
if(access_text != NULL || default_text != NULL || (flag & 4))
a_ret= iso_node_set_acl_text(node, access_text, default_text, 0);
if(access_text != NULL)
iso_local_get_acl_text(disk_path, &access_text, 1 << 15);
if(default_text != NULL)
iso_local_get_acl_text(disk_path, &default_text, 1 << 15);
}
@ -2885,7 +2883,7 @@ int Xorriso_restore_properties(struct XorrisO *xorriso, char *disk_path,
uid_t uid;
gid_t gid;
struct utimbuf utime_buffer;
char sfe[5*SfileadrL], *text= NULL;
char sfe[5*SfileadrL], *access_text= NULL, *default_text= NULL;
struct stat stbuf;
ret= lstat(disk_path, &stbuf);
@ -2926,16 +2924,17 @@ int Xorriso_restore_properties(struct XorrisO *xorriso, char *disk_path,
#ifdef Xorriso_with_aaiP
if(xorriso->do_aaip & 2) {
ret= iso_node_get_acl_text(node, &text, 16);
ret= iso_node_get_acl_text(node, &access_text, &default_text, 16);
if(ret < 0) {
strcpy(xorriso->info_text, "Error with obtaining ACL for ");
Text_shellsafe(disk_path, xorriso->info_text, 1);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
{ret= 0; goto ex;}
}
if(text != NULL) {
ret= iso_local_set_acl_text(disk_path, text, 0);
if(access_text != NULL) {
ret= iso_local_set_acl_text(disk_path, access_text, 0);
if(ret == -1) {
cannot_change_acl:;
sprintf(xorriso->info_text,
"Cannot change ACL of disk file %s",
Text_shellsafe(disk_path, sfe, 0));
@ -2943,6 +2942,11 @@ int Xorriso_restore_properties(struct XorrisO *xorriso, char *disk_path,
{ret= 0; goto ex;}
}
}
if(default_text != NULL) {
ret= iso_local_set_acl_text(disk_path, default_text, 1);
if(ret == -1)
goto cannot_change_acl;
}
}
#endif /* Xorriso_with_aaiP */
@ -2966,8 +2970,7 @@ int Xorriso_restore_properties(struct XorrisO *xorriso, char *disk_path,
}
ret= 1;
ex:;
if(text != NULL)
free(text);
iso_node_get_acl_text(node, &access_text, &default_text, 1 << 15);
return(ret);
}
@ -6482,10 +6485,8 @@ int Xorriso_findi_action(struct XorrisO *xorriso, struct FindjoB *job,
} else if(action == 24) {
ret= Xorriso_getfacl(xorriso, (void *) node, show_path, NULL, 0);
} else if(action == 25) {
if(target == NULL || target[0])
ret= Xorriso_setfacl(xorriso, (void *) node, show_path, target, 0);
if(ret > 0 && (text_2 == NULL || text_2[0]))
ret= Xorriso_setfacl(xorriso, (void *) node, show_path, text_2, 1);
if(target == NULL || target[0] || text_2 == NULL || text_2[0])
ret= Xorriso_setfacl(xorriso, (void *) node, show_path, target, text_2,0);
} else { /* includes : 15 in_iso */
sprintf(xorriso->result_line, "%s\n", Text_shellsafe(show_path, sfe, 0));
Xorriso_result(xorriso, 0);
@ -8832,13 +8833,8 @@ int Xorriso_getfacl(struct XorrisO *xorriso, void *in_node, char *path,
}
#ifdef Xorriso_with_aaiP
ret= iso_node_get_acl_text(node, &text, 0);
d_ret= 0;
if(ret > 0 && LIBISO_ISDIR(node)) {
d_ret= iso_node_get_acl_text(node, &d_text, 1 | 16);
if(d_ret > 0 && d_text == 0)
d_ret= 0;
}
ret= iso_node_get_acl_text(node, &text, &d_text, 0);
d_ret= (d_text != NULL);
#else
ret= d_ret= 0;
#endif
@ -8852,10 +8848,10 @@ int Xorriso_getfacl(struct XorrisO *xorriso, void *in_node, char *path,
ret= 0; goto ex;
}
if(flag & 2) {
ret= 1 + (ret != 1);
ret= 1 + (ret != 1 && d_ret == 0);
goto ex;
}
if((ret == 0 || ret == 2) && (d_ret == 0 || d_ret == 2)) {
if((ret == 0 || ret == 2) && d_ret == 0) {
if(flag & 1) {
ret= 1 + (ret == 0);
goto ex;
@ -8954,10 +8950,7 @@ int Xorriso_getfacl(struct XorrisO *xorriso, void *in_node, char *path,
}
ret= 1;
ex:;
if(d_text != NULL)
free(d_text);
if(text != NULL)
free(text);
iso_node_get_acl_text(node, &text, &d_text, 1 << 15);
if(bsl_path != NULL)
free(bsl_path);
return(ret);
@ -8981,12 +8974,13 @@ int Xorriso_set_ignore_aclea(struct XorrisO *xorriso, int flag)
/* @param 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 acl_text ACL in long text form
@param flag bit0=set "default" ACL rather than "access" ACL
@param access_text "access" ACL in long text form
@param default_text "default" ACL in long text form
@param flag Unused yet, submit 0
@return >0 success , <=0 failure
*/
int Xorriso_setfacl(struct XorrisO *xorriso, void *in_node, char *path,
char *acl_text, int flag)
char *access_text, char *default_text, int flag)
{
int ret;
IsoNode *node;
@ -8999,7 +8993,7 @@ int Xorriso_setfacl(struct XorrisO *xorriso, void *in_node, char *path,
}
#ifdef Xorriso_with_aaiP
ret= iso_node_set_acl_text(node, acl_text, flag & 1);
ret= iso_node_set_acl_text(node, access_text, default_text, 0);
#else
ret= 0;
#endif

View File

@ -406,12 +406,13 @@ int Xorriso_set_ignore_aclea(struct XorrisO *xorriso, int flag);
/* @param 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 acl_text ACL in long text form
@param flag bit0=set "default" ACL rather than "access" ACL
@param access_text "access" ACL in long text form
@param default_text "default" ACL in long text form
@param flag Unused yet, submit 0
@return >0 success , <=0 failure
*/
int Xorriso_setfacl(struct XorrisO *xorriso, void *in_node, char *path,
char *acl_text, int flag);
char *access_text, char *default_text, int flag);
/* A pseudo file type for El-Torito bootsectors as in man 2 stat :
For now take the highest possible value.