diff options
Diffstat (limited to 'meta/recipes-devtools/pseudo/files/mayunlink.patch')
-rw-r--r-- | meta/recipes-devtools/pseudo/files/mayunlink.patch | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/meta/recipes-devtools/pseudo/files/mayunlink.patch b/meta/recipes-devtools/pseudo/files/mayunlink.patch deleted file mode 100644 index 9d54e40dd9..0000000000 --- a/meta/recipes-devtools/pseudo/files/mayunlink.patch +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | Some operations may call unlink() on an open fd, then call fchown/fchmod/fstat | ||
2 | on that fd. This would currently readd its entry to the database, which | ||
3 | is necessary to preserve its permissions information however since that | ||
4 | file will be lost when it is closed, we don't want the DB entry to persist. | ||
5 | Marking it as may_unlink means the code will know its likely been deleted | ||
6 | and ignore the entry later, giving improved behaviour that simple path | ||
7 | mismatch warnings. We can use an nlink of zero to detect this. | ||
8 | |||
9 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> | ||
10 | Upstream-Status: Pending | ||
11 | |||
12 | Index: git/pseudo.c | ||
13 | =================================================================== | ||
14 | --- git.orig/pseudo.c | ||
15 | +++ git/pseudo.c | ||
16 | @@ -1100,6 +1100,21 @@ pseudo_op(pseudo_msg_t *msg, const char | ||
17 | break; | ||
18 | } | ||
19 | |||
20 | + switch (msg->op) { | ||
21 | + case OP_FCHOWN: /* FALLTHROUGH */ | ||
22 | + case OP_FCHMOD: /* FALLTHROUGH */ | ||
23 | + case OP_FSTAT: | ||
24 | + if (!found_path && !found_ino && (msg->nlink == 0)) { | ||
25 | + /* If nlink is 0 for an fchown/fchmod/fstat, we probably have an fd which is | ||
26 | + * unlinked and we don't want to do inode/path matching against it. Marking it | ||
27 | + * as may unlink gives the right hints in the database to ensure we | ||
28 | + * handle correctly whilst maintaining the permissions whilst the | ||
29 | + * file exists for the fd. */ | ||
30 | + pdb_may_unlink_file(msg, msg->client); | ||
31 | + } | ||
32 | + break; | ||
33 | + } | ||
34 | + | ||
35 | op_exit: | ||
36 | /* in the case of an exact match, we just used the pointer | ||
37 | * rather than allocating space. | ||