diff options
author | Joe MacDonald <joe.macdonald@windriver.com> | 2013-10-15 10:27:27 -0400 |
---|---|---|
committer | Mark Hatle <mark.hatle@windriver.com> | 2013-11-14 19:28:12 +0000 |
commit | 0e405f98266b48969c2173d032878cc6b2893fcb (patch) | |
tree | d6f0c97e571acb7a2525f80c50d0b86e718cc7a0 /recipes-security/selinux/libsemanage/libsemanage-define-FD_CLOEXEC-as-necessary.patch | |
parent | 7b142317419beb97f4815159177a3dd96c76c282 (diff) | |
download | meta-selinux-0e405f98266b48969c2173d032878cc6b2893fcb.tar.gz |
libselinux / libsemanage: work around FD_CLOEXEC and SOCK_CLOEXEC absence
[ CQID: WIND00438478 ]
[ CQID: WIND00439485 ]
Turns out some of the truly old hosts don't even really recognize
FD_CLOEXEC and most of the older ones don't know about SOCK_CLOEXEC. Work
around each (define FD_CLOEXEC to something sensible, simply don't use
SOCK_CLOEXEC, produce warnings in either event).
Signed-off-by: Joe MacDonald <joe.macdonald@windriver.com>
Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com>
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Diffstat (limited to 'recipes-security/selinux/libsemanage/libsemanage-define-FD_CLOEXEC-as-necessary.patch')
-rw-r--r-- | recipes-security/selinux/libsemanage/libsemanage-define-FD_CLOEXEC-as-necessary.patch | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/recipes-security/selinux/libsemanage/libsemanage-define-FD_CLOEXEC-as-necessary.patch b/recipes-security/selinux/libsemanage/libsemanage-define-FD_CLOEXEC-as-necessary.patch new file mode 100644 index 0000000..7be4381 --- /dev/null +++ b/recipes-security/selinux/libsemanage/libsemanage-define-FD_CLOEXEC-as-necessary.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | From e783080f30e00d00800ff3491d88c62b2a1c637b Mon Sep 17 00:00:00 2001 | ||
2 | From: Joe MacDonald <joe.macdonald@windriver.com> | ||
3 | Date: Tue, 15 Oct 2013 10:17:38 -0400 | ||
4 | Subject: [PATCH 3/3] libsemanage: define FD_CLOEXEC as necessary | ||
5 | |||
6 | In truly old systems, even FD_CLOEXEC may not be defined. Produce a | ||
7 | warning and duplicate the #define for FD_CLOEXEC found in | ||
8 | asm-generic/fcntl.h on more modern platforms. | ||
9 | |||
10 | Uptream-Status: Inappropriate | ||
11 | |||
12 | Signed-off-by: Joe MacDonald <joe.macdonald@windriver.com> | ||
13 | --- | ||
14 | libsemanage/src/semanage_store.c | 5 +++++ | ||
15 | 1 file changed, 5 insertions(+) | ||
16 | |||
17 | diff --git a/libsemanage/src/semanage_store.c b/libsemanage/src/semanage_store.c | ||
18 | index 57ef49f..488a14a 100644 | ||
19 | --- a/libsemanage/src/semanage_store.c | ||
20 | +++ b/libsemanage/src/semanage_store.c | ||
21 | @@ -65,6 +65,11 @@ static const char *DISABLESTR="disabled"; | ||
22 | |||
23 | #define TRUE 1 | ||
24 | |||
25 | +#ifndef FD_CLOEXEC | ||
26 | +#warning FD_CLOEXEC undefined on this platform, this may leak file descriptors | ||
27 | +#define FD_CLOEXEC 1 | ||
28 | +#endif | ||
29 | + | ||
30 | enum semanage_file_defs { | ||
31 | SEMANAGE_ROOT, | ||
32 | SEMANAGE_TRANS_LOCK, | ||
33 | -- | ||
34 | 1.7.10.4 | ||
35 | |||