summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2020-09-29 17:57:38 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-10-07 11:18:38 +0100
commit84e0642ed6aba422583871fc153bbd94380074de (patch)
tree5182cc0e3d3148e2cb2f66308d893271bb316ab1
parent84d006b9fb9c131fb626a090d9e4a76cc47eaf84 (diff)
downloadpoky-84e0642ed6aba422583871fc153bbd94380074de.tar.gz
pseudo: Abort on mismatch patch
Rather than doing what turns out to be a rather dangerous "fixup" if we see a file with a different path but the same inode as another file we've previously seen, throw and abort. Direct the user to a wiki page where we can maintain information about what this error means. (From OE-Core rev: 2db491d97da08d44ebd257f98489550a82a7935c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/pseudo/files/abort_on_mismatch.patch64
-rw-r--r--meta/recipes-devtools/pseudo/pseudo_git.bb1
2 files changed, 65 insertions, 0 deletions
diff --git a/meta/recipes-devtools/pseudo/files/abort_on_mismatch.patch b/meta/recipes-devtools/pseudo/files/abort_on_mismatch.patch
new file mode 100644
index 0000000000..1737269ec8
--- /dev/null
+++ b/meta/recipes-devtools/pseudo/files/abort_on_mismatch.patch
@@ -0,0 +1,64 @@
1Rather than mapping mismatched inode entries to paths, thrown an abort()
2instead. Add a new result type to allow the server to pass back
3this instruction to the client.
4
5Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
6Upstream-Status: Pending
7
8Index: git/pseudo.c
9===================================================================
10--- git.orig/pseudo.c
11+++ git/pseudo.c
12@@ -695,17 +695,15 @@ pseudo_op(pseudo_msg_t *msg, const char
13 msg->path);
14 pdb_did_unlink_file(path_by_ino, &by_ino, by_ino.deleting);
15 } else {
16- int flags = 0;
17- if (msg->nlink > 1) {
18- flags = PDBGF_FILE | PDBGF_VERBOSE;
19- }
20- pseudo_debug(flags, "path mismatch [%d link%s]: ino %llu db '%s' req '%s'.\n",
21+ pseudo_diag("path mismatch [%d link%s]: ino %llu db '%s' req '%s'.\n",
22 msg->nlink,
23 msg->nlink == 1 ? "" : "s",
24 (unsigned long long) msg_header.ino,
25 path_by_ino ? path_by_ino : "no path",
26 msg->path);
27 found_ino = 0;
28+ msg->result = RESULT_ABORT;
29+ goto op_exit;
30 }
31 }
32 } else {
33@@ -1025,6 +1023,7 @@ pseudo_op(pseudo_msg_t *msg, const char
34 break;
35 }
36
37+op_exit:
38 /* in the case of an exact match, we just used the pointer
39 * rather than allocating space.
40 */
41Index: git/pseudo_client.c
42===================================================================
43--- git.orig/pseudo_client.c
44+++ git/pseudo_client.c
45@@ -1919,6 +1919,10 @@ pseudo_client_op(pseudo_op_t op, int acc
46 #endif
47 if (result) {
48 pseudo_debug(PDBGF_OP, "(%d) %s", getpid(), pseudo_res_name(result->result));
49+ if (result->result == RESULT_ABORT) {
50+ pseudo_diag("abort()ing pseudi client by server request. See https://wiki.yoctoproject.org/wiki/Pseudo_Abort for more details on this.\n");
51+ abort();
52+ }
53 if (op == OP_STAT || op == OP_FSTAT) {
54 pseudo_debug(PDBGF_OP, " mode 0%o uid %d:%d",
55 (int) result->mode,
56Index: git/enums/res.in
57===================================================================
58--- git.orig/enums/res.in
59+++ git/enums/res.in
60@@ -2,3 +2,4 @@ res: RESULT
61 succeed
62 fail
63 error
64+abort
diff --git a/meta/recipes-devtools/pseudo/pseudo_git.bb b/meta/recipes-devtools/pseudo/pseudo_git.bb
index 57c32d0cfc..56c9b4e232 100644
--- a/meta/recipes-devtools/pseudo/pseudo_git.bb
+++ b/meta/recipes-devtools/pseudo/pseudo_git.bb
@@ -4,6 +4,7 @@ SRC_URI = "git://git.yoctoproject.org/pseudo;branch=oe-core \
4 file://0001-configure-Prune-PIE-flags.patch \ 4 file://0001-configure-Prune-PIE-flags.patch \
5 file://delete_mismatches.patch \ 5 file://delete_mismatches.patch \
6 file://add_ignore_paths.patch \ 6 file://add_ignore_paths.patch \
7 file://abort_on_mismatch.patch \
7 file://fallback-passwd \ 8 file://fallback-passwd \
8 file://fallback-group \ 9 file://fallback-group \
9 " 10 "