Don't allow a malicious user to trick another user's rm process into
authorJim Meyering <jim@meyering.net>
Fri, 8 Mar 2002 16:45:31 +0000 (16:45 +0000)
committerJim Meyering <jim@meyering.net>
Fri, 8 Mar 2002 16:45:31 +0000 (16:45 +0000)
commit2c929257dc6042827f059f90ab8f7c3e6898a7b9
treeb6110301e93c8d72624d0d943bf8e1ed44301867
parent28efd2488314fc1f3487d77bbe03b21212746f24
Don't allow a malicious user to trick another user's rm process into
removing unintended files.  In one scenario, if root is removing a
hierarchy that is writable by the malicious user, that user may trick
root into removing all of `/'.  Reported by Wojciech Purczynski.

(remove_dir): After chdir `..', call lstat to get the
dev/inode of "." and fail if they aren't the same as the old numbers.
(remove_cwd_entries): New parameter, `cwd_dev_ino'.
(remove_dir): Likewise.
(rm): Likewise.
Adjust all callers.
src/remove.c