guix/nix
aszlig 0fed5fde65 libutil: Improve errmsg on readLink size mismatch.
A message like "error: reading symbolic link `...' : Success" really is
quite confusing, so let's not indicate "success" but rather point out
the real issue.

We could also limit the check of this to just check for non-negative
values, but this would introduce a race condition between stat() and
readlink() if the link target changes between those two calls, thus
leading to a buffer overflow vulnerability.

Reported by @Ericson2314 on IRC. Happened due to a possible ntfs-3g bug
where a relative symlink returned the absolute path (st_)size in stat()
while readlink() returned the relative size.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Tested-by: John Ericson <Ericson2314@Yahoo.com>
2015-06-03 18:19:32 +02:00
..
boost Keep only libstore, nix-daemon, and related stuff. 2014-12-17 22:57:04 +01:00
libstore Pedantry 2015-06-03 18:16:31 +02:00
libutil libutil: Improve errmsg on readLink size mismatch. 2015-06-03 18:19:32 +02:00
nix-daemon Silence some warnings on GCC 4.9 2015-06-03 18:14:48 +02:00
AUTHORS nix: Adjust code for Guix. 2014-12-17 22:57:33 +01:00
COPYING nix: Adjust code for Guix. 2014-12-17 22:57:33 +01:00