Issues removing files with certain characters in their names.

Rich Felker dalias at libc.org
Fri May 30 18:01:49 UTC 2014


On Thu, May 29, 2014 at 06:41:17PM -0400, Joshua Judson Rosen wrote:
> But why is ls able to match the files when rm is not able to remove them?

I have no idea. Have you tried running them under strace and seeing
where the failure occurs?

> Is it perhaps because ls is not actually doing any operations on the files
> themselves (not even a stat?), and just reporting the dirent->d_name strings
> that it got from readdir()? In which case "ls -l *" would fail on the same
> files even when "ls *" doesn't?

I doubt it.

> Or is there something deeper whereby stat() succeeds but unlink() fails?

I'm guessing it's a failure at in the userspace code for rm, not the
syscall. Again strace could help you confirm this and possibly
determine where rm's idea of the filename is getting corrupted.

Rich


More information about the busybox mailing list