bin/rmdir -p option bug [patch]

Douwe Kiela virtus at wanadoo.nl
Thu Jul 22 11:38:28 PDT 2004


Hey peeps,

According to SUSv3, the -p option should behave exactly the same as rmdir
without any option, only that it recursively removes all directories
mentioned
as arguments in the command line. In the current rmdir, you can't remove
multiple directories and meanwhile recursively remove all it's
subdirectories.

This doesn't work:

daedalus# rmdir -p ./a ./z
rmdir: ./a: Directory not empty
rmdir: ./z: Directory not empty

while these directories are completely empty, except for other empty
subdirectories.
SUSv3 states, aswell as the manual page:

-p
Remove all directories in a pathname

This is due to an error in the rmdir source code in the loop that handles
command
line arguments. A patch can be found here:

http://virtus.ath.cx/dfbsd/rmdir.c.diff

Regards,
Douwe






More information about the Submit mailing list