From b55cea36b1d75edaeddd9c0b84d2248b1d27d020 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Thu, 22 Jan 2009 15:50:54 +0000 Subject: [PATCH] Removing leading slash from -getfacl output of file path --- xorriso/xorriso_timestamp.h | 2 +- xorriso/xorrisoburn.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/xorriso/xorriso_timestamp.h b/xorriso/xorriso_timestamp.h index e0154815..bf5b9210 100644 --- a/xorriso/xorriso_timestamp.h +++ b/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2009.01.22.152252" +#define Xorriso_timestamP "2009.01.22.155049" diff --git a/xorriso/xorrisoburn.c b/xorriso/xorrisoburn.c index 683a2fe2..4f29b07d 100644 --- a/xorriso/xorrisoburn.c +++ b/xorriso/xorrisoburn.c @@ -8749,6 +8749,7 @@ ok:; ACL text (without comments) of the file object. In this case it finally has to be freed by the caller. @param flag bit0= do not report to result but only retrieve ACL text + bit1= do not strip leading '/' from "# file:" @return 2 ok, no ACL available, eventual *acl_text will be NULL 1 ok, ACL available, eventual *acl_text stems from malloc() <=0 error @@ -8756,7 +8757,7 @@ ok:; int Xorriso_getfacl(struct XorrisO *xorriso, char *path, char **acl_text, int flag) { - int ret; + int ret, path_offset= 0; IsoNode *node; char *text= NULL, *cpt, *npt; uid_t uid; @@ -8797,8 +8798,10 @@ int Xorriso_getfacl(struct XorrisO *xorriso, char *path, char **acl_text, {ret= 2; goto ex;} } + if(path[0] == '/' && !(flag & 2)) + path_offset= 1; strcpy(xorriso->result_line, "# file: "); - Text_shellsafe(path, xorriso->result_line, 1); + Text_shellsafe(path + path_offset, xorriso->result_line, 1); strcat(xorriso->result_line, "\n"); Xorriso_result(xorriso, 0);