diff --git a/libisoburn/trunk/xorriso/xorriso.c b/libisoburn/trunk/xorriso/xorriso.c index a0585e31..1932ef8c 100644 --- a/libisoburn/trunk/xorriso/xorriso.c +++ b/libisoburn/trunk/xorriso/xorriso.c @@ -631,6 +631,8 @@ ex:; /* @param flag bit0= only encode inside quotes bit1= encode < 32 outside quotes except 7, 8, 9, 10, 12, 13 bit2= encode in any case above 126 + bit3= encode in any case shellsafe: + <=42 , 59, 60, 62, 63, 92, 94, 96, >=123 */ int Sfile_bsl_encoder(char **result, char *text, int flag) { @@ -640,9 +642,14 @@ int Sfile_bsl_encoder(char **result, char *text, int flag) count= 0; for(rpt= text; *rpt != 0; rpt++) { count++; - if(*rpt >= 32 && *rpt <= 126 && *rpt != '\\') + if(flag & 8) { + if(!(*rpt <= 42 || *rpt == 59 || *rpt == 60 || *rpt == 62 || + *rpt == 63 || *rpt == 92 || *rpt == 94 || *rpt == 96 || + *rpt >= 123)) continue; - if((*rpt >= 7 && *rpt <= 13) || *rpt == 27 || *rpt == '\\') + } else if(*rpt >= 32 && *rpt <= 126 && *rpt != '\\') + continue; + if(((*rpt >= 7 && *rpt <= 13) || *rpt == 27 || *rpt == '\\') && !(flag & 8)) count++; else count+= 3; @@ -655,21 +662,28 @@ int Sfile_bsl_encoder(char **result, char *text, int flag) sq_open= !(sq_open || dq_open); if(*rpt == '"') dq_open= !(sq_open || dq_open); - if(*rpt >= 32 && *rpt <= 126 && *rpt != '\\') { + + if(flag & 8) { + if(!(*rpt <= 42 || *rpt == 59 || *rpt == 60 || *rpt == 62 || + *rpt == 63 || *rpt == 92 || *rpt == 94 || *rpt == 96 || + *rpt >= 123)) { + *(wpt++)= *rpt; + continue; + } + } else if(*rpt >= 32 && *rpt <= 126 && *rpt != '\\') { *(wpt++)= *rpt; continue; - } - if( ((flag & 1) && !(sq_open || dq_open)) && - !((flag & 2) && (*rpt >= 1 && * rpt <= 31 && - !(*rpt == 7 || *rpt == 8 || *rpt == 9 || *rpt == 10 || - *rpt == 12 || *rpt == 13))) && - !((flag & 4) && (*rpt > 126 || *rpt < 0)) && - !((flag & 6) && *rpt == '\\')) { + } else if( ((flag & 1) && !(sq_open || dq_open)) && + !((flag & 2) && (*rpt >= 1 && * rpt <= 31 && + !(*rpt == 7 || *rpt == 8 || *rpt == 9 || *rpt == 10 || + *rpt == 12 || *rpt == 13))) && + !((flag & 4) && (*rpt > 126 || *rpt < 0)) && + !((flag & 6) && *rpt == '\\')) { *(wpt++)= *rpt; continue; } *(wpt++)= '\\'; - if((*rpt >= 7 && *rpt <= 13) || *rpt == 27 || *rpt == '\\') { + if(((*rpt >= 7 && *rpt <= 13) || *rpt == 27 || *rpt == '\\') && !(flag&8)) { if(*rpt == 7) *(wpt++)= 'a'; else if(*rpt == 8) @@ -15386,6 +15400,22 @@ ex:; } +/* Options -setfacl_list alias -setfacl_listi */ +int Xorriso_option_setfacl_listi(struct XorrisO *xorriso, char *path, int flag) +{ + + /* >>> Open path */; + /* >>> Loop over lines */; + /* >>> if(strncmp(line, */; + /* >>> */; + /* >>> */; + /* >>> */; + /* >>> */; + + return(1); +} + + /* Options -setfacl alias -setfacli, -setfacl_r alias -setfacl_ri */ /* @param flag bit0=recursive -setfacl_r */ @@ -15972,7 +16002,8 @@ int Xorriso_count_args(struct XorrisO *xorriso, int argc, char **argv, "ls","lsi","lsl","lsli","lsd","lsdi","lsdl","lsdli", "lsx","lslx","lsdx","lsdlx","map_l","mv","mvi","mkdir","mkdiri", "not_paths","rm","rmi","rm_r","rm_ri","rmdir","rmdiri","update_l", - "setfacl","setfacli","setfacl_r","setfacl_ri", + "setfacl","setfacli","setfacl_list","setfacl_listi", + "setfacl_r","setfacl_ri", "" }; @@ -16602,6 +16633,10 @@ next_command:; (*idx)+= 1; ret= Xorriso_option_setfacli(xorriso, arg1, argc, argv, idx, 0); + } else if(strcmp(cmd,"setfacl_list")==0 || strcmp(cmd,"setfacl_listi")==0) { + (*idx)+= 1; + ret= Xorriso_option_setfacl_listi(xorriso, arg1, 0); + } else if(strcmp(cmd,"setfacl_r")==0 || strcmp(cmd,"setfacl_ri")==0) { (*idx)+= 1; ret= Xorriso_option_setfacli(xorriso, arg1, argc, argv, idx, 1); diff --git a/libisoburn/trunk/xorriso/xorriso_private.h b/libisoburn/trunk/xorriso/xorriso_private.h index 46ae9896..80c91d32 100644 --- a/libisoburn/trunk/xorriso/xorriso_private.h +++ b/libisoburn/trunk/xorriso/xorriso_private.h @@ -654,6 +654,13 @@ int Sfile_count_components(char *path, int flag); */ int Sfile_type(char *filename, int flag); +/* @param flag bit0= only encode inside quotes + bit1= encode < 32 outside quotes except 7, 8, 9, 10, 12, 13 + bit2= encode in any case above 126 + bit3= encode in any case shellsafe: + <=42 , 59, 60, 62, 63, 92, 94, 96, >=123 +*/ +int Sfile_bsl_encoder(char **result, char *text, int flag); char *Text_shellsafe(char *in_text, char *out_text, int flag); diff --git a/libisoburn/trunk/xorriso/xorriso_timestamp.h b/libisoburn/trunk/xorriso/xorriso_timestamp.h index 4ea3021d..93d18b7a 100644 --- a/libisoburn/trunk/xorriso/xorriso_timestamp.h +++ b/libisoburn/trunk/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2009.01.28.114755" +#define Xorriso_timestamP "2009.01.28.190140" diff --git a/libisoburn/trunk/xorriso/xorrisoburn.c b/libisoburn/trunk/xorriso/xorrisoburn.c index 80b68d47..c8472af4 100644 --- a/libisoburn/trunk/xorriso/xorrisoburn.c +++ b/libisoburn/trunk/xorriso/xorrisoburn.c @@ -8815,9 +8815,9 @@ ok:; int Xorriso_getfacl(struct XorrisO *xorriso, void *in_node, char *path, char **acl_text, int flag) { - int ret, d_ret, path_offset= 0, result_len= 0, pass; + int ret, d_ret, path_offset= 0, result_len= 0, pass, bsl_mem; IsoNode *node; - char *text= NULL, *d_text= NULL, *cpt, *npt; + char *text= NULL, *d_text= NULL, *cpt, *npt, *bsl_path= NULL; uid_t uid; gid_t gid; struct passwd *pwd; @@ -8875,10 +8875,19 @@ int Xorriso_getfacl(struct XorrisO *xorriso, void *in_node, char *path, if(!(flag & 1)) { if(path[0] == '/' && !(flag & 2)) path_offset= 1; - strcpy(xorriso->result_line, "# file: "); - Text_shellsafe(path + path_offset, xorriso->result_line, 1); - strcat(xorriso->result_line, "\n"); + + /* backslash escaped path rather than shellsafe path */ + ret= Sfile_bsl_encoder(&bsl_path, path + path_offset, 8); + if(ret <= 0) + {ret= -1; goto ex;} + sprintf(xorriso->result_line, "# file: %s\n", bsl_path); + free(bsl_path); + bsl_path= NULL; + /* temporarily disable -backslash_codes with result output */ + bsl_mem= xorriso->bsl_interpretation; + xorriso->bsl_interpretation= 0; Xorriso_result(xorriso, 0); + xorriso->bsl_interpretation= bsl_mem; uid= iso_node_get_uid(node); pwd= getpwuid(uid); @@ -8949,6 +8958,8 @@ ex:; free(d_text); if(text != NULL) free(text); + if(bsl_path != NULL) + free(bsl_path); return(ret); }