[source] tar: override symlink permissions

LEDE Commits lede-commits at lists.infradead.org
Thu Dec 14 09:44:26 PST 2017


jow pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/e8bd0a606a60ad37a7a737943f6b5a5347953167

commit e8bd0a606a60ad37a7a737943f6b5a5347953167
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Tue May 30 15:37:10 2017 +0200

    tar: override symlink permissions
    
    On Linux, symlink permissions cannot be altered and are always 0777.
    On Mac OS X they can be 0755. Force 0777 here to keep tarballs
    reproducible across systems
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
    (cherry picked from commit e25cedd0b5621dc02e47eea674006578ac062c9f)
---
 tools/tar/patches/110-symlink-force-permissions.patch | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tools/tar/patches/110-symlink-force-permissions.patch b/tools/tar/patches/110-symlink-force-permissions.patch
new file mode 100644
index 0000000..83dbda6
--- /dev/null
+++ b/tools/tar/patches/110-symlink-force-permissions.patch
@@ -0,0 +1,10 @@
+--- a/src/create.c
++++ b/src/create.c
+@@ -1851,6 +1851,7 @@ dump_file0 (struct tar_stat_info *st, ch
+ #ifdef HAVE_READLINK
+   else if (S_ISLNK (st->stat.st_mode))
+     {
++      st->stat.st_mode |= 0777; /* make permissions portable */
+       st->link_name = areadlinkat_with_size (parentfd, name, st->stat.st_size);
+       if (!st->link_name)
+ 	{



More information about the lede-commits mailing list