From 38b67592707ab9b494a383ed233d3b3d11e19130 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sun, 8 Feb 2009 15:14:05 +0000 Subject: [PATCH] Displaying "+" with lslx if ACL is detected --- libisoburn/trunk/xorriso/xorriso.c | 6 ++-- libisoburn/trunk/xorriso/xorriso_timestamp.h | 2 +- libisoburn/trunk/xorriso/xorrisoburn.c | 31 ++++++++++++++++++++ libisoburn/trunk/xorriso/xorrisoburn.h | 3 ++ 4 files changed, 39 insertions(+), 3 deletions(-) diff --git a/libisoburn/trunk/xorriso/xorriso.c b/libisoburn/trunk/xorriso/xorriso.c index dcf11698..53533a98 100644 --- a/libisoburn/trunk/xorriso/xorriso.c +++ b/libisoburn/trunk/xorriso/xorriso.c @@ -8349,7 +8349,7 @@ int Xorriso_lsx_filev(struct XorrisO *xorriso, char *wd, int filec, char **filev, off_t boss_mem, int flag) { int i, ret, was_error= 0, dfilec= 0, pass, passes; - char sfe[5*SfileadrL], sfe2[5*SfileadrL], path[SfileadrL]; + char sfe[5*SfileadrL], sfe2[5*SfileadrL], path[SfileadrL], *acl_text= NULL; char *rpt, link_target[SfileadrL], **dfilev= NULL; off_t size; struct stat stbuf; @@ -8430,7 +8430,9 @@ int Xorriso_lsx_filev(struct XorrisO *xorriso, char *wd, link_target[0]= 0; rpt[0]= 0; if((flag&5)==1) { - ret= Xorriso_format_ls_l(xorriso, &stbuf, 0); + ret= Xorriso_local_getfacl(xorriso, path, &acl_text, 16); + ret= Xorriso_format_ls_l(xorriso, &stbuf, (acl_text != NULL) << 1); + Xorriso_local_getfacl(xorriso, path, &acl_text, 1 << 15); if(ret<=0) continue; if(S_ISLNK(stbuf.st_mode)) { diff --git a/libisoburn/trunk/xorriso/xorriso_timestamp.h b/libisoburn/trunk/xorriso/xorriso_timestamp.h index 16d47c06..2b970167 100644 --- a/libisoburn/trunk/xorriso/xorriso_timestamp.h +++ b/libisoburn/trunk/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2009.02.08.132116" +#define Xorriso_timestamP "2009.02.08.151354" diff --git a/libisoburn/trunk/xorriso/xorrisoburn.c b/libisoburn/trunk/xorriso/xorrisoburn.c index 702284ab..c9b19d62 100644 --- a/libisoburn/trunk/xorriso/xorrisoburn.c +++ b/libisoburn/trunk/xorriso/xorrisoburn.c @@ -9151,3 +9151,34 @@ ex:; return(ret); } +/* + @param flag + Bitfield for control purposes + bit0= get default ACL rather than access ACL + bit4= set *text = NULL and return 2 + if the ACL matches st_mode permissions. + bit5= in case of symbolic link: inquire link target + bit15= free text and return 1 + @return + 1 ok + 2 ok, trivial ACL found while bit4 is set, *text is NULL + 0 no ACL manipulation adapter available + -1 failure of system ACL service (see errno) + -2 attempt to inquire ACL of a symbolic link without bit4 or bit5 + resp. with no suitable link target +*/ +int Xorriso_local_getfacl(struct XorrisO *xorriso, char *disk_path, + char **text, int flag) +{ + int ret; + +#ifdef Xorriso_with_aaiP + ret= iso_local_get_acl_text(disk_path, text, + flag & (1 | 16 | 32 | (1 << 15))); +#else + ret= 0; +#endif + Xorriso_process_msg_queues(xorriso,0); + return(ret); +} + diff --git a/libisoburn/trunk/xorriso/xorrisoburn.h b/libisoburn/trunk/xorriso/xorrisoburn.h index 3b3b160a..575fea36 100644 --- a/libisoburn/trunk/xorriso/xorrisoburn.h +++ b/libisoburn/trunk/xorriso/xorrisoburn.h @@ -420,6 +420,9 @@ int Xorriso_setfattr(struct XorrisO *xorriso, void *in_node, char *path, size_t num_attrs, char **names, size_t *value_lengths, char **values, int flag); +int Xorriso_local_getfacl(struct XorrisO *xorriso, char *disk_path, + char **text, int flag); + /* A pseudo file type for El-Torito bootsectors as in man 2 stat : For now take the highest possible value.