summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2019-11-25 16:52:15 +0300
committerIgor Pashev <pashev.igor@gmail.com>2019-11-25 23:09:27 +0300
commit6cdbc23e72e07250d987b8254cc68abff7bc067f (patch)
tree66d6daaa78c71acbd075908080372b87e4cef58a
parent4927b084a932e2445e9626e2e4e5a558aee59518 (diff)
downloadfakeroot-6cdbc23e72e07250d987b8254cc68abff7bc067f.tar.gz
Add support for illumos ACL
-rw-r--r--debian/control3
-rw-r--r--debian/patches/dyson-acl.patch213
-rw-r--r--debian/patches/series1
3 files changed, 216 insertions, 1 deletions
diff --git a/debian/control b/debian/control
index 784ebd3..230874b 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,8 @@ Section: utils
Priority: optional
Build-Depends: debhelper (>= 9),
dh-autoreconf,
- libacl1-dev,
+ libacl1-dev [!illumos-any],
+ libsec-dev [illumos-any],
libcap-dev [linux-any],
libcap2-bin [linux-any],
po4a,
diff --git a/debian/patches/dyson-acl.patch b/debian/patches/dyson-acl.patch
new file mode 100644
index 0000000..a9e39d4
--- /dev/null
+++ b/debian/patches/dyson-acl.patch
@@ -0,0 +1,213 @@
+Description: support for illumos (solaris) ACLs
+ This patch makes GNU coreutils shut up and stops GNU sed
+ making files with 0000 permissions.
+Bug-Dyson: http://osdyson.org/issues/167
+Author: Igor Pashev <pashev.igor@gmail.com>
+
+Index: fakeroot.git/libfakeroot.c
+===================================================================
+--- fakeroot.git.orig/libfakeroot.c
++++ fakeroot.git/libfakeroot.c
+@@ -1922,6 +1922,9 @@ int fakeroot_isdisabled(void)
+ }
+
+ #ifdef HAVE_ACL_T
++
++/* linux: */
++#ifdef HAVE_ACL_GET_FD
+ acl_t acl_get_fd(int fd) {
+ errno = ENOTSUP;
+ return (acl_t)NULL;
+@@ -1934,12 +1937,51 @@ int acl_set_fd(int fd, acl_t acl) {
+ errno = ENOTSUP;
+ return -1;
+ }
+-
+ int acl_set_file(const char *path_p, acl_type_t type, acl_t acl) {
+ errno = ENOTSUP;
+ return -1;
+ }
+-#endif /* HAVE_SYS_ACL_H */
++#endif /* HAVE_ACL_GET_FD */
++
++/* illumos: */
++#ifdef HAVE_ACL_TRIVIAL
++int acl_get(const char *path, int flags, acl_t **aclp)
++{
++ errno = ENOSYS;
++ return -1;
++}
++int facl_get(int fd, int flags, acl_t **aclp)
++{
++ errno = ENOSYS;
++ return -1;
++}
++int acl_set(const char *path, acl_t *aclp)
++{
++ errno = ENOSYS;
++ return -1;
++}
++int facl_set(int fd, acl_t *aclp)
++{
++ errno = ENOSYS;
++ return -1;
++}
++int acl_trivial(const char *path)
++{
++ return 0;
++}
++int acl(const char *path, int cmd, int cnt, void *buf)
++{
++ errno = ENOSYS;
++ return -1;
++}
++int facl(int fd, int cmd, int cnt, void *buf)
++{
++ errno = ENOSYS;
++ return -1;
++}
++#endif /* HAVE_ACL_TRIVIAL */
++
++#endif /* HAVE_ACL_T */
+
+ #ifdef HAVE_FTS_READ
+ FTSENT *fts_read(FTS *ftsp) {
+Index: fakeroot.git/configure.ac
+===================================================================
+--- fakeroot.git.orig/configure.ac
++++ fakeroot.git/configure.ac
+@@ -288,6 +288,16 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+
+ AC_CHECK_FUNCS(fchmodat fchownat fstatat mkdirat mknodat openat renameat unlinkat lchmod fgetattrlist)
+
++save_LIBS="$LIBS"
++# Linux
++AC_SEARCH_LIBS(acl_get_fd, acl)
++AC_CHECK_FUNCS(acl_get_fd)
++
++# Illumos
++AC_SEARCH_LIBS(acl_trivial, sec)
++AC_CHECK_FUNCS(acl_trivial)
++LIBS="$save_LIBS"
++
+ AC_CHECK_FUNCS(capset listxattr llistxattr flistxattr getxattr lgetxattr fgetxattr setxattr lsetxattr fsetxattr removexattr lremovexattr fremovexattr)
+
+ dnl find out how stat() etc are called. On linux systems, we really
+Index: fakeroot.git/wrapfunc.inp
+===================================================================
+--- fakeroot.git.orig/wrapfunc.inp
++++ fakeroot.git/wrapfunc.inp
+@@ -208,10 +208,24 @@ unlinkat;int;(int dir_fd, const char *pa
+ #endif /* HAVE_FSTATAT */
+
+ #ifdef HAVE_ACL_T
++
++#ifdef HAVE_ACL_GET_FD
+ acl_get_fd;acl_t;(int fd);(fd)
+ acl_get_file;acl_t;(const char *path_p, acl_type_t type);(path_p, type)
+ acl_set_fd;int;(int fd, acl_t acl);(fd, acl)
+ acl_set_file;int;(const char *path_p, acl_type_t type, acl_t acl);(path_p, type, acl)
++#endif
++
++#ifdef HAVE_ACL_TRIVIAL
++acl_get;int;(const char *path, int flags, acl_t **aclp);(path, flags, aclp)
++facl_get;int;(int fd, int flags, acl_t **aclp);(fd, flags, aclp)
++acl_set;int;(const char *path, acl_t *aclp);(path, aclp)
++facl_set;int;(int fd, acl_t *aclp);(fd, aclp)
++acl_trivial;int;(const char *path);(path)
++acl;int;(const char *path, int cmd, int cnt, void *buf);(path, cmd, cnt, buf)
++facl;int;(int fd, int cmd, int cnt, void *buf);(fd, cmd, cnt, buf)
++#endif
++
+ #endif /* HAVE_ACL_T */
+
+ #ifdef HAVE_FTS_READ
+Index: fakeroot.git/wrapstruct.h
+===================================================================
+--- fakeroot.git.orig/wrapstruct.h
++++ fakeroot.git/wrapstruct.h
+@@ -185,10 +185,24 @@ struct next_wrap_st next_wrap[]= {
+ #endif /* HAVE_FSTATAT */
+
+ #ifdef HAVE_ACL_T
++
++#ifdef HAVE_ACL_GET_FD
+ {(void(*))&next_acl_get_fd, "acl_get_fd"},
+ {(void(*))&next_acl_get_file, "acl_get_file"},
+ {(void(*))&next_acl_set_fd, "acl_set_fd"},
+ {(void(*))&next_acl_set_file, "acl_set_file"},
++#endif
++
++#ifdef HAVE_ACL_TRIVIAL
++ {(void(*))&next_acl_get, "acl_get"},
++ {(void(*))&next_facl_get, "facl_get"},
++ {(void(*))&next_acl_set, "acl_set"},
++ {(void(*))&next_facl_set, "facl_set"},
++ {(void(*))&next_acl_trivial, "acl_trivial"},
++ {(void(*))&next_acl, "acl"},
++ {(void(*))&next_facl, "facl"},
++#endif
++
+ #endif /* HAVE_ACL_T */
+
+ #ifdef HAVE_FTS_READ
+Description: <short summary of the patch>
+ TODO: Put a short summary on the line above and replace this paragraph
+ with a longer explanation of this change. Complete the meta-information
+ with other relevant fields (see below for details). To make it easier, the
+ information below has been extracted from the changelog. Adjust it or drop
+ it.
+ .
+ fakeroot (1.24-1) unstable; urgency=medium
+ .
+ [ Danny Milosavljevic ]
+ * Add test "t.cp-a".
+ .
+ [ Clint Adams ]
+ * Patch from Ilias Tsitsimpis to retry msgsnd() if interrupted by
+ a signal. closes: #883780.
+ * Patch from Martin Dorey to detect and handle message queue and
+ semaphore id collision. closes: #856439.
+ * Drop patch glibc-xattr-types.
+Author: Clint Adams <clint@debian.org>
+
+---
+The information above should follow the Patch Tagging Guidelines, please
+checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
+are templates for supplementary fields that you might want to add:
+
+Origin: <vendor|upstream|other>, <url of original patch>
+Bug: <url in upstream bugtracker>
+Bug-Debian: https://bugs.debian.org/<bugnumber>
+Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
+Forwarded: <no|not-needed|url proving that it has been forwarded>
+Reviewed-By: <name and email of someone who approved the patch>
+Last-Update: 2019-11-25
+
+--- fakeroot-1.24.orig/wrapdef.h
++++ fakeroot-1.24/wrapdef.h
+@@ -184,10 +184,24 @@ int (*next_unlinkat)(int dir_fd, const c
+ #endif /* HAVE_FSTATAT */
+
+ #ifdef HAVE_ACL_T
++
++#ifdef HAVE_ACL_GET_FD
+ acl_t (*next_acl_get_fd)(int fd)=tmp_acl_get_fd;
+ acl_t (*next_acl_get_file)(const char *path_p, acl_type_t type)=tmp_acl_get_file;
+ int (*next_acl_set_fd)(int fd, acl_t acl)=tmp_acl_set_fd;
+ int (*next_acl_set_file)(const char *path_p, acl_type_t type, acl_t acl)=tmp_acl_set_file;
++#endif
++
++#ifdef HAVE_ACL_TRIVIAL
++int (*next_acl_get)(const char *path, int flags, acl_t **aclp)=tmp_acl_get;
++int (*next_facl_get)(int fd, int flags, acl_t **aclp)=tmp_facl_get;
++int (*next_acl_set)(const char *path, acl_t *aclp)=tmp_acl_set;
++int (*next_facl_set)(int fd, acl_t *aclp)=tmp_facl_set;
++int (*next_acl_trivial)(const char *path)=tmp_acl_trivial;
++int (*next_acl)(const char *path, int cmd, int cnt, void *buf)=tmp_acl;
++int (*next_facl)(int fd, int cmd, int cnt, void *buf)=tmp_facl;
++#endif
++
+ #endif /* HAVE_ACL_T */
+
+ #ifdef HAVE_FTS_READ
diff --git a/debian/patches/series b/debian/patches/series
index a95b0e3..23300c7 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
eglibc-fts-without-LFS
fix-shell-in-fakeroot
hide-dlsym-error.patch
+dyson-acl.patch