summary refs log tree commit diff
path: root/nix/libstore
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2015-01-02 03:27:39 +0100
committerLudovic Courtès <ludo@gnu.org>2015-06-03 18:19:32 +0200
commit0fed5fde65e4a0cd600dc181e5b3c42d1147df51 (patch)
treef7abfc9654bd47a416e3b61c4ef1965d155cfe6c /nix/libstore
parent7dfd3f5c8f1fd1e47a737fdb3be9255000862ddb (diff)
downloadguix-0fed5fde65e4a0cd600dc181e5b3c42d1147df51.tar.gz
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>
Diffstat (limited to 'nix/libstore')
0 files changed, 0 insertions, 0 deletions