bug-gnulib
[Top][All Lists]
Advanced

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

Re: xreadlink.c initial buffer size guesstimate


From: Eric Blake
Subject: Re: xreadlink.c initial buffer size guesstimate
Date: Fri, 12 Jan 2007 08:30:24 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.9) Gecko/20061207 Thunderbird/1.5.0.9 Mnenhy/0.7.4.666

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

According to Liyang HU on 1/11/2007 6:29 PM:
> 
> [0] I know, lstat() should report the on-disk usage of the symlink; however
> I thought of more nefarious uses for st_size. Consider my FS braindead if
> you will, but xreadlink() needn't fail...

Sorry - if your FS violates POSIX, then why should you expect sane
behavior from tools that assume POSIX?  POSIX gives you permission to use
a number of fields in struct stat for your own purposes on symlinks, but
not st_size.  By violating that rule of POSIX, the bug is squarely on your
FS's shoulders, and you are fighting an uphill battle because it will be
more than ls that are affected.  I would recommend fixing your FS instead.

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

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

iD8DBQFFp6mQ84KuGfSFAYARAiAYAKC7siTLvdaqAjdWsGxwzqpmEIUQuACaA8U7
wXvhoBWGFYXzx6zhl5oPVEA=
=dcvl
-----END PGP SIGNATURE-----




reply via email to

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