summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/pseudo/pseudo-1.6.2/0001-pseudo_client.c-protect-pwd_lck-against-magic.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/pseudo/pseudo-1.6.2/0001-pseudo_client.c-protect-pwd_lck-against-magic.patch')
-rw-r--r--meta/recipes-devtools/pseudo/pseudo-1.6.2/0001-pseudo_client.c-protect-pwd_lck-against-magic.patch55
1 files changed, 55 insertions, 0 deletions
diff --git a/meta/recipes-devtools/pseudo/pseudo-1.6.2/0001-pseudo_client.c-protect-pwd_lck-against-magic.patch b/meta/recipes-devtools/pseudo/pseudo-1.6.2/0001-pseudo_client.c-protect-pwd_lck-against-magic.patch
new file mode 100644
index 0000000000..b1bb9fb59c
--- /dev/null
+++ b/meta/recipes-devtools/pseudo/pseudo-1.6.2/0001-pseudo_client.c-protect-pwd_lck-against-magic.patch
@@ -0,0 +1,55 @@
1From e11468a47369596f57c5e99bd0a3dd58b2c6d5e0 Mon Sep 17 00:00:00 2001
2From: "Peter A. Bigot" <pab@pabigot.com>
3Date: Sun, 12 Oct 2014 08:27:14 -0500
4Subject: [PATCH 1/3] pseudo_client.c: protect pwd_lck against magic
5
6While attempting to diagnose unexpected uid/gid assignment I added
7--without-passwd-fallback to the pseudo build. This caused build
8failures due to inability to lock /etc/passwd.
9
10Instrumentation revealed that attempts to create the lock file ended up
11with pseudo_etc_file() creating the correct lock name, but the
12subsequent open had an extra PSEUDO_PASSWD directory prefix causing
13it to fail.
14
15Inspection of pseudo_client shows the only other use of PSEUDO_ETC_FILE
16to be protected against magic. Applying the same shield to the
17unprotected calls in pseudo_pwd_lck_{open,close} fixes the issue.
18
19Upstream-Status: Pending
20Signed-off-by: Peter A. Bigot <pab@pabigot.com>
21---
22 pseudo_client.c | 4 ++++
23 1 file changed, 4 insertions(+)
24
25diff --git a/pseudo_client.c b/pseudo_client.c
26index 8deaa1b..442dd19 100644
27--- a/pseudo_client.c
28+++ b/pseudo_client.c
29@@ -416,20 +416,24 @@ pseudo_pwd_lck_open(void) {
30 }
31 }
32 pseudo_pwd_lck_close();
33+ pseudo_antimagic();
34 pseudo_pwd_lck_fd = PSEUDO_ETC_FILE(".pwd.lock",
35 pseudo_pwd_lck_name, O_RDWR | O_CREAT);
36+ pseudo_magic();
37 return pseudo_pwd_lck_fd;
38 }
39
40 int
41 pseudo_pwd_lck_close(void) {
42 if (pseudo_pwd_lck_fd != -1) {
43+ pseudo_antimagic();
44 close(pseudo_pwd_lck_fd);
45 if (pseudo_pwd_lck_name) {
46 unlink(pseudo_pwd_lck_name);
47 free(pseudo_pwd_lck_name);
48 pseudo_pwd_lck_name = 0;
49 }
50+ pseudo_magic();
51 pseudo_pwd_lck_fd = -1;
52 return 0;
53 } else {
54--
551.8.5.5