]> git.ipfire.org Git - thirdparty/coreutils.git/commit
Remove hash table, active_dir_map, used to detect directory cycles.
authorJim Meyering <jim@meyering.net>
Thu, 25 Apr 2002 16:40:04 +0000 (16:40 +0000)
committerJim Meyering <jim@meyering.net>
Thu, 25 Apr 2002 16:40:04 +0000 (16:40 +0000)
commit0199003cf96fbb3bbd72d5662a3f6788a4a4ce40
treea7f4a7cc817d1ca668b8d8951165a6da0c96ca50
parentbbd396f52fe205bf01dc7ccc7366ff653f5f8aec
Remove hash table, active_dir_map, used to detect directory cycles.
Instead, detect them lazily with just O(1) memory.
Suggestion from Andi Kleen.

(is_power_of_two): New function.
(print_nth_dir, make_active_dir_ent): Remove functions.
(hash_active_dir_ent, hash_compare_active_dir_ents): Likewise.
(remove_dir): Check for cycles here, ...
(rm): ... and don't check for cycles here.

(rm): Call fspec_get_full_mode here, rather than
fspec_get_filetype_mode.  We want to get the dev/ino earlier, and
at the same time as when we get the file type, to avoid the risk
that an attacker would change e.g. a directory to a symlink before
we record its dev/ino.
src/remove.c