summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/shadow/files/commonio.c-fix-unexpected-open-failure-in-chroot-env.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/shadow/files/commonio.c-fix-unexpected-open-failure-in-chroot-env.patch')
-rw-r--r--meta/recipes-extended/shadow/files/commonio.c-fix-unexpected-open-failure-in-chroot-env.patch13
1 files changed, 6 insertions, 7 deletions
diff --git a/meta/recipes-extended/shadow/files/commonio.c-fix-unexpected-open-failure-in-chroot-env.patch b/meta/recipes-extended/shadow/files/commonio.c-fix-unexpected-open-failure-in-chroot-env.patch
index 9825216369..cd99aad135 100644
--- a/meta/recipes-extended/shadow/files/commonio.c-fix-unexpected-open-failure-in-chroot-env.patch
+++ b/meta/recipes-extended/shadow/files/commonio.c-fix-unexpected-open-failure-in-chroot-env.patch
@@ -1,4 +1,4 @@
1From 66533c7c6f347d257020675a1ed6e0c59cbbc3f0 Mon Sep 17 00:00:00 2001 1From f512071dd3a4c29d4bf048c5a89c4ba9160e37b1 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Thu, 17 Jul 2014 15:53:34 +0800 3Date: Thu, 17 Jul 2014 15:53:34 +0800
4Subject: [PATCH] commonio.c-fix-unexpected-open-failure-in-chroot-env 4Subject: [PATCH] commonio.c-fix-unexpected-open-failure-in-chroot-env
@@ -15,32 +15,31 @@ Note that this patch doesn't change the logic in the code, it just expands
15the codes. 15the codes.
16 16
17Signed-off-by: Chen Qi <Qi.Chen@windriver.com> 17Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
18
19--- 18---
20 lib/commonio.c | 16 ++++++++++++---- 19 lib/commonio.c | 16 ++++++++++++----
21 1 file changed, 12 insertions(+), 4 deletions(-) 20 1 file changed, 12 insertions(+), 4 deletions(-)
22 21
23diff --git a/lib/commonio.c b/lib/commonio.c 22diff --git a/lib/commonio.c b/lib/commonio.c
24index 16fa7e7..d6bc297 100644 23index 01a26c9..82b2868 100644
25--- a/lib/commonio.c 24--- a/lib/commonio.c
26+++ b/lib/commonio.c 25+++ b/lib/commonio.c
27@@ -632,10 +632,18 @@ int commonio_open (struct commonio_db *db, int mode) 26@@ -601,10 +601,18 @@ int commonio_open (struct commonio_db *db, int mode)
28 db->cursor = NULL; 27 db->cursor = NULL;
29 db->changed = false; 28 db->changed = false;
30 29
31- fd = open (db->filename, 30- fd = open (db->filename,
32- (db->readonly ? O_RDONLY : O_RDWR) 31- (db->readonly ? O_RDONLY : O_RDWR)
33- | O_NOCTTY | O_NONBLOCK | O_NOFOLLOW); 32- | O_NOCTTY | O_NONBLOCK | O_NOFOLLOW | O_CLOEXEC);
34- saved_errno = errno; 33- saved_errno = errno;
35+ if (db->readonly) { 34+ if (db->readonly) {
36+ fd = open (db->filename, 35+ fd = open (db->filename,
37+ (true ? O_RDONLY : O_RDWR) 36+ (true ? O_RDONLY : O_RDWR)
38+ | O_NOCTTY | O_NONBLOCK | O_NOFOLLOW); 37+ | O_NOCTTY | O_NONBLOCK | O_NOFOLLOW | O_CLOEXEC);
39+ saved_errno = errno; 38+ saved_errno = errno;
40+ } else { 39+ } else {
41+ fd = open (db->filename, 40+ fd = open (db->filename,
42+ (false ? O_RDONLY : O_RDWR) 41+ (false ? O_RDONLY : O_RDWR)
43+ | O_NOCTTY | O_NONBLOCK | O_NOFOLLOW); 42+ | O_NOCTTY | O_NONBLOCK | O_NOFOLLOW| O_CLOEXEC);
44+ saved_errno = errno; 43+ saved_errno = errno;
45+ } 44+ }
46+ 45+