main: do_switch_root() do not recursively remove across device boundaries
This commit is contained in:
committed by
Lennart Poettering
parent
597f43c784
commit
97a66e9470
+8
-1
@@ -1234,7 +1234,14 @@ static int do_switch_root(const char *switch_root) {
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user