mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08:00
switch-root: add a comment regarding the safety limits of rm_rf_children()
This commit is contained in:
committed by
Yu Watanabe
parent
871a41f0ef
commit
84b4c78570
@@ -130,6 +130,8 @@ int switch_root(const char *new_root,
|
||||
if (fstat(old_root_fd, &rb) < 0)
|
||||
return log_error_errno(errno, "Failed to stat old root directory: %m");
|
||||
|
||||
/* Note: the below won't operate on non-memory file systems (i.e. only on tmpfs, ramfs), and
|
||||
* it will stop at mount boundaries */
|
||||
(void) rm_rf_children(TAKE_FD(old_root_fd), 0, &rb); /* takes possession of the dir fd, even on failure */
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user