summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorPeter Seebach <peter.seebach@windriver.com>2015-01-22 20:23:56 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-01-29 15:36:47 +0000
commit2323efc7994e60e471579ed7a7ff385f33cc5dba (patch)
tree7a1bdc30446bbd88d77053df41d58f947d184620 /meta/recipes-devtools
parent07f2eca7e9f9163ec48d3a417d8ba885a84762f3 (diff)
downloadpoky-2323efc7994e60e471579ed7a7ff385f33cc5dba.tar.gz
pseudo_1.6.x.bb/pseudo_git.bb: Pseudo 1.6.4
pseudo 1.6.3 merges (with some changes) the changes from Peter A. Bigot to make --without-fallback-passwd work. It also adds a proposed fix for Yocto bug #7097, which has passed the obvious tests I could think of. pseudo 1.6.4 fixes a silly configure bug introduced with 1.6.3. [YOCTO: #7097] (From OE-Core rev: 67298d4fe6d96692a4e0578a44cc1a0bbf2cdc2b) Signed-off-by: Peter Seebach <peter.seebach@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r--meta/recipes-devtools/pseudo/pseudo-1.6.2/0001-pseudo_client.c-protect-pwd_lck-against-magic.patch56
-rw-r--r--meta/recipes-devtools/pseudo/pseudo-1.6.2/0002-pseudo_util-modify-interface-to-pseudo_etc_file.patch70
-rw-r--r--meta/recipes-devtools/pseudo/pseudo-1.6.2/0003-pseudo_client.c-support-multiple-directories-in-PSEU.patch116
-rw-r--r--meta/recipes-devtools/pseudo/pseudo_1.6.4.bb (renamed from meta/recipes-devtools/pseudo/pseudo_1.6.2.bb)7
-rw-r--r--meta/recipes-devtools/pseudo/pseudo_git.bb4
5 files changed, 4 insertions, 249 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
deleted file mode 100644
index d0c0a27e54..0000000000
--- a/meta/recipes-devtools/pseudo/pseudo-1.6.2/0001-pseudo_client.c-protect-pwd_lck-against-magic.patch
+++ /dev/null
@@ -1,56 +0,0 @@
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
56
diff --git a/meta/recipes-devtools/pseudo/pseudo-1.6.2/0002-pseudo_util-modify-interface-to-pseudo_etc_file.patch b/meta/recipes-devtools/pseudo/pseudo-1.6.2/0002-pseudo_util-modify-interface-to-pseudo_etc_file.patch
deleted file mode 100644
index c7006ef6df..0000000000
--- a/meta/recipes-devtools/pseudo/pseudo-1.6.2/0002-pseudo_util-modify-interface-to-pseudo_etc_file.patch
+++ /dev/null
@@ -1,70 +0,0 @@
1From f05def2bbd5507084672bc9072ffe0e5101e9b47 Mon Sep 17 00:00:00 2001
2From: "Peter A. Bigot" <pab@pabigot.com>
3Date: Sun, 12 Oct 2014 11:35:57 -0500
4Subject: [PATCH 2/3] pseudo_util: modify interface to pseudo_etc_file
5
6* Make the search directory pointers const: there is no reason why this
7 function should be allowed to mutate the directories.
8
9* Change the search directory argument from an array of pointers to a
10 pointer-to-pointers to prepare for an upcoming enhancement.
11
12Upstream-Status: Pending
13Signed-off-by: Peter A. Bigot <pab@pabigot.com>
14---
15 pseudo.h | 2 +-
16 pseudo_client.c | 2 +-
17 pseudo_util.c | 4 ++--
18 3 files changed, 4 insertions(+), 4 deletions(-)
19
20diff --git a/pseudo.h b/pseudo.h
21index 92020e4..05813c1 100644
22--- a/pseudo.h
23+++ b/pseudo.h
24@@ -86,7 +86,7 @@ extern int pseudo_logfile(char *defname);
25 extern ssize_t pseudo_sys_path_max(void);
26 extern ssize_t pseudo_path_max(void);
27 #define PSEUDO_PWD_MAX 4096
28-extern int pseudo_etc_file(const char *filename, char *realname, int flags, char *path[], int dircount);
29+extern int pseudo_etc_file(const char *filename, char *realname, int flags, const char **search_dirs, int dircount);
30 extern void pseudo_stat32_from64(struct stat *, const struct stat64 *);
31 extern void pseudo_stat64_from32(struct stat64 *, const struct stat *);
32
33diff --git a/pseudo_client.c b/pseudo_client.c
34index 442dd19..7a4d7fa 100644
35--- a/pseudo_client.c
36+++ b/pseudo_client.c
37@@ -93,7 +93,7 @@ gid_t pseudo_egid;
38 gid_t pseudo_sgid;
39 gid_t pseudo_fgid;
40
41-#define PSEUDO_ETC_FILE(filename, realname, flags) pseudo_etc_file(filename, realname, flags, (char *[]) { pseudo_chroot, pseudo_passwd, PSEUDO_PASSWD_FALLBACK }, PSEUDO_PASSWD_FALLBACK ? 3 : 2)
42+#define PSEUDO_ETC_FILE(filename, realname, flags) pseudo_etc_file(filename, realname, flags, (const char *[]) { pseudo_chroot, pseudo_passwd, PSEUDO_PASSWD_FALLBACK }, PSEUDO_PASSWD_FALLBACK ? 3 : 2)
43
44 /* helper function to make a directory, just like mkdir -p.
45 * Can't use system() because the child shell would end up trying
46diff --git a/pseudo_util.c b/pseudo_util.c
47index e4e1fc8..647d3ad 100644
48--- a/pseudo_util.c
49+++ b/pseudo_util.c
50@@ -1264,7 +1264,7 @@ FILE *pseudo_host_etc_group_file = &pseudo_fake_group_file;
51 #endif
52
53 int
54-pseudo_etc_file(const char *file, char *realname, int flags, char *search_dirs[], int dircount) {
55+pseudo_etc_file(const char *file, char *realname, int flags, const char **search_dirs, int dircount) {
56 char filename[pseudo_path_max()];
57 int rc = -1;
58
59@@ -1280,7 +1280,7 @@ pseudo_etc_file(const char *file, char *realname, int flags, char *search_dirs[]
60 return -1;
61 }
62 for (i = 0; i < dircount; ++i) {
63- char *s = search_dirs[i];
64+ const char *s = search_dirs[i];
65 if (!s)
66 continue;
67 #if PSEUDO_PORT_DARWIN
68--
691.8.5.5
70
diff --git a/meta/recipes-devtools/pseudo/pseudo-1.6.2/0003-pseudo_client.c-support-multiple-directories-in-PSEU.patch b/meta/recipes-devtools/pseudo/pseudo-1.6.2/0003-pseudo_client.c-support-multiple-directories-in-PSEU.patch
deleted file mode 100644
index e6c6284a24..0000000000
--- a/meta/recipes-devtools/pseudo/pseudo-1.6.2/0003-pseudo_client.c-support-multiple-directories-in-PSEU.patch
+++ /dev/null
@@ -1,116 +0,0 @@
1From 09f04dc36f21c179235109b3dcddce9dda9a8ba8 Mon Sep 17 00:00:00 2001
2From: "Peter A. Bigot" <pab@pabigot.com>
3Date: Sun, 12 Oct 2014 12:17:48 -0500
4Subject: [PATCH 3/3] pseudo_client.c: support multiple directories in
5 PSEUDO_PASSWD
6
7For OpenEmbedded it is highly unlikely that using the build host passwd
8file is the right approach. Most packages can be built with a pseudo
9that was configured --without-passwd-fallback, since
10PSEUDO_PASSWD=${STAGING_DIR_TARGET} suffices.
11
12This fails when building images, because image.bbclass (correctly)
13overrides to PSEUDO_PASSWD=${IMAGE_ROOTFS}. However, the rootfs
14/etc/passwd is not created until the post-install phase of base-passwd,
15which is long after a passwd file is required. For example, the smart
16RPM interface wants to look up uid 0 right away. The right solution
17here is to look first in ${IMAGE_ROOTFS}, then fallback to
18a location holding immutable files with the minimum user/group settings
19necessary to successfully get base-passwd onto the target.
20
21Rather than rework pseudo to change PSEUDO_PASSWD_FALLBACK to be a
22run-time rather than compile-time specification, rework the handling of
23PSEUDO_PASSWD so that it is a colon-separated list of directories that
24are processed in order.
25
26Upstream-Status: Pending
27Signed-off-by: Peter A. Bigot <pab@pabigot.com>
28---
29 pseudo_client.c | 50 +++++++++++++++++++++++++++++++++++++++++++++++++-
30 1 file changed, 49 insertions(+), 1 deletion(-)
31
32diff --git a/pseudo_client.c b/pseudo_client.c
33index 7a4d7fa..b52b86a 100644
34--- a/pseudo_client.c
35+++ b/pseudo_client.c
36@@ -75,6 +75,8 @@ int pseudo_umask = 022;
37
38 static char **fd_paths = NULL;
39 static int nfds = 0;
40+static const char **passwd_paths = NULL;
41+static int npasswd_paths = 0;
42 static int messages = 0;
43 static struct timeval message_time = { .tv_sec = 0 };
44 static int pseudo_inited = 0;
45@@ -93,7 +95,7 @@ gid_t pseudo_egid;
46 gid_t pseudo_sgid;
47 gid_t pseudo_fgid;
48
49-#define PSEUDO_ETC_FILE(filename, realname, flags) pseudo_etc_file(filename, realname, flags, (const char *[]) { pseudo_chroot, pseudo_passwd, PSEUDO_PASSWD_FALLBACK }, PSEUDO_PASSWD_FALLBACK ? 3 : 2)
50+#define PSEUDO_ETC_FILE(filename, realname, flags) pseudo_etc_file(filename, realname, flags, passwd_paths, npasswd_paths)
51
52 /* helper function to make a directory, just like mkdir -p.
53 * Can't use system() because the child shell would end up trying
54@@ -117,6 +119,42 @@ mkdir_p(char *path) {
55 (void) mkdir(path, 0755);
56 }
57
58+static int
59+build_passwd_paths(const char **paths)
60+{
61+ int np = 0;
62+
63+ if (pseudo_chroot) {
64+ if (paths) {
65+ paths[np] = pseudo_chroot;
66+ }
67+ ++np;
68+ }
69+ if (pseudo_passwd) {
70+ const char *cp = pseudo_passwd;
71+ const char *next = strchr(cp, ':');
72+ while (next) {
73+ if (paths) {
74+ paths[np] = strndup(cp, next-cp);
75+ }
76+ ++np;
77+ cp = next+1;
78+ next = strchr(cp, ':');
79+ }
80+ if (paths) {
81+ paths[np] = strdup(cp);
82+ }
83+ ++np;
84+ }
85+ if (PSEUDO_PASSWD_FALLBACK) {
86+ if (paths) {
87+ paths[np] = PSEUDO_PASSWD_FALLBACK;
88+ }
89+ ++np;
90+ }
91+ return np;
92+}
93+
94 void
95 pseudo_init_client(void) {
96 char *env;
97@@ -329,6 +367,16 @@ pseudo_init_client(void) {
98 }
99 free(env);
100
101+ npasswd_paths = build_passwd_paths(NULL);
102+ if (npasswd_paths) {
103+ passwd_paths = malloc(npasswd_paths * sizeof(*passwd_paths));
104+ if (!passwd_paths) {
105+ pseudo_diag("couldn't allocate space for passwd paths.\n");
106+ exit(1);
107+ }
108+ build_passwd_paths(passwd_paths);
109+ }
110+
111 pseudo_inited = 1;
112 }
113 if (!pseudo_disabled)
114--
1151.8.5.5
116
diff --git a/meta/recipes-devtools/pseudo/pseudo_1.6.2.bb b/meta/recipes-devtools/pseudo/pseudo_1.6.4.bb
index 261c8d3abd..3d5b1fbd3e 100644
--- a/meta/recipes-devtools/pseudo/pseudo_1.6.2.bb
+++ b/meta/recipes-devtools/pseudo/pseudo_1.6.4.bb
@@ -2,15 +2,12 @@ require pseudo.inc
2 2
3SRC_URI = " \ 3SRC_URI = " \
4 http://www.yoctoproject.org/downloads/${BPN}/${BPN}-${PV}.tar.bz2 \ 4 http://www.yoctoproject.org/downloads/${BPN}/${BPN}-${PV}.tar.bz2 \
5 file://0001-pseudo_client.c-protect-pwd_lck-against-magic.patch \
6 file://0002-pseudo_util-modify-interface-to-pseudo_etc_file.patch \
7 file://0003-pseudo_client.c-support-multiple-directories-in-PSEU.patch \
8 file://fallback-passwd \ 5 file://fallback-passwd \
9 file://fallback-group \ 6 file://fallback-group \
10" 7"
11 8
12SRC_URI[md5sum] = "4d7b4f9d1b4aafa680ce94a5a9a52f1f" 9SRC_URI[md5sum] = "2fb800c90d643bfce55e1ce5ca67f3b3"
13SRC_URI[sha256sum] = "c72be92689511ced7c419149c6aaa1b1a9e4dfc6409d1f16ab72cc35bc1e376a" 10SRC_URI[sha256sum] = "25a7528f9191f74cceccc08a90c00086f2b3a9f6b900ea419a4f092de9a06775"
14 11
15PSEUDO_EXTRA_OPTS ?= "--enable-force-async --without-passwd-fallback" 12PSEUDO_EXTRA_OPTS ?= "--enable-force-async --without-passwd-fallback"
16 13
diff --git a/meta/recipes-devtools/pseudo/pseudo_git.bb b/meta/recipes-devtools/pseudo/pseudo_git.bb
index 8c6f06ab46..b505910fb5 100644
--- a/meta/recipes-devtools/pseudo/pseudo_git.bb
+++ b/meta/recipes-devtools/pseudo/pseudo_git.bb
@@ -1,7 +1,7 @@
1require pseudo.inc 1require pseudo.inc
2 2
3SRCREV = "0dc29e7c67f25d0978a7da5cd8965514912c5b36" 3SRCREV = "41389d4279d6a5f694615906217f481605b183b7"
4PV = "1.6.2+git${SRCPV}" 4PV = "1.6.4+git${SRCPV}"
5 5
6DEFAULT_PREFERENCE = "-1" 6DEFAULT_PREFERENCE = "-1"
7 7