summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/shadow/files/commonio.c-fix-unexpected-open-failure-in-chroot-env.patch
diff options
context:
space:
mode:
authorTudor Florea <tudor.florea@enea.com>2015-10-09 22:59:03 +0200
committerTudor Florea <tudor.florea@enea.com>2015-10-09 22:59:03 +0200
commit972dcfcdbfe75dcfeb777150c136576cf1a71e99 (patch)
tree97a61cd7e293d7ae9d56ef7ed0f81253365bb026 /meta/recipes-extended/shadow/files/commonio.c-fix-unexpected-open-failure-in-chroot-env.patch
downloadpoky-972dcfcdbfe75dcfeb777150c136576cf1a71e99.tar.gz
initial commit for Enea Linux 5.0 arm
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
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.patch46
1 files changed, 46 insertions, 0 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
new file mode 100644
index 0000000000..4fa3d184ed
--- /dev/null
+++ b/meta/recipes-extended/shadow/files/commonio.c-fix-unexpected-open-failure-in-chroot-env.patch
@@ -0,0 +1,46 @@
1Upstream-Status: Inappropriate [OE specific]
2
3commonio.c: fix unexpected open failure in chroot environment
4
5When using commands with '-R <newroot>' option in our pseudo environment,
6we would usually get the 'Pemission Denied' error. This patch serves as
7a workaround to this problem.
8
9Note that this patch doesn't change the logic in the code, it just expands
10the codes.
11
12Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
13---
14 lib/commonio.c | 16 ++++++++++++----
15 1 file changed, 12 insertions(+), 4 deletions(-)
16
17diff --git a/lib/commonio.c b/lib/commonio.c
18index cc536bf..51cafd9 100644
19--- a/lib/commonio.c
20+++ b/lib/commonio.c
21@@ -613,10 +613,18 @@ int commonio_open (struct commonio_db *db, int mode)
22 db->cursor = NULL;
23 db->changed = false;
24
25- fd = open (db->filename,
26- (db->readonly ? O_RDONLY : O_RDWR)
27- | O_NOCTTY | O_NONBLOCK | O_NOFOLLOW);
28- saved_errno = errno;
29+ if (db->readonly) {
30+ fd = open (db->filename,
31+ (true ? O_RDONLY : O_RDWR)
32+ | O_NOCTTY | O_NONBLOCK | O_NOFOLLOW);
33+ saved_errno = errno;
34+ } else {
35+ fd = open (db->filename,
36+ (false ? O_RDONLY : O_RDWR)
37+ | O_NOCTTY | O_NONBLOCK | O_NOFOLLOW);
38+ saved_errno = errno;
39+ }
40+
41 db->fp = NULL;
42 if (fd >= 0) {
43 #ifdef WITH_TCB
44--
451.7.9.5
46