summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Tricca <flihp@twobit.us>2015-06-17 15:30:51 -0700
committerJoe MacDonald <joe_macdonald@mentor.com>2015-08-08 16:43:23 -0400
commit54e7104ef87200fd96d3a1c78c4409fc1445d3a2 (patch)
tree568b21115cf158d3437b01b2a88e509dfcd55c16
parent684ee9401f33db7c9d5b183988d89c688c9dd0be (diff)
downloadmeta-selinux-54e7104ef87200fd96d3a1c78c4409fc1445d3a2.tar.gz
policycoreutils: Patch setfiles to add FTS_NOCHDIR to fts_flags.
Signed-off-by: Philip Tricca <flihp@twobit.us> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
-rw-r--r--recipes-security/selinux/policycoreutils/policycoreutils-fts_flags-FTS_NOCHDIR.patch25
-rw-r--r--recipes-security/selinux/policycoreutils_2.3.bb1
2 files changed, 26 insertions, 0 deletions
diff --git a/recipes-security/selinux/policycoreutils/policycoreutils-fts_flags-FTS_NOCHDIR.patch b/recipes-security/selinux/policycoreutils/policycoreutils-fts_flags-FTS_NOCHDIR.patch
new file mode 100644
index 0000000..fd04b51
--- /dev/null
+++ b/recipes-security/selinux/policycoreutils/policycoreutils-fts_flags-FTS_NOCHDIR.patch
@@ -0,0 +1,25 @@
1This works around a bug in the default libc used by OE. FTS functions are
2supposed to change the current working directory as they walk the file
3hierarchy. The fts_accpath member of the FTSENT structure relies on this
4behavior and without it the path is not relative to cwd as expected.
5Supplying the FTS_NOCHDIR flag disables this optimization and causes
6fts_accpath to be relative to the directory where the traversal started.
7Use of this flag doesn't effect compatibility with glibc.
8
9An alternative fix could replace the use of fts_accpath with fts_path
10which is absolute.
11
12Signed-off-by: Philip Tricca <flihp@twobit.us>
13Index: policycoreutils/setfiles/setfiles.c
14===================================================================
15--- policycoreutils.orig/setfiles/setfiles.c
16+++ policycoreutils/setfiles/setfiles.c
17@@ -194,7 +194,7 @@ int main(int argc, char **argv)
18 r_opts.expand_realpath = 0;
19 r_opts.abort_on_error = 1;
20 r_opts.add_assoc = 1;
21- r_opts.fts_flags = FTS_PHYSICAL | FTS_XDEV;
22+ r_opts.fts_flags = FTS_PHYSICAL | FTS_XDEV | FTS_NOCHDIR;
23 ctx_validate = 1;
24 } else {
25 /*
diff --git a/recipes-security/selinux/policycoreutils_2.3.bb b/recipes-security/selinux/policycoreutils_2.3.bb
index c837266..4085085 100644
--- a/recipes-security/selinux/policycoreutils_2.3.bb
+++ b/recipes-security/selinux/policycoreutils_2.3.bb
@@ -15,4 +15,5 @@ SRC_URI += "\
15 file://policycoreutils-fix-TypeError-for-seobject.py.patch \ 15 file://policycoreutils-fix-TypeError-for-seobject.py.patch \
16 file://0001-mcstrans-fix-the-init-script.patch \ 16 file://0001-mcstrans-fix-the-init-script.patch \
17 file://enable-mcstrans.patch \ 17 file://enable-mcstrans.patch \
18 file://policycoreutils-fts_flags-FTS_NOCHDIR.patch \
18 " 19 "