chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
597f43c
)
main: do_switch_root() do not recursively remove across device boundaries
author
Harald Hoyer
<harald@redhat.com>
Wed, 16 May 2012 13:08:28 +0000
(15:08 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Mon, 21 May 2012 16:53:02 +0000
(18:53 +0200)
src/core/main.c
patch
|
blob
|
history
diff --git
a/src/core/main.c
b/src/core/main.c
index 878eaf353f99106572449b442304476d415400f2..4d09cb71742a54fd20d6d5d53f83c13ccceb26fe 100644
(file)
--- a/
src/core/main.c
+++ b/
src/core/main.c
@@
-1234,7
+1234,14
@@
static int do_switch_root(const char *switch_root) {
}
if (cfd >= 0) {
}
if (cfd >= 0) {
- rm_rf_children(cfd, false, false);
+ struct stat rb;
+
+ if (fstat(cfd, &rb)) {
+ log_error("failed to stat old root directory");
+ goto fail;
+ }
+
+ rm_rf_children(cfd, false, false, &rb);
close(cfd);
cfd=-1;
}
close(cfd);
cfd=-1;
}