bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-tar] ACL support, extract and default ACLs


From: Markus Steinborn
Subject: Re: [Bug-tar] ACL support, extract and default ACLs
Date: Fri, 31 Jan 2014 21:48:52 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Firefox/24.0 SeaMonkey/2.21

Hi Juan,

"Juan J. Martínez" wrote:
...all of these cases add a default ACL when extracting files with no
archived ACLs.
Good catch.
I was expecting the stored ACLs to be restored when extracting contents,
but not the addition of that default ACLs that was not present in the
archived contents (see the case of a tarball in GNU tar format).
This is my expection, too.
Markus Steinborn wrote about ACL support and in his list of points that
need improvement was:

Optional (3): Do not store ACLs iff ACL contains just the normal
user, group and other permissions, i. .e. the ACL is an compatibility
ACL.
I don't know if it is related or not, I'd appreciate comments about this.
It is about creating archives, not about extracting. Currently I cannot produce a case where such an ACL is stored in the tar archive. Well, if the archive does not contain these trivial ACLs, the extractor can decide, so this may help for extracting. But that's not the cause of above problems.


Some patch like the following may help:


diff --git a/src/xattrs.c b/src/xattrs.c
index e669adb..b90ef7a 100644
--- a/src/xattrs.c
+++ b/src/xattrs.c
@@ -454,8 +454,19 @@ xattrs__acls_set (struct tar_stat_info const *st,
       free(tmp);
       acls_option = 1;
     }
-  else if (acls_option > 0)
+  else if (acls_option > 0 && !def)
     acl = perms2acl (st->stat.st_mode);
+  else if (acls_option > 0 /* && def */ )
+  {
+     if (acl_delete_def_file(file_name) == -1)
+     {
+       WARNOPT (WARN_XATTR_WRITE,
+         (0, errno,
+ _ ("acl_set_file_at: Cannot remove POSIX default ACLs for file '%s'"),
+          file_name));
+     }
+     return;
+  }
   else
     return;  /* don't call acl functions unless we first hit an ACL, or
         --acls was passed explicitly */






Greetings from Germany

Markus Steimnborn
GNU gv maintainer




reply via email to

[Prev in Thread] Current Thread [Next in Thread]