From 955829940094989412c16ceefaf0895fb3a0abe5 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sat, 22 Mar 2008 13:05:25 +0000 Subject: [PATCH] Bug fix: Implicite directory attribute copying with -cut_out was wrong --- libisoburn/trunk/xorriso/xorriso_timestamp.h | 2 +- libisoburn/trunk/xorriso/xorrisoburn.c | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/libisoburn/trunk/xorriso/xorriso_timestamp.h b/libisoburn/trunk/xorriso/xorriso_timestamp.h index 19e98bbd..b29782ff 100644 --- a/libisoburn/trunk/xorriso/xorriso_timestamp.h +++ b/libisoburn/trunk/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2008.03.22.130031" +#define Xorriso_timestamP "2008.03.22.130128" diff --git a/libisoburn/trunk/xorriso/xorrisoburn.c b/libisoburn/trunk/xorriso/xorrisoburn.c index 89f52eb1..3361e319 100644 --- a/libisoburn/trunk/xorriso/xorrisoburn.c +++ b/libisoburn/trunk/xorriso/xorrisoburn.c @@ -1776,6 +1776,8 @@ ex: } +/* @param flag bit0= cut_out mode : base on leaf parent directory +*/ int Xorriso_copy_implict_properties(struct XorrisO *xorriso, IsoDir *dir, char *full_img_path, char *img_path, char *full_disk_path, int flag) { @@ -1798,7 +1800,7 @@ int Xorriso_copy_implict_properties(struct XorrisO *xorriso, IsoDir *dir, nfic= Sfile_count_components(nfi, 0); nic= Sfile_count_components(ni, 0); nfdc= Sfile_count_components(nfd, 0); - d= nfic-nic; + d= nfic-(flag&1)-nic; if(d<0) return(-1); if(d>nfdc) @@ -1813,12 +1815,22 @@ int Xorriso_copy_implict_properties(struct XorrisO *xorriso, IsoDir *dir, strcpy(nfd, "/"); if(stat(nfd, &stbuf)==-1) return(0); + if((flag&1) && d==0) { + /* give directory x-permission where is r-permission */ + if(stbuf.st_mode&S_IRUSR) + stbuf.st_mode|= S_IXUSR; + if(stbuf.st_mode&S_IRGRP) + stbuf.st_mode|= S_IXGRP; + if(stbuf.st_mode&S_IROTH) + stbuf.st_mode|= S_IXOTH; + } Xorriso_transfer_properties(xorriso, &stbuf, (IsoNode *) dir, 0); sprintf(xorriso->info_text, "Copied properties for %s", Text_shellsafe(ni, sfe, 0)); sprintf(xorriso->info_text+strlen(xorriso->info_text), " from %s", Text_shellsafe(nfd, sfe, 0)); - Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); + if((flag&1) && d==0) + Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); return(1); } @@ -2024,7 +2036,7 @@ handle_path_node:; if(disk_path!=NULL && !done) Xorriso_copy_implict_properties(xorriso, dir, img_path, path, disk_path, - 0); + !!(flag&8)); } if(done) {