diff options
author | Philip Tricca <flihp@twobit.us> | 2015-06-17 15:30:51 -0700 |
---|---|---|
committer | Joe MacDonald <joe_macdonald@mentor.com> | 2015-08-08 16:43:23 -0400 |
commit | 54e7104ef87200fd96d3a1c78c4409fc1445d3a2 (patch) | |
tree | 568b21115cf158d3437b01b2a88e509dfcd55c16 | |
parent | 684ee9401f33db7c9d5b183988d89c688c9dd0be (diff) | |
download | meta-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.patch | 25 | ||||
-rw-r--r-- | recipes-security/selinux/policycoreutils_2.3.bb | 1 |
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 @@ | |||
1 | This works around a bug in the default libc used by OE. FTS functions are | ||
2 | supposed to change the current working directory as they walk the file | ||
3 | hierarchy. The fts_accpath member of the FTSENT structure relies on this | ||
4 | behavior and without it the path is not relative to cwd as expected. | ||
5 | Supplying the FTS_NOCHDIR flag disables this optimization and causes | ||
6 | fts_accpath to be relative to the directory where the traversal started. | ||
7 | Use of this flag doesn't effect compatibility with glibc. | ||
8 | |||
9 | An alternative fix could replace the use of fts_accpath with fts_path | ||
10 | which is absolute. | ||
11 | |||
12 | Signed-off-by: Philip Tricca <flihp@twobit.us> | ||
13 | Index: 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 | " |