diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-02-01 10:27:11 -0500 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-03-12 22:51:39 -0400 |
commit | 6e60e8b2b2bab889379b380a28a167a0edd9d1d3 (patch) | |
tree | f12f54d5ba8e74e67e5fad3651a1e125bb8f4191 /import-layers/yocto-poky/meta/recipes-devtools/pseudo | |
parent | 509842add85b53e13164c1569a1fd43d5b8d91c5 (diff) | |
download | blackbird-openbmc-6e60e8b2b2bab889379b380a28a167a0edd9d1d3.tar.gz blackbird-openbmc-6e60e8b2b2bab889379b380a28a167a0edd9d1d3.zip |
Yocto 2.3
Move OpenBMC to Yocto 2.3(pyro).
Tested: Built and verified Witherspoon and Palmetto images
Change-Id: I50744030e771f4850afc2a93a10d3507e76d36bc
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Resolves: openbmc/openbmc#2461
Diffstat (limited to 'import-layers/yocto-poky/meta/recipes-devtools/pseudo')
12 files changed, 163 insertions, 392 deletions
diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/0001-Don-t-send-SIGUSR1-to-init.patch b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/0001-Don-t-send-SIGUSR1-to-init.patch deleted file mode 100644 index 6c694ceb0..000000000 --- a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/0001-Don-t-send-SIGUSR1-to-init.patch +++ /dev/null @@ -1,48 +0,0 @@ -From befc6dbd6469d428c9e0830dbe51bdf7ac39d9ae Mon Sep 17 00:00:00 2001 -From: Seebs <seebs@seebs.net> -Date: Thu, 22 Sep 2016 14:35:04 -0500 -Subject: [PATCH] Don't send SIGUSR1 to init. - -If the parent exits due to child process being slow, getppid() will return -1, and we'll send SIGUSR1 to init, which can break things like dumbinit -which aren't adequately protected against non-root processes sending them -signals. - -Signed-off-by: Seebs <seebs@seebs.net> - -Upstream-Status: Backport (commit befc6dbd6469d428c9e0830dbe51bdf7ac39d9ae) - -[YOCTO #10324] - -This resolves an issue where a docker container running builds would die -due to it's 'mini init' being signaled by pseudo. - -Signed-off-by: Mark Hatle <mark.hatle@windriver.com> ---- - pseudo_server.c | 11 ++++++++--- - -diff --git a/pseudo_server.c b/pseudo_server.c -index 65102dd..8731d20 100644 ---- a/pseudo_server.c -+++ b/pseudo_server.c -@@ -358,9 +358,14 @@ pseudo_server_start(int daemonize) { - signal(SIGTERM, quit_now); - /* tell parent process to stop waiting */ - if (daemonize) { -- pseudo_diag("Setup complete, sending SIGUSR1 to pid %d.\n", -- getppid()); -- kill(getppid(), SIGUSR1); -+ pid_t ppid = getppid(); -+ if (ppid == 1) { -+ pseudo_diag("Setup complete, but parent is init, not sending SIGUSR1.\n"); -+ } else { -+ pseudo_diag("Setup complete, sending SIGUSR1 to pid %d.\n", -+ ppid); -+ kill(ppid, SIGUSR1); -+ } - } - pseudo_server_loop(); - return 0; --- -2.5.5 - diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/0001-Quiet-diagnostics-during-startup-for-pseudo-d.patch b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/0001-Quiet-diagnostics-during-startup-for-pseudo-d.patch deleted file mode 100644 index d4b9f6a0f..000000000 --- a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/0001-Quiet-diagnostics-during-startup-for-pseudo-d.patch +++ /dev/null @@ -1,54 +0,0 @@ -From eead8a505245a292c43f070c0e836cdfeb7bd7bd Mon Sep 17 00:00:00 2001 -From: Seebs <seebs@seebs.net> -Date: Wed, 28 Sep 2016 17:05:17 -0500 -Subject: [PATCH 1/2] Quiet diagnostics during startup for pseudo -d - -When the client spawns a pseudo server, it starts out sending diagnostics -to stderr. This can be spammy in some cases with races during startup; -everything resolves, but we get scary-looking diagnostics. So shove -those into a log file. - -Signed-off-by: Seebs <seebs@seebs.net> - -Upstream-Status: Backport -Signed-off-by: Robert Yang <liezhi.yang@windriver.com> ---- - ChangeLog.txt | 5 +++++ - pseudo_server.c | 4 +++- - 2 files changed, 8 insertions(+), 1 deletion(-) - -diff --git a/ChangeLog.txt b/ChangeLog.txt -index d6359ca..4cc24de 100644 ---- a/ChangeLog.txt -+++ b/ChangeLog.txt -@@ -1,3 +1,8 @@ -+2016-09-28: -+ * (seebs) Send errors to log when daemonizing, but do that a lot -+ sooner to prevent startup messages which can show up spuriously -+ with multiple clients. -+ - 2016-07-28: - * (seebs) Fix performance issue on deletion with xattr changes. - -diff --git a/pseudo_server.c b/pseudo_server.c -index 8731d20..7c2db2f 100644 ---- a/pseudo_server.c -+++ b/pseudo_server.c -@@ -162,6 +162,9 @@ pseudo_server_start(int daemonize) { - * SIGUSR1, or until too much time has passed. */ - if (daemonize) { - int child; -+ -+ /* make startup messages go away when invoked-as-daemon */ -+ pseudo_debug_logfile(PSEUDO_LOGFILE, 2); - child = fork(); - if (child == -1) { - pseudo_diag("Couldn't fork child process: %s\n", -@@ -231,7 +234,6 @@ pseudo_server_start(int daemonize) { - setsid(); - fclose(stdin); - fclose(stdout); -- pseudo_debug_logfile(PSEUDO_LOGFILE, 2); - /* and then just execute the server code normally. */ - /* Any logging will presumably go to logfile, but - * exit status will make it back to the parent for diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/0002-Use-correct-file-descriptor.patch b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/0002-Use-correct-file-descriptor.patch deleted file mode 100644 index dd6fd87ae..000000000 --- a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/0002-Use-correct-file-descriptor.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 7a0632cad851826d804db0540d9a59773e6bf29c Mon Sep 17 00:00:00 2001 -From: Seebs <seebs@seebs.net> -Date: Wed, 28 Sep 2016 22:12:29 -0500 -Subject: [PATCH 2/2] Use correct file descriptor - -So it turns out that pseudo_logfile() was returning 0 or -1, and -pseudo_debug_logfile() was expecting it to be the correct file descriptor -to use. And it's basically a mystery that any of that ever worked. - -Signed-off-by: Seebs <seebs@seebs.net> - -Upstream-Status: Backport -Signed-off-by: Robert Yang <liezhi.yang@windriver.com> ---- - ChangeLog.txt | 3 +++ - pseudo_util.c | 3 ++- - 2 files changed, 5 insertions(+), 1 deletion(-) - -diff --git a/ChangeLog.txt b/ChangeLog.txt -index 4cc24de..49a6c36 100644 ---- a/ChangeLog.txt -+++ b/ChangeLog.txt -@@ -2,6 +2,9 @@ - * (seebs) Send errors to log when daemonizing, but do that a lot - sooner to prevent startup messages which can show up spuriously - with multiple clients. -+ * (seebs) return file descriptor from pseudo_logfile, so we set -+ pseudo_util_debug_fd to the right value instead of to stdin. -+ Nice bug. - - 2016-07-28: - * (seebs) Fix performance issue on deletion with xattr changes. -diff --git a/pseudo_util.c b/pseudo_util.c -index 0c156cf..a60c74b 100644 ---- a/pseudo_util.c -+++ b/pseudo_util.c -@@ -1569,7 +1569,7 @@ pseudo_logfile(char *filename, char *defname, int prefer_fd) { - if (fd == -1) - return -1; - else -- return 0; -+ return fd; - } - - int -@@ -1579,6 +1579,7 @@ pseudo_debug_logfile(char *defname, int prefer_fd) { - - fd = pseudo_logfile(filename, defname, prefer_fd); - if (fd > -1) { -+ pseudo_diag("debug_logfile: fd %d\n", fd); - pseudo_util_debug_fd = fd; - return 0; - } diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/0003-Fix-renameat-parallel-to-previous-fix-to-rename.patch b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/0003-Fix-renameat-parallel-to-previous-fix-to-rename.patch deleted file mode 100644 index 739c03ee6..000000000 --- a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/0003-Fix-renameat-parallel-to-previous-fix-to-rename.patch +++ /dev/null @@ -1,64 +0,0 @@ -From d9ab3a0acc94151048498b1ea4d69e7707df1526 Mon Sep 17 00:00:00 2001 -From: Seebs <seebs@seebs.net> -Date: Fri, 30 Sep 2016 10:56:35 -0500 -Subject: [PATCH 3/3] Fix renameat (parallel to previous fix to rename) - -There was a bug in rename(), which was duplicated when renameat() was -implemented, and which got fixed two years ago for rename(), but no -one ever uses renameat() so it didn't get fixed there. Thanks -to Anton Gerasimov <anton@advancedtelematic.com> for the bug report -and patch. - -Signed-off-by: Seebs <seebs@seebs.net> - -Upstream-Status: Backport -Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> - ---- - ChangeLog.txt | 4 ++++ - ports/unix/guts/renameat.c | 7 ++++++- - 2 files changed, 10 insertions(+), 1 deletion(-) - -diff --git a/ChangeLog.txt b/ChangeLog.txt -index 65b9759..ca04cc0 100644 ---- a/ChangeLog.txt -+++ b/ChangeLog.txt -@@ -1,3 +1,7 @@ -+2016-09-30: -+ * (seebs) Fix rename at, matching fix from ee00f63d for rename. Bug -+ and fix provided by Anton Gerasimov <anton@advancedtelematic.com>. -+ - 2016-09-28: - * (seebs) Send errors to log when daemonizing, but do that a lot - sooner to prevent startup messages which can show up spuriously -diff --git a/ports/unix/guts/renameat.c b/ports/unix/guts/renameat.c -index ade0509..d5e36fa 100644 ---- a/ports/unix/guts/renameat.c -+++ b/ports/unix/guts/renameat.c -@@ -11,6 +11,7 @@ - int oldrc, newrc; - int save_errno; - int old_db_entry = 0; -+ int may_unlinked = 0; - - pseudo_debug(PDBGF_FILE, "renameat: %d,%s->%d,%s\n", - olddirfd, oldpath ? oldpath : "<nil>", -@@ -44,10 +45,14 @@ - /* as with unlink, we have to mark that the file may get deleted */ - msg = pseudo_client_op(OP_MAY_UNLINK, 0, -1, newdirfd, newpath, newrc ? NULL : &newbuf); - if (msg && msg->result == RESULT_SUCCEED) -+ may_unlinked = 1; -+ msg = pseudo_client_op(OP_STAT, 0, -1, olddirfd, oldpath, oldrc ? NULL : &oldbuf); -+ if (msg && msg->result == RESULT_SUCCEED) - old_db_entry = 1; -+ - rc = real_renameat(olddirfd, oldpath, newdirfd, newpath); - save_errno = errno; -- if (old_db_entry) { -+ if (may_unlinked) { - if (rc == -1) { - /* since we failed, that wasn't really unlinked -- put - * it back. --- -2.7.4 - diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/Fix-xattr-performance.patch b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/Fix-xattr-performance.patch deleted file mode 100644 index 4e072e6c4..000000000 --- a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/Fix-xattr-performance.patch +++ /dev/null @@ -1,117 +0,0 @@ -From 0d9071f3090bbd7880558f3b488b236ac19b44fc Mon Sep 17 00:00:00 2001 -From: seebs <seebs@seebs.net> -Date: Thu, 28 Jul 2016 14:02:12 -0500 -Subject: [PATCH 1/2] Fix xattr performance - -When deleting files, we *do* know the inode and attribute, most of the -time, so we pass those in whenever possible. The full purge of unmatched -xattrs should not happen when the correct dev/ino are believed to be known. - -Signed-off-by: Seebs <seebs@seebs.net> - -[YOCTO #9929] -Upstream-Status: Backport (0d9071f3090bbd7880558f3b488b236ac19b44fc) -Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> ---- - ChangeLog.txt | 3 +++ - pseudo.c | 11 ++++++++--- - pseudo_db.c | 15 +++++++++------ - pseudo_db.h | 2 +- - 4 files changed, 21 insertions(+), 10 deletions(-) - -diff --git a/ChangeLog.txt b/ChangeLog.txt -index 131f163..d6359ca 100644 ---- a/ChangeLog.txt -+++ b/ChangeLog.txt -@@ -1,3 +1,6 @@ -+2016-07-28: -+ * (seebs) Fix performance issue on deletion with xattr changes. -+ - 2016-07-08: - * (RP) release 1.8.1 - * (joshuagl) Fix log table creation issue -diff --git a/pseudo.c b/pseudo.c -index 52f649f..db1c400 100644 ---- a/pseudo.c -+++ b/pseudo.c -@@ -600,7 +600,12 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag, char **respon - if (by_path.deleting != 0) { - pseudo_debug(PDBGF_FILE, "inode mismatch for '%s' -- old one was marked for deletion, deleting.\n", - msg->path); -- pdb_did_unlink_file(msg->path, by_path.deleting); -+ /* in this case, we don't trust the -+ * existing entries, so we will do the -+ * more expensive sweep for stray -+ * xattrs. -+ */ -+ pdb_did_unlink_file(msg->path, NULL, by_path.deleting); - } else { - pseudo_diag("inode mismatch: '%s' ino %llu in db, %llu in request.\n", - msg->path, -@@ -698,7 +703,7 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag, char **respon - if (by_ino.deleting != 0) { - pseudo_debug(PDBGF_FILE, "inode mismatch for '%s' -- old one was marked for deletion, deleting.\n", - msg->path); -- pdb_did_unlink_file(path_by_ino, by_ino.deleting); -+ pdb_did_unlink_file(path_by_ino, &by_ino, by_ino.deleting); - } else { - pseudo_diag("path mismatch [%d link%s]: ino %llu db '%s' req '%s'.\n", - msg->nlink, -@@ -930,7 +935,7 @@ pseudo_op(pseudo_msg_t *msg, const char *program, const char *tag, char **respon - } - break; - case OP_DID_UNLINK: -- pdb_did_unlink_file(msg->path, msg->client); -+ pdb_did_unlink_file(msg->path, msg, msg->client); - break; - case OP_CANCEL_UNLINK: - pdb_cancel_unlink_file(msg); -diff --git a/pseudo_db.c b/pseudo_db.c -index 289bb29..e7dd193 100644 ---- a/pseudo_db.c -+++ b/pseudo_db.c -@@ -1848,7 +1848,7 @@ pdb_did_unlink_files(int deleting) { - - /* confirm deletion of a specific file by a given client */ - int --pdb_did_unlink_file(char *path, int deleting) { -+pdb_did_unlink_file(char *path, pseudo_msg_t *msg, int deleting) { - static sqlite3_stmt *delete_exact; - int rc, exact; - char *sql_delete_exact = "DELETE FROM files WHERE path = ? AND deleting = ?;"; -@@ -1878,11 +1878,14 @@ pdb_did_unlink_file(char *path, int deleting) { - exact = sqlite3_changes(file_db); - pseudo_debug(PDBGF_DB, "(exact %d)\n", exact); - sqlite3_reset(delete_exact); -- sqlite3_clear_bindings(delete_exact); -- /* we have to clean everything because we don't know for sure the -- * device/inode... -- */ -- pdb_clear_unused_xattrs(); -+ if (msg) { -+ pdb_clear_xattrs(msg); -+ } else { -+ /* we have to clean everything because we don't know for sure the -+ * device/inode... -+ */ -+ pdb_clear_unused_xattrs(); -+ } - return rc != SQLITE_DONE; - } - -diff --git a/pseudo_db.h b/pseudo_db.h -index a54f3c1..1b2599c 100644 ---- a/pseudo_db.h -+++ b/pseudo_db.h -@@ -39,7 +39,7 @@ typedef struct { - - extern int pdb_maybe_backup(void); - extern int pdb_cancel_unlink_file(pseudo_msg_t *msg); --extern int pdb_did_unlink_file(char *path, int deleting); -+extern int pdb_did_unlink_file(char *path, pseudo_msg_t *msg, int deleting); - extern int pdb_did_unlink_files(int deleting); - extern int pdb_link_file(pseudo_msg_t *msg); - extern int pdb_may_unlink_file(pseudo_msg_t *msg, int deleting); --- -2.7.4 - diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/More-correctly-fix-xattrs.patch b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/More-correctly-fix-xattrs.patch deleted file mode 100644 index 3d178f9b4..000000000 --- a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/More-correctly-fix-xattrs.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 45eca34c754d416a38bee90fb2d3c110a0b6cc5f Mon Sep 17 00:00:00 2001 -From: Seebs <seebs@seebs.net> -Date: Thu, 3 Nov 2016 11:36:12 -0500 -Subject: [PATCH] More-correctly fix xattrs - -Fix provided by Patrick Ohly <patrick.ohly@intel.com>. This resolves -the actual cause of the path length mismatches, and explains why -I couldn't quite explain why the previous one had only sometimes -worked, also why it showed up on directories but not plain files. - -Signed-off-by: Seebs <seebs@seebs.net> - -Fixes [YOCTO #10623] - -Upstream-Status: Backport [commit 45eca34c754d416a38bee90fb2d3c110a0b6cc5f] - -Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> ---- - pseudo_client.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/pseudo_client.c b/pseudo_client.c -index 6a08df3..b1a00fa 100644 ---- a/pseudo_client.c -+++ b/pseudo_client.c -@@ -1676,7 +1676,7 @@ pseudo_client_op(pseudo_op_t op, int access, int fd, int dirfd, const char *path - * empty path for that. - */ - if (path_extra_1) { -- size_t full_len = path_extra_1len + 1 + pathlen; -+ size_t full_len = path_extra_1len + 1 + pathlen - strip_slash; - size_t partial_len = pathlen - 1 - strip_slash; - if (path_extra_2) { - full_len += path_extra_2len + 1; --- -2.1.4 - diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/b6b68db896f9963558334aff7fca61adde4ec10f.patch b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/b6b68db896f9963558334aff7fca61adde4ec10f.patch new file mode 100644 index 000000000..3045a3b73 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/b6b68db896f9963558334aff7fca61adde4ec10f.patch @@ -0,0 +1,48 @@ +From b6b68db896f9963558334aff7fca61adde4ec10f Mon Sep 17 00:00:00 2001 +From: Seebs <seebs@seebs.net> +Date: Thu, 13 Apr 2017 18:12:01 -0500 +Subject: Prevent bash from segfaulting when unloading pseudo + +bash's extremely fancy internal awareness of how the environment looks +means that, if you directly call the underlying libc "unsetenv" on +a variable, bash can end up trying to access a null pointer. Fixing +this generically is actually rather hard; you can't really avoid +writing to environ on fork() or popen(), even if you change all +execv*() functions to use the execv*e() variants. So for now, instead +of unsetting the variable, set it to an empty string. + +Thanks to Saur in IRC for spotting this and helping debug it. + +Signed-off-by: Seebs <seebs@seebs.net> + +Upstream-Status: Backport + +diff --git a/ChangeLog.txt b/ChangeLog.txt +index a2d30e9..8ba1ffa 100644 +--- a/ChangeLog.txt ++++ b/ChangeLog.txt +@@ -1,3 +1,8 @@ ++2017-04-13: ++ * (seebs) don't unset LD_PRELOAD or the like, because if you ++ do that, bash can segfault because it "knows" how many ++ fields are in environ. ++ + 2017-02-24: + * (seebs) import posix_acl_default fix from Anton Gerasimov + <anton@advancedtelematic.com> +diff --git a/pseudo_util.c b/pseudo_util.c +index 172990b..6a1fac2 100644 +--- a/pseudo_util.c ++++ b/pseudo_util.c +@@ -844,7 +844,7 @@ void pseudo_dropenv() { + if (ld_preload && strlen(ld_preload)) { + SETENV(PRELINK_LIBRARIES, ld_preload, 1); + } else { +- UNSETENV(PRELINK_LIBRARIES); ++ SETENV(PRELINK_LIBRARIES, "", 1); + } + } + } +-- +cgit v0.10.2 + diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/efe0be279901006f939cd357ccee47b651c786da.patch b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/efe0be279901006f939cd357ccee47b651c786da.patch new file mode 100644 index 000000000..64fc58c4f --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/efe0be279901006f939cd357ccee47b651c786da.patch @@ -0,0 +1,99 @@ +From efe0be279901006f939cd357ccee47b651c786da Mon Sep 17 00:00:00 2001 +From: Seebs <seebs@seebs.net> +Date: Fri, 24 Feb 2017 12:47:38 -0600 +Subject: Don't try to record 0-length posix_acl_default xattrs + +Based on a submission from Anton Gerasimov <anton@advancedtelematic.com> + +On some systems, with some kernel configs, "cp -a" apparently tries to +set an empty ACL list, with a valid header but no contents, which causes +strange and mysterious behavior later if we actually create such an entry. +So filter that out, also sanity-check a couple of other things. + +Signed-off-by: Seebs <seebs@seebs.net> + +Upstream-Status: Backport + +diff --git a/ChangeLog.txt b/ChangeLog.txt +index ae2a6e9..a2d30e9 100644 +--- a/ChangeLog.txt ++++ b/ChangeLog.txt +@@ -1,3 +1,6 @@ ++2017-02-24: ++ * (seebs) import posix_acl_default fix from Anton Gerasimov ++ <anton@advancedtelematic.com> + 2017-02-01: + * (seebs) handle xattr deletion slightly more carefully. + * (seebs) tag this as 1.8.2 +diff --git a/ports/linux/xattr/pseudo_wrappers.c b/ports/linux/xattr/pseudo_wrappers.c +index 46bc053..d69d53e 100644 +--- a/ports/linux/xattr/pseudo_wrappers.c ++++ b/ports/linux/xattr/pseudo_wrappers.c +@@ -62,9 +62,9 @@ static int + posix_permissions(const acl_header *header, int entries, int *extra, int *mode) { + int acl_seen = 0; + if (le32(header->version) != 2) { +- pseudo_diag("Fatal: ACL support no available for header version %d.\n", ++ pseudo_diag("Fatal: ACL support not available for header version %d.\n", + le32(header->version)); +- return 1; ++ return -1; + } + *mode = 0; + *extra = 0; +@@ -140,12 +140,38 @@ static int shared_setxattr(const char *path, int fd, const char *name, const voi + pseudo_debug(PDBGF_XATTR, "setxattr(%s [fd %d], %s => '%.*s')\n", + path ? path : "<no path>", fd, name, (int) size, (char *) value); + ++ /* Filter out erroneous sizes for POSIX ACL ++ * see posix_acl_xattr_count in include/linux/posix_acl_xattr.h of Linux source code */ ++ /* I don't think there's any posix_acl_* values that aren't in this format */ ++ if (!strncmp(name, "system.posix_acl_", 17)) { ++ // ACL is corrupt, issue an error ++ if(size < sizeof(acl_header) || (size - sizeof(acl_header)) % sizeof(acl_entry) != 0) { ++ pseudo_debug(PDBGF_XATTR, "invalid data size for %s: %d\n", ++ name, (int) size); ++ errno = EINVAL; ++ return -1; ++ } ++ ++ // ACL is empty, do nothing ++ if((size - sizeof(acl_header)) / sizeof(acl_entry) == 0) { ++ /* on some systems, "cp -a" will attempt to clone the ++ * posix_acl_default entry for a directory (which would specify ++ * default ACLs for new files in that directory), but if the ++ * original was empty, we get a header but no entries. With ++ * real xattr, that ends up being silently discarded, apparently, ++ * so we discard it too. ++ */ ++ pseudo_debug(PDBGF_XATTR, "0-length ACL entry %s.\n", name); ++ return 0; ++ } ++ } + /* this may be a plain chmod */ + if (!strcmp(name, "system.posix_acl_access")) { + int extra; + int mode; + int entries = (size - sizeof(acl_header)) / sizeof(acl_entry); +- if (!posix_permissions(value, entries, &extra, &mode)) { ++ int res = posix_permissions(value, entries, &extra, &mode); ++ if (res == 0) { + pseudo_debug(PDBGF_XATTR, "posix_acl_access translated to mode %04o. Remaining attribute(s): %d.\n", + mode, extra); + buf.st_mode = mode; +@@ -164,8 +190,12 @@ static int shared_setxattr(const char *path, int fd, const char *name, const voi + if (!extra) { + return 0; + } ++ } else if (res == -1) { ++ errno = EOPNOTSUPP; ++ return -1; + } + } ++ + if (!strcmp(name, "user.pseudo_data")) { + pseudo_debug(PDBGF_XATTR | PDBGF_XATTRDB, "user.pseudo_data xattribute does not get to go in database.\n"); + return -1; +-- +cgit v0.10.2 + diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/fallback-passwd b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/fallback-passwd index 0889c5704..08611baaf 100644 --- a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/fallback-passwd +++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/files/fallback-passwd @@ -1,2 +1,3 @@ root::0:0:root:/home/root:/bin/sh +pseudopasswd:*:1:1:this-is-the-pseudo-passwd:/nonexistent:/bin/sh nobody:*:65534:65534:nobody:/nonexistent:/bin/sh diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.8.1.bb b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.8.1.bb deleted file mode 100644 index 90b53c0c1..000000000 --- a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.8.1.bb +++ /dev/null @@ -1,17 +0,0 @@ -require pseudo.inc - -SRC_URI = "http://downloads.yoctoproject.org/releases/pseudo/${BPN}-${PV}.tar.bz2 \ - file://0001-configure-Prune-PIE-flags.patch \ - file://fallback-passwd \ - file://fallback-group \ - file://moreretries.patch \ - file://Fix-xattr-performance.patch \ - file://0001-Don-t-send-SIGUSR1-to-init.patch \ - file://0001-Quiet-diagnostics-during-startup-for-pseudo-d.patch \ - file://0002-Use-correct-file-descriptor.patch \ - file://0003-Fix-renameat-parallel-to-previous-fix-to-rename.patch \ - file://More-correctly-fix-xattrs.patch \ - " - -SRC_URI[md5sum] = "ee38e4fb62ff88ad067b1a5a3825bac7" -SRC_URI[sha256sum] = "dac4ad2d21228053151121320f629d41dd5c0c87695ac4e7aea286c414192ab5" diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.8.2.bb b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.8.2.bb new file mode 100644 index 000000000..b427b9ac3 --- /dev/null +++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_1.8.2.bb @@ -0,0 +1,13 @@ +require pseudo.inc + +SRC_URI = "http://downloads.yoctoproject.org/releases/pseudo/${BPN}-${PV}.tar.bz2 \ + file://0001-configure-Prune-PIE-flags.patch \ + file://fallback-passwd \ + file://fallback-group \ + file://moreretries.patch \ + file://efe0be279901006f939cd357ccee47b651c786da.patch \ + file://b6b68db896f9963558334aff7fca61adde4ec10f.patch \ + " + +SRC_URI[md5sum] = "7d41e72188fbea1f696c399c1a435675" +SRC_URI[sha256sum] = "ceb456bd47770a37ca20784a91d715c5a7601e07e26ab11b0c77e9203ed3d196" diff --git a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_git.bb b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_git.bb index ac923bbb7..42c7b2ea5 100644 --- a/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_git.bb +++ b/import-layers/yocto-poky/meta/recipes-devtools/pseudo/pseudo_git.bb @@ -1,7 +1,7 @@ require pseudo.inc -SRCREV = "45eca34c754d416a38bee90fb2d3c110a0b6cc5f" -PV = "1.8.1+git${SRCPV}" +SRCREV = "02168305b0a19f981ffe857f36eb256ba8810b77" +PV = "1.8.2+git${SRCPV}" DEFAULT_PREFERENCE = "-1" |