diff options
Diffstat (limited to 'poky/meta/recipes-support/attr/acl')
7 files changed, 583 insertions, 0 deletions
diff --git a/poky/meta/recipes-support/attr/acl/Makefile-libacl-should-depend-on-include.patch b/poky/meta/recipes-support/attr/acl/Makefile-libacl-should-depend-on-include.patch new file mode 100644 index 000000000..4c7cba3b8 --- /dev/null +++ b/poky/meta/recipes-support/attr/acl/Makefile-libacl-should-depend-on-include.patch @@ -0,0 +1,51 @@ +From d82457ce5ca7455e336da5e244d95f90e52aaef8 Mon Sep 17 00:00:00 2001 +From: Robert Yang <liezhi.yang@windriver.com> +Date: Tue, 18 Apr 2017 01:17:26 -0700 +Subject: [PATCH] Makefile: libacl should depend on include + +Fixed race issue: + In file included from acl_copy_entry.c:22:0: + libacl.h:19:21: fatal error: sys/acl.h: No such file or directory + #include <sys/acl.h> + +[snip] + + compilation terminated. + acl_get_file.c:27:24: fatal error: acl/libacl.h: No such file or directory + #include <acl/libacl.h> + ^ + +The acl.h is in "include" directory, and include/Makefile creates +symlink "sys" and "acl" poinst to current dirctory: +$ ls include/ -l +acl -> . +sys -> . + +So if "libacl" target runs before "include", the error would happen +since no "acl" or "sys" directory. + +Let libacl depend on include can fix the problem. + +Upstream-Status: Pending + +Signed-off-by: Robert Yang <liezhi.yang@windriver.com> +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index dce32d3..8a79379 100644 +--- a/Makefile ++++ b/Makefile +@@ -48,7 +48,7 @@ else + endif + + # tool/lib dependencies +-libacl: libmisc ++libacl: include libmisc + getfacl setfacl chacl: libacl + + ifeq ($(HAVE_BUILDDEFS), yes) +-- +2.10.2 + diff --git a/poky/meta/recipes-support/attr/acl/acl-fix-the-order-of-expected-output-of-getfacl.patch b/poky/meta/recipes-support/attr/acl/acl-fix-the-order-of-expected-output-of-getfacl.patch new file mode 100644 index 000000000..cf765fdbb --- /dev/null +++ b/poky/meta/recipes-support/attr/acl/acl-fix-the-order-of-expected-output-of-getfacl.patch @@ -0,0 +1,198 @@ +acl: fix the order of expected output of getfacl + +The result of getfacl is sorted by user id. +In Centos or RHEL, bin user id is 1 and daemon user id is 2. +But in our image, bin user id is 2 and daemon user id is 1. +The patch fixes this issue to make ptest pass. + +Upstream-Status: Inappropriate [embedded specific] + +Signed-off-by: Chong Lu <Chong.Lu@windriver.com> +--- + test/misc.test | 38 +++++++++++++++++++------------------- + 1 file changed, 19 insertions(+), 19 deletions(-) + +diff --git a/test/misc.test b/test/misc.test +index 6e98053..53ae5b0 100644 +--- a/test/misc.test ++++ b/test/misc.test +@@ -79,8 +79,8 @@ Multiple users + + $ getfacl --omit-header f + > user::rw- +- > user:bin:rw- + > user:daemon:r-- ++ > user:bin:rw- + > group::r-- + > mask::rw- + > other::r-- +@@ -94,8 +94,8 @@ Multiple groups + + $ getfacl --omit-header f + > user::rw- +- > user:bin:rw- + > user:daemon:r-- ++ > user:bin:rw- + > group::r-- + > group:daemon:r-- + > group:users:rw- +@@ -111,8 +111,8 @@ Remove one group + + $ getfacl --omit-header f + > user::rw- +- > user:bin:rw- + > user:daemon:r-- ++ > user:bin:rw- + > group::r-- + > group:daemon:r-- + > mask::rw- +@@ -146,8 +146,8 @@ Default ACL + + $ getfacl --omit-header d + > user::rwx +- > user:bin:rwx + > user:daemon:rw- ++ > user:bin:rwx + > group::r-x + > mask::rwx + > other::--- +@@ -236,16 +236,16 @@ Add some users and groups + + $ getfacl --omit-header d/d + > user::rwx +- > user:bin:rwx #effective:r-x + > user:daemon:r-x ++ > user:bin:rwx #effective:r-x + > group::r-x + > group:daemon:rwx #effective:r-x + > group:users:r-x + > mask::r-x + > other::--- + > default:user::rwx +- > default:user:bin:rwx #effective:r-x + > default:user:daemon:r-x ++ > default:user:bin:rwx #effective:r-x + > default:group::r-x + > default:mask::r-x + > default:other::--- +@@ -262,16 +262,16 @@ Symlink in directory with default ACL? + + $ getfacl --omit-header d/l + > user::rwx +- > user:bin:rwx #effective:r-x + > user:daemon:r-x ++ > user:bin:rwx #effective:r-x + > group::r-x + > group:daemon:rwx #effective:r-x + > group:users:r-x + > mask::r-x + > other::--- + > default:user::rwx +- > default:user:bin:rwx #effective:r-x + > default:user:daemon:r-x ++ > default:user:bin:rwx #effective:r-x + > default:group::r-x + > default:mask::r-x + > default:other::--- +@@ -287,16 +287,16 @@ Does mask manipulation work? + + $ getfacl --omit-header d/d + > user::rwx +- > user:bin:r-x + > user:daemon:r-x ++ > user:bin:r-x + > group::r-x + > group:daemon:r-x + > group:users:r-x + > mask::r-x + > other::--- + > default:user::rwx +- > default:user:bin:rwx #effective:r-x + > default:user:daemon:r-x ++ > default:user:bin:rwx #effective:r-x + > default:group::r-x + > default:mask::r-x + > default:other::--- +@@ -308,16 +308,16 @@ Does mask manipulation work? + + $ getfacl --omit-header d/d + > user::rwx +- > user:bin:r-x + > user:daemon:r-x ++ > user:bin:r-x + > group::r-x + > group:daemon:r-x + > group:users:r-x + > mask::r-x + > other::--- + > default:user::rwx +- > default:user:bin:rwx + > default:user:daemon:r-x ++ > default:user:bin:rwx + > default:group::r-x + > default:mask::rwx + > default:other::--- +@@ -333,8 +333,8 @@ Remove the default ACL + + $ getfacl --omit-header d + > user::rwx +- > user:bin:rwx + > user:daemon:rw- ++ > user:bin:rwx + > group::r-x + > mask::rwx + > other::--- +@@ -373,14 +373,14 @@ Now, chmod should change the group_obj entry + + $ getfacl --omit-header d + > user::rwx +- > user:bin:r-x + > user:daemon:rwx ++ > user:bin:r-x + > group::rwx + > mask::rwx + > other::r-x + > default:user::rwx +- > default:user:bin:r-x + > default:user:daemon:rwx ++ > default:user:bin:r-x + > default:group::rwx + > default:mask::rwx + > default:other::r-x +@@ -392,14 +392,14 @@ Now, chmod should change the group_obj entry + + $ getfacl --omit-header d + > user::rwx +- > user:bin:r-x + > user:daemon:rwx #effective:r-x ++ > user:bin:r-x + > group::rwx #effective:r-x + > mask::r-x + > other::--- + > default:user::rwx +- > default:user:bin:r-x + > default:user:daemon:rwx ++ > default:user:bin:r-x + > default:group::rwx + > default:mask::rwx + > default:other::r-x +@@ -411,14 +411,14 @@ Now, chmod should change the group_obj entry + + $ getfacl --omit-header d + > user::rwx +- > user:bin:r-x + > user:daemon:rwx #effective:r-x ++ > user:bin:r-x + > group::rwx #effective:r-x + > mask::r-x + > other::--- + > default:user::rwx +- > default:user:bin:r-x + > default:user:daemon:rwx ++ > default:user:bin:r-x + > default:group::rwx + > default:mask::rwx + > default:other::r-x +-- +1.7.9.5 + diff --git a/poky/meta/recipes-support/attr/acl/configure.ac b/poky/meta/recipes-support/attr/acl/configure.ac new file mode 100644 index 000000000..7af2e8d88 --- /dev/null +++ b/poky/meta/recipes-support/attr/acl/configure.ac @@ -0,0 +1,49 @@ +# Copyright (C) 2009 Andreas Gruenbacher <agruen@suse.de> +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +AC_INIT(include/acl.h) +AC_CONFIG_AUX_DIR([.]) +AC_CONFIG_MACRO_DIR([m4]) +AC_CONFIG_HEADER(include/config.h) +AC_PREFIX_DEFAULT(/usr) + +AC_PROG_LIBTOOL + +AC_ARG_ENABLE(shared, +[ --enable-shared=[yes/no] Enable use of shared libraries [default=yes]],, + enable_shared=yes) +AC_SUBST(enable_shared) + +AC_ARG_ENABLE(gettext, +[ --enable-gettext=[yes/no] Enable alternate language support [default=yes]],, + enable_gettext=yes) +AC_SUBST(enable_gettext) + +AC_ARG_ENABLE(lib64, +[ --enable-lib64=[yes/no] Enable lib64 support [default=no]],, + enable_lib64=no) +AC_SUBST(enable_lib64) + +AC_PACKAGE_GLOBALS(acl) +AC_PACKAGE_UTILITIES(acl) +AC_PACKAGE_NEED_ATTR_XATTR_H +AC_PACKAGE_NEED_ATTR_ERROR_H +AC_MULTILIB($enable_lib64) +AC_PACKAGE_NEED_GETXATTR_LIBATTR +AC_MANUAL_FORMAT + +AC_FUNC_GCC_VISIBILITY + +AC_OUTPUT(include/builddefs) diff --git a/poky/meta/recipes-support/attr/acl/run-ptest b/poky/meta/recipes-support/attr/acl/run-ptest new file mode 100644 index 000000000..a56946d8e --- /dev/null +++ b/poky/meta/recipes-support/attr/acl/run-ptest @@ -0,0 +1,64 @@ +#!/bin/sh +# +#This script is used to run acl test suites + +#umask 077 + +EXT3_IMAGE=ext3.img +EXT3_MOUNT_POINT=/mnt/ext3 + +trap 'rm -f ${EXT3_IMAGE}' EXIT + +dd if=/dev/zero of=${EXT3_IMAGE} bs=1M count=1 +if [ "$?" -eq 0 ]; then + echo "PASS: dump ext3.img" +else + echo "FAIL: dump ext3.img" + exit 1 +fi + +mkfs.ext3 -F ${EXT3_IMAGE} +if [ "$?" -eq 0 ]; then + echo "PASS: mkfs.ext3 -F ext3.img" +else + echo "FAIL: mkfs.ext3 -F ext3.img" + exit 1 +fi + +if [ -d $EXT3_MOUNT_POINT ]; then + echo "mount point exist" +else + mkdir -p $EXT3_MOUNT_POINT +fi + + +mount -o loop,rw,acl ${EXT3_IMAGE} $EXT3_MOUNT_POINT +if [ "$?" -eq 0 ]; then + echo "PASS: mount ext3.img" +else + echo "FAIL: mount ext3.img" + exit 1 +fi + +cp -rf ./test/ $EXT3_MOUNT_POINT + +cd $EXT3_MOUNT_POINT/test/ + +if sed -e 's!^bin:x:2:$!bin:x:2:daemon!' < /etc/group > gtmp +then if cp /etc/group group.orig; + then cp gtmp /etc/group + make -k tests root-tests | sed \ + -e 's|^\[.*\] \(.*\) -- ok$|PASS: \1|' \ + -e 's|^\[.*\] \(.*\) -- failed|FAIL: \1|' + cp group.orig /etc/group + else echo "FAIL: couldn't save original group file." + exit 1 + fi +else echo "FAIL: couldn't create modified group file." + exit 1 +fi + +cd - +umount $EXT3_MOUNT_POINT +rm -rf $EXT3_MOUNT_POINT +rm $EXT3_IMAGE diff --git a/poky/meta/recipes-support/attr/acl/test-fix-directory-permissions.patch b/poky/meta/recipes-support/attr/acl/test-fix-directory-permissions.patch new file mode 100644 index 000000000..e64990ad5 --- /dev/null +++ b/poky/meta/recipes-support/attr/acl/test-fix-directory-permissions.patch @@ -0,0 +1,37 @@ +From 311589fedf196168382d8f0db303ab328bcf9d83 Mon Sep 17 00:00:00 2001 +From: Peter Seebach <peter.seebach@windriver.com> +Date: Wed, 11 May 2016 15:16:06 -0500 +Subject: [PATCH] acl.inc, run-ptest: improve ptest functionality on limited + +commit c45bae84817a70fef6c2b661a07a492a0d23ae85 + + Fix permissions on temporary directory + + The temporary directory's permissions have to allow other users to + view the directory. A default umask of 022 is common, but not mandatory, + and secure systems may have more restrictive defaults. + + Signed-off-by: Peter Seebach <peter.seebach@windriver.com> + +Upstream-Status: Backport [ http://git.savannah.gnu.org/cgit/acl.git/commit/?id=c6772a958800de064482634f77c20a0faafc5af6 ] + +Signed-off-by: Dengke Du <dengke.du@windriver.com> +--- + test/root/permissions.test | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/test/root/permissions.test b/test/root/permissions.test +index 42615f5..098b52a 100644 +--- a/test/root/permissions.test ++++ b/test/root/permissions.test +@@ -16,6 +16,7 @@ Cry immediately if we are not running as root. + First, set up a temporary directory and create a regular file with + defined permissions. + ++ $ umask 022 + $ mkdir d + $ cd d + $ umask 027 +-- +2.8.1 + diff --git a/poky/meta/recipes-support/attr/acl/test-fix-insufficient-quoting-of.patch b/poky/meta/recipes-support/attr/acl/test-fix-insufficient-quoting-of.patch new file mode 100644 index 000000000..f392465b5 --- /dev/null +++ b/poky/meta/recipes-support/attr/acl/test-fix-insufficient-quoting-of.patch @@ -0,0 +1,100 @@ +From e98ce8acf84d12ea67a3ac76bf63c6d87d9af86d Mon Sep 17 00:00:00 2001 +From: Kamil Dudka <kdudka@redhat.com> +Date: Mon, 20 May 2013 16:38:06 +0200 +Subject: [PATCH] test: fix insufficient quoting of '\' + +This is a follow-up to 7f2c91b8369242a8dbc2b304a5b71b2a85f5b855, which +caused sbits-restore.test to fail in the following way in case SELinux +was disabled: + +*** sbits-restore.test *** +[3] $ umask 022 -- ok +[4] $ mkdir d -- ok +[5] $ touch d/g -- ok +[6] $ touch d/u -- ok +[7] $ chmod u+s d/u -- ok +[8] $ chmod g+s d/g -- ok +[9] $ chmod +t d -- ok +[10] $ getfacl -R d > d.acl -- ok +[11] $ rm -R d -- ok +[12] $ mkdir d -- ok +[13] $ touch d/g -- ok +[14] $ touch d/u -- ok +[15] $ setfacl --restore d.acl -- ok +[16] $ ls -dl d | awk '{print $1}' | sed 's/.$//g' -- failed +drwxr-xr- != drwxr-xr-t +[18] $ ls -dl d/u | awk '{print $1}' | sed 's/.$//g' -- failed +-rwSr--r- != -rwSr--r-- +[20] $ ls -dl d/g | awk '{print $1}' | sed 's/.$//g' -- failed +-rw-r-Sr- != -rw-r-Sr-- +[22] $ rm -Rf d -- ok +17 commands (14 passed, 3 failed) + +Upstream-Status: Backport +http://git.savannah.gnu.org/cgit/acl.git/commit/?id=e98ce8acf84d12ea67a3ac76bf63c6d87d9af86d + +Signed-off-by: Kamil Dudka <kdudka@redhat.com> +Signed-off-by: He Zhe <zhe.he@windriver.com> + +Index: acl-2.2.52/test/cp.test +=================================================================== +--- acl-2.2.52.orig/test/cp.test ++++ acl-2.2.52/test/cp.test +@@ -9,7 +9,7 @@ The cp utility should only copy ACLs if + > -rw-rw-r--+ + + $ cp f g +- $ ls -l g | awk -- '{ print $1 }' | sed 's/\.$//g' ++ $ ls -l g | awk -- '{ print $1 }' | sed 's/\\.$//g' + > -rw-r--r-- + + $ rm g +Index: acl-2.2.52/test/misc.test +=================================================================== +--- acl-2.2.52.orig/test/misc.test ++++ acl-2.2.52/test/misc.test +@@ -254,7 +254,7 @@ Add some users and groups + Symlink in directory with default ACL? + + $ ln -s d d/l +- $ ls -dl d/l | awk '{print $1}' | sed 's/\.$//g' ++ $ ls -dl d/l | awk '{print $1}' | sed 's/\\.$//g' + > lrwxrwxrwx + + $ ls -dl -L d/l | awk '{print $1}' +@@ -343,7 +343,7 @@ Remove the default ACL + Reset to base entries + + $ setfacl -b d +- $ ls -dl d | awk '{print $1}' | sed 's/\.$//g' ++ $ ls -dl d | awk '{print $1}' | sed 's/\\.$//g' + > drwxr-x--- + + $ getfacl --omit-header d +@@ -355,7 +355,7 @@ Reset to base entries + Now, chmod should change the group_obj entry + + $ chmod 775 d +- $ ls -dl d | awk '{print $1}' | sed 's/\.$//g' ++ $ ls -dl d | awk '{print $1}' | sed 's/\\.$//g' + > drwxrwxr-x + + $ getfacl --omit-header d +Index: acl-2.2.52/test/sbits-restore.test +=================================================================== +--- acl-2.2.52.orig/test/sbits-restore.test ++++ acl-2.2.52/test/sbits-restore.test +@@ -13,10 +13,10 @@ Ensure setting of SUID/SGID/sticky via - + $ touch d/g + $ touch d/u + $ setfacl --restore d.acl +- $ ls -dl d | awk '{print $1}' | sed 's/\.$//g' ++ $ ls -dl d | awk '{print $1}' | sed 's/\\.$//g' + > drwxr-xr-t +- $ ls -dl d/u | awk '{print $1}' | sed 's/\.$//g' ++ $ ls -dl d/u | awk '{print $1}' | sed 's/\\.$//g' + > -rwSr--r-- +- $ ls -dl d/g | awk '{print $1}' | sed 's/\.$//g' ++ $ ls -dl d/g | awk '{print $1}' | sed 's/\\.$//g' + > -rw-r-Sr-- + $ rm -Rf d diff --git a/poky/meta/recipes-support/attr/acl/test-fixups-on-SELinux-machines-for-root-testcases.patch b/poky/meta/recipes-support/attr/acl/test-fixups-on-SELinux-machines-for-root-testcases.patch new file mode 100644 index 000000000..8cc11a63e --- /dev/null +++ b/poky/meta/recipes-support/attr/acl/test-fixups-on-SELinux-machines-for-root-testcases.patch @@ -0,0 +1,84 @@ +From d2f49ee6fe4850b8dda5b08676b36201d3c43710 Mon Sep 17 00:00:00 2001 +From: He Zhe <zhe.he@windriver.com> +Date: Wed, 2 Mar 2016 15:46:57 +0800 +Subject: [PATCH] test: fixups on SELinux machines for root testcases + +ls adds a '.' at the end of the permission field list on SELinux +machines, filter this out so root tests work on SELinux machines. + +Upstream-Status: Accepted +http://git.savannah.gnu.org/cgit/acl.git/commit/?id=26a87d36f80d5e98bccb5878834d9e69dadfe3e9 + +Signed-off-by: He Zhe <zhe.he@windriver.com> +--- + test/root/permissions.test | 8 ++++---- + test/root/restore.test | 2 +- + test/root/setfacl.test | 2 +- + 3 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/test/root/permissions.test b/test/root/permissions.test +index 9b9e3de..665339a 100644 +--- a/test/root/permissions.test ++++ b/test/root/permissions.test +@@ -19,7 +19,7 @@ defined permissions. + $ cd d + $ umask 027 + $ touch f +- $ ls -l f | awk -- '{ print $1, $3, $4 }' ++ $ ls -l f | awk -- '{ print $1, $3, $4 }' | sed 's/\\.//g' + > -rw-r----- root root + + +@@ -39,7 +39,7 @@ Now, change the ownership of the file to bin:bin and verify that this + gives user bin write access. + + $ chown bin:bin f +- $ ls -l f | awk -- '{ print $1, $3, $4 }' ++ $ ls -l f | awk -- '{ print $1, $3, $4 }' | sed 's/\\.//g' + > -rw-r----- bin bin + $ su bin + $ echo bin >> f +@@ -256,12 +256,12 @@ directories if the file has an ACL and only CAP_FOWNER would grant them. + $ mkdir -m 600 x + $ chown daemon:daemon x + $ echo j > x/j +- $ ls -l x/j | awk -- '{ print $1, $3, $4 }' ++ $ ls -l x/j | awk -- '{ print $1, $3, $4 }' | sed 's/\\.//g' + > -rw-r----- root root + + $ setfacl -m u:daemon:r x + +- $ ls -l x/j | awk -- '{ print $1, $3, $4 }' ++ $ ls -l x/j | awk -- '{ print $1, $3, $4 }' | sed 's/\\.//g' + > -rw-r----- root root + (With the bug this gives: `ls: x/j: Permission denied'.) + +diff --git a/test/root/restore.test b/test/root/restore.test +index 63a9d01..c85097c 100644 +--- a/test/root/restore.test ++++ b/test/root/restore.test +@@ -21,7 +21,7 @@ Cry immediately if we are not running as root. + $ chown bin passwd + $ chmod u+s passwd + $ setfacl --restore passwd.acl +- $ ls -dl passwd | awk '{print $1 " " $3 " " $4}' ++ $ ls -dl passwd | awk '{print $1 " " $3 " " $4}' | sed 's/\\.//g' + > -rwsr-xr-x root root + + $ rm passwd passwd.acl +diff --git a/test/root/setfacl.test b/test/root/setfacl.test +index a46a9f4..7efbad7 100644 +--- a/test/root/setfacl.test ++++ b/test/root/setfacl.test +@@ -12,7 +12,7 @@ Cry immediately if we are not running as root. + $ sg bin + $ umask 027 + $ touch g +- $ ls -dl g | awk '{print $1}' ++ $ ls -dl g | awk '{print $1}' | sed 's/\\.//g' + > -rw-r----- + + $ setfacl -m m:- g +-- +1.9.1 + |