bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rename() making ext2fs going bonkers?


From: Eric Blake
Subject: Re: rename() making ext2fs going bonkers?
Date: Tue, 06 Oct 2009 18:40:27 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Samuel Thibault on 10/6/2009 6:12 PM:
> rename("dir2", "dir/.");
> 
> with dir/ existing, which is hanging
> 
> The obvious issue is that rename_dir is passed "." as toname and not the
> actual directory name, but since that's what the RPC asked, we have to
> cope with, but we don't and try to lock toname twice.  Since POSIX says
> “[EINVAL] ^[CX] The old pathname names an ancestor directory of the
> new pathname, or either pathname argument contains a final component
> that is dot or dot-dot.”, we could just refuse "." and ".." from
> diskfs_S_dir_rename with EINVAL?

Yes, that would be the proper fix - flat out refuse any argument with "."
or ".." as an explicit last component (whether or not there are trailing
"/" after the dot).  And in the meantime, that's how gnulib will work
around the problem, provided I can find a way to write an m4 test that
won't hang but will still expose the bug.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkrL43sACgkQ84KuGfSFAYBFrACfbhBftf0QoY3BjnphhUVuahyg
MgIAoM6Xb/UEjc81GrUdKFmMUUihQfHM
=qcz5
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]