changeset 889:270e5aab9998

Fix xabspath when last path component exists but we haven't got permissions to open it (ala readlink -f /dev/sda as a normal user). Spotted by Ashwini Sharma.
author Rob Landley <rob@landley.net>
date Mon, 29 Apr 2013 12:30:28 -0500
parents c5e80c74ec6c
children c7e7b159568d
files lib/lib.c
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lib/lib.c	Mon Apr 29 10:53:09 2013 -0500
+++ b/lib/lib.c	Mon Apr 29 12:30:28 2013 -0500
@@ -393,6 +393,7 @@
         if ((exact || todo) && errno != EINVAL) goto error;
         new->next = done;
         done = new;
+        if (errno == EINVAL && !todo) break;
         s = new->str;
       }
       fd = openat(dirfd, s, 0);