summaryrefslogtreecommitdiffstats
path: root/recipes-security/selinux/libselinux/libselinux-make-O_CLOEXEC-optional.patch
diff options
context:
space:
mode:
authorWenzong Fan <wenzong.fan@windriver.com>2017-01-05 00:23:20 -0800
committerJoe MacDonald <joe_macdonald@mentor.com>2017-01-05 10:18:30 -0500
commiteba0f0ff8c1365aa12ead3498d812b9dbffa3f49 (patch)
tree9dfb479c201cbe5fdaef97ce5d90c543213ecb32 /recipes-security/selinux/libselinux/libselinux-make-O_CLOEXEC-optional.patch
parentc42ac83a7794730a8c9ecfaa16018b8706c59ecb (diff)
downloadmeta-selinux-eba0f0ff8c1365aa12ead3498d812b9dbffa3f49.tar.gz
libselinux: uprev to 2.6 (20161014)
* rebase patch: - libselinux-make-O_CLOEXEC-optional.patch * cleanup patches: - libselinux-only-mount-proc-if-necessary.patch - libselinux-procattr-return-einval-for-0-pid.patch - libselinux-procattr-return-error-on-invalid-pid.patch * other fixes: - remove useless variables according to latest Makefile - update FILES_${PN}-python to match the installed file: '${libdir}/python2.7/site-packages/_selinux.so'. Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Diffstat (limited to 'recipes-security/selinux/libselinux/libselinux-make-O_CLOEXEC-optional.patch')
-rw-r--r--recipes-security/selinux/libselinux/libselinux-make-O_CLOEXEC-optional.patch77
1 files changed, 38 insertions, 39 deletions
diff --git a/recipes-security/selinux/libselinux/libselinux-make-O_CLOEXEC-optional.patch b/recipes-security/selinux/libselinux/libselinux-make-O_CLOEXEC-optional.patch
index 98d31cc..a041dd3 100644
--- a/recipes-security/selinux/libselinux/libselinux-make-O_CLOEXEC-optional.patch
+++ b/recipes-security/selinux/libselinux/libselinux-make-O_CLOEXEC-optional.patch
@@ -17,37 +17,18 @@ produce curious AVC Denied messages.
17Uptream-Status: Inappropriate [O_CLOEXEC has been in Linux since 2007 and POSIX since 2008] 17Uptream-Status: Inappropriate [O_CLOEXEC has been in Linux since 2007 and POSIX since 2008]
18 18
19Signed-off-by: Joe MacDonald <joe.macdonald@windriver.com> 19Signed-off-by: Joe MacDonald <joe.macdonald@windriver.com>
20Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
20--- 21---
21 src/label_file.c | 8 +++++++- 22 src/procattr.c | 16 ++++++++++++++--
22 src/procattr.c | 8 +++++++- 23 src/sestatus.c | 8 +++++++-
23 src/sestatus.c | 8 +++++++- 24 src/stringrep.c | 8 +++++++-
24 src/stringrep.c | 8 +++++++- 25 3 files changed, 28 insertions(+), 4 deletions(-)
25 4 files changed, 28 insertions(+), 4 deletions(-)
26 26
27Index: libselinux-2.5/src/label_file.c 27diff --git a/src/procattr.c b/src/procattr.c
28=================================================================== 28index 7efcd7e..3007876 100644
29--- libselinux-2.5.orig/src/label_file.c 2016-02-25 13:10:00.159980383 -0500 29--- a/src/procattr.c
30+++ libselinux-2.5/src/label_file.c 2016-02-25 13:10:00.155980383 -0500 30+++ b/src/procattr.c
31@@ -124,7 +124,13 @@ 31@@ -79,7 +79,13 @@ static int openattr(pid_t pid, const char *attr, int flags)
32 return -1;
33 }
34
35- mmapfd = open(mmap_path, O_RDONLY | O_CLOEXEC);
36+ mmapfd = open(mmap_path, O_RDONLY
37+#ifdef O_CLOEXEC
38+ | O_CLOEXEC
39+#else
40+#warning O_CLOEXEC undefined on this platform, this may leak file descriptors
41+#endif
42+ );
43 if (mmapfd < 0)
44 return -1;
45
46Index: libselinux-2.5/src/procattr.c
47===================================================================
48--- libselinux-2.5.orig/src/procattr.c 2016-02-25 13:10:00.159980383 -0500
49+++ libselinux-2.5/src/procattr.c 2016-02-25 13:11:58.527980013 -0500
50@@ -76,7 +76,13 @@
51 rc = asprintf(&path, "/proc/thread-self/attr/%s", attr); 32 rc = asprintf(&path, "/proc/thread-self/attr/%s", attr);
52 if (rc < 0) 33 if (rc < 0)
53 return -1; 34 return -1;
@@ -62,11 +43,26 @@ Index: libselinux-2.5/src/procattr.c
62 if (fd >= 0 || errno != ENOENT) 43 if (fd >= 0 || errno != ENOENT)
63 goto out; 44 goto out;
64 free(path); 45 free(path);
65Index: libselinux-2.5/src/sestatus.c 46@@ -92,7 +98,13 @@ static int openattr(pid_t pid, const char *attr, int flags)
66=================================================================== 47 if (rc < 0)
67--- libselinux-2.5.orig/src/sestatus.c 2016-02-25 13:10:00.159980383 -0500 48 return -1;
68+++ libselinux-2.5/src/sestatus.c 2016-02-25 13:10:00.155980383 -0500 49
69@@ -268,7 +268,13 @@ 50- fd = open(path, flags | O_CLOEXEC);
51+ fd = open(path, flags
52+#ifdef O_CLOEXEC
53+ | O_CLOEXEC
54+#else
55+#warning O_CLOEXEC undefined on this platform, this may leak file descriptors
56+#endif
57+ );
58 out:
59 free(path);
60 return fd;
61diff --git a/src/sestatus.c b/src/sestatus.c
62index ed29dc5..0cb15b6 100644
63--- a/src/sestatus.c
64+++ b/src/sestatus.c
65@@ -268,7 +268,13 @@ int selinux_status_open(int fallback)
70 return -1; 66 return -1;
71 67
72 snprintf(path, sizeof(path), "%s/status", selinux_mnt); 68 snprintf(path, sizeof(path), "%s/status", selinux_mnt);
@@ -81,11 +77,11 @@ Index: libselinux-2.5/src/sestatus.c
81 if (fd < 0) 77 if (fd < 0)
82 goto error; 78 goto error;
83 79
84Index: libselinux-2.5/src/stringrep.c 80diff --git a/src/stringrep.c b/src/stringrep.c
85=================================================================== 81index 2dbec2b..de2a70b 100644
86--- libselinux-2.5.orig/src/stringrep.c 2016-02-25 13:10:00.159980383 -0500 82--- a/src/stringrep.c
87+++ libselinux-2.5/src/stringrep.c 2016-02-25 13:10:00.155980383 -0500 83+++ b/src/stringrep.c
88@@ -105,7 +105,13 @@ 84@@ -105,7 +105,13 @@ static struct discover_class_node * discover_class(const char *s)
89 struct stat m; 85 struct stat m;
90 86
91 snprintf(path, sizeof path, "%s/class/%s/perms/%s", selinux_mnt,s,dentry->d_name); 87 snprintf(path, sizeof path, "%s/class/%s/perms/%s", selinux_mnt,s,dentry->d_name);
@@ -100,3 +96,6 @@ Index: libselinux-2.5/src/stringrep.c
100 if (fd < 0) 96 if (fd < 0)
101 goto err4; 97 goto err4;
102 98
99--
1002.7.4
101