projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5b5f566
)
repart: Don't copy root directory mode from source file
author
Daan De Meyer
<daan.j.demeyer@gmail.com>
Fri, 4 Oct 2024 19:33:52 +0000
(21:33 +0200)
committer
Luca Boccassi
<luca.boccassi@gmail.com>
Tue, 8 Oct 2024 15:39:12 +0000
(16:39 +0100)
If the source is a file, don't copy the mode and such from it to
the root directory, even if the target is /.
(cherry picked from commit
413d3ce1b76b42ba691eea54cd1704b14602442e
)
src/partition/repart.c
patch
|
blob
|
history
diff --git
a/src/partition/repart.c
b/src/partition/repart.c
index 21a0d2b4134a0f3b98e0c3c6fe125a1605202f35..cebcffd06db639a89d77fa804e2d8ced39860e4c 100644
(file)
--- a/
src/partition/repart.c
+++ b/
src/partition/repart.c
@@
-4901,6
+4901,8
@@
static int do_copy_files(Context *context, Partition *p, const char *root) {
return -errno;
sfd = chase_and_open(*source, arg_copy_source, CHASE_PREFIX_ROOT, O_PATH|O_DIRECTORY|O_CLOEXEC|O_NOCTTY, NULL);
+ if (sfd == -ENOTDIR)
+ continue;
if (sfd < 0)
return log_error_errno(sfd, "Failed to open source file '%s%s': %m", strempty(arg_copy_source), *source);