From 689d2a8e825b3fc77bd4671f2c0597d2de5f0fdf Mon Sep 17 00:00:00 2001 From: Anton Gerasimov Date: Tue, 4 Oct 2016 14:42:42 +0200 Subject: Tuned initrd image and pseudo environment to fix bugs with extended security attributes. Bug-AGL: SPEC-259 Change-Id: I44499ce3f5f1924aecf63689a93d1f20e779225e Signed-off-by: Anton Gerasimov --- ...eck-for-existence-of-old-file-to-renameat.patch | 40 ++++++++++++++++++++++ .../recipes-devtools/pseudo/pseudo_1.7.5.bbappend | 3 ++ 2 files changed, 43 insertions(+) create mode 100644 meta-sota/recipes-devtools/pseudo/files/0001-Add-check-for-existence-of-old-file-to-renameat.patch create mode 100644 meta-sota/recipes-devtools/pseudo/pseudo_1.7.5.bbappend (limited to 'meta-sota/recipes-devtools') diff --git a/meta-sota/recipes-devtools/pseudo/files/0001-Add-check-for-existence-of-old-file-to-renameat.patch b/meta-sota/recipes-devtools/pseudo/files/0001-Add-check-for-existence-of-old-file-to-renameat.patch new file mode 100644 index 0000000..3da2ad7 --- /dev/null +++ b/meta-sota/recipes-devtools/pseudo/files/0001-Add-check-for-existence-of-old-file-to-renameat.patch @@ -0,0 +1,40 @@ +From 41bb6c818a7ec9eeb33b60302c55c9c5ee393c5f Mon Sep 17 00:00:00 2001 +From: Anton Gerasimov +Date: Fri, 30 Sep 2016 17:12:19 +0200 +Subject: [PATCH 1/1] Add check for existence of old file to renameat + +--- + ports/unix/guts/renameat.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +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 : "", +@@ -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.9.3 + diff --git a/meta-sota/recipes-devtools/pseudo/pseudo_1.7.5.bbappend b/meta-sota/recipes-devtools/pseudo/pseudo_1.7.5.bbappend new file mode 100644 index 0000000..73b43df --- /dev/null +++ b/meta-sota/recipes-devtools/pseudo/pseudo_1.7.5.bbappend @@ -0,0 +1,3 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +SRC_URI += "file://0001-Add-check-for-existence-of-old-file-to-renameat.patch" -- cgit 1.2.3-korg