Implemented -find actions chown_r, chgrp_r, chmod_r, alter_date_r, find
This commit is contained in:
@ -4,7 +4,7 @@
|
||||
a command line oriented batch and dialog tool which creates, loads,
|
||||
manipulates and burns ISO 9660 filesystem images.
|
||||
|
||||
Copyright 2007 Thomas Schmitt, <scdbackup@gmx.net>
|
||||
Copyright 2007-2008 Thomas Schmitt, <scdbackup@gmx.net>
|
||||
|
||||
Provided under GPL version 2.
|
||||
*/
|
||||
@ -2820,7 +2820,7 @@ int Xorriso_set_time(struct XorrisO *xorriso, char *in_path, time_t t,
|
||||
|
||||
int Xorriso_findi_action(struct XorrisO *xorriso, struct FindjoB *job,
|
||||
char *abs_path, char *show_path,
|
||||
struct iso_tree_node *node, int flag)
|
||||
struct iso_tree_node *node, int depth, int flag)
|
||||
{
|
||||
int ret, type, action= 0;
|
||||
uid_t user= 0;
|
||||
@ -2828,9 +2828,11 @@ int Xorriso_findi_action(struct XorrisO *xorriso, struct FindjoB *job,
|
||||
time_t date= 0;
|
||||
mode_t mode_or= 0, mode_and= ~1;
|
||||
char *target, sfe[5*SfileadrL];
|
||||
struct FindjoB *subjob;
|
||||
struct stat dir_stbuf;
|
||||
|
||||
action= Findjob_get_action_parms(job, &target, &user, &group,
|
||||
&mode_and, &mode_or, &type, &date, 0);
|
||||
&mode_and, &mode_or, &type, &date, &subjob, 0);
|
||||
if(action<0)
|
||||
action= 0;
|
||||
|
||||
@ -2854,6 +2856,9 @@ int Xorriso_findi_action(struct XorrisO *xorriso, struct FindjoB *job,
|
||||
ret= Xorriso_set_time(xorriso, abs_path, date, type&7);
|
||||
} else if(action==8) { /* lsdl */
|
||||
ret= Xorriso_ls_filev(xorriso, "", 1, &abs_path, (off_t) 0, 1|2|8);
|
||||
} else if(action>=9 && action<=13) { /* actions which have own findjobs */
|
||||
Findjob_set_start_path(subjob, abs_path, 0);
|
||||
ret= Xorriso_findi(xorriso, subjob, NULL, abs_path, &dir_stbuf, depth, 0);
|
||||
} else {
|
||||
sprintf(xorriso->result_line, "%s\n", Text_shellsafe(show_path, sfe, 0));
|
||||
Xorriso_result(xorriso, 0);
|
||||
@ -2924,7 +2929,7 @@ int Xorriso_findi(struct XorrisO *xorriso, struct FindjoB *job,
|
||||
Xorriso_result(xorriso, 0);
|
||||
#else
|
||||
ret= Xorriso_findi_action(xorriso, job, path, dir_path,
|
||||
(struct iso_tree_node *) dir_node, 0);
|
||||
(struct iso_tree_node *) dir_node, depth, 0);
|
||||
if(ret<=0)
|
||||
goto ex;
|
||||
#endif /* ! NIX */
|
||||
@ -2964,7 +2969,7 @@ int Xorriso_findi(struct XorrisO *xorriso, struct FindjoB *job,
|
||||
ret= Xorriso_make_abs_adr(xorriso, xorriso->wdi, path, abs_path, 1|4);
|
||||
if(ret<=0)
|
||||
goto ex;
|
||||
ret= Xorriso_findi_action(xorriso, job, abs_path, path, node, 0);
|
||||
ret= Xorriso_findi_action(xorriso, job, abs_path, path, node, depth, 0);
|
||||
if(ret<=0) {
|
||||
if(Xorriso_eval_problem_status(xorriso, ret, 1|2)<0)
|
||||
goto ex;
|
||||
|
Reference in New Issue
Block a user