diff options
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.patch | 48 |
1 files changed, 0 insertions, 48 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 deleted file mode 100644 index 699269ed64..0000000000 --- a/meta/recipes-extended/shadow/files/commonio.c-fix-unexpected-open-failure-in-chroot-env.patch +++ /dev/null | |||
| @@ -1,48 +0,0 @@ | |||
| 1 | From f7b765c022e4cad9140ac44712885c66e149abdc Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Chen Qi <Qi.Chen@windriver.com> | ||
| 3 | Date: Thu, 17 Jul 2014 15:53:34 +0800 | ||
| 4 | Subject: [PATCH] commonio.c-fix-unexpected-open-failure-in-chroot-env | ||
| 5 | |||
| 6 | Upstream-Status: Inappropriate [OE specific] | ||
| 7 | |||
| 8 | commonio.c: fix unexpected open failure in chroot environment | ||
| 9 | |||
| 10 | When using commands with '-R <newroot>' option in our pseudo environment, | ||
| 11 | we would usually get the 'Pemission Denied' error. This patch serves as | ||
| 12 | a workaround to this problem. | ||
| 13 | |||
| 14 | Note that this patch doesn't change the logic in the code, it just expands | ||
| 15 | the codes. | ||
| 16 | |||
| 17 | Signed-off-by: Chen Qi <Qi.Chen@windriver.com> | ||
| 18 | --- | ||
| 19 | lib/commonio.c | 16 ++++++++++++---- | ||
| 20 | 1 file changed, 12 insertions(+), 4 deletions(-) | ||
| 21 | |||
| 22 | diff --git a/lib/commonio.c b/lib/commonio.c | ||
| 23 | index 4d83e83..9ee0e13 100644 | ||
| 24 | --- a/lib/commonio.c | ||
| 25 | +++ b/lib/commonio.c | ||
| 26 | @@ -604,10 +604,18 @@ int commonio_open (struct commonio_db *db, int mode) | ||
| 27 | db->cursor = NULL; | ||
| 28 | db->changed = false; | ||
| 29 | |||
| 30 | - fd = open (db->filename, | ||
| 31 | - (db->readonly ? O_RDONLY : O_RDWR) | ||
| 32 | - | O_NOCTTY | O_NONBLOCK | O_NOFOLLOW | O_CLOEXEC); | ||
| 33 | - saved_errno = errno; | ||
| 34 | + if (db->readonly) { | ||
| 35 | + fd = open (db->filename, | ||
| 36 | + (true ? O_RDONLY : O_RDWR) | ||
| 37 | + | O_NOCTTY | O_NONBLOCK | O_NOFOLLOW | O_CLOEXEC); | ||
| 38 | + saved_errno = errno; | ||
| 39 | + } else { | ||
| 40 | + fd = open (db->filename, | ||
| 41 | + (false ? O_RDONLY : O_RDWR) | ||
| 42 | + | O_NOCTTY | O_NONBLOCK | O_NOFOLLOW| O_CLOEXEC); | ||
| 43 | + saved_errno = errno; | ||
| 44 | + } | ||
| 45 | + | ||
| 46 | db->fp = NULL; | ||
| 47 | if (fd >= 0) { | ||
| 48 | #ifdef WITH_TCB | ||
