Removing leading slash from -getfacl output of file path

This commit is contained in:
Thomas Schmitt 2009-01-22 15:50:54 +00:00
parent 8bb3c084e3
commit b55cea36b1
2 changed files with 6 additions and 3 deletions

View File

@ -1 +1 @@
#define Xorriso_timestamP "2009.01.22.152252"
#define Xorriso_timestamP "2009.01.22.155049"

View File

@ -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);