diff options
author | Rob Landley <rob@landley.net> | 2013-04-29 12:30:28 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2013-04-29 12:30:28 -0500 |
commit | acede57b4fd2d9d7f5cb576bdf12cf8586cef44a (patch) | |
tree | c3a99c7724c88594bc80f2d9282a58a1527f8714 | |
parent | 7a1f582a04f165db489de0648ff31b6b6ace2efd (diff) | |
download | toybox-acede57b4fd2d9d7f5cb576bdf12cf8586cef44a.tar.gz |
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.
-rw-r--r-- | lib/lib.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -393,6 +393,7 @@ char *xabspath(char *path, int exact) 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); |