diff options
author | Emilio Pozuelo Monfort <pochu27@gmail.com> | 2010-06-02 10:24:59 -0700 |
---|---|---|
committer | Roland McGrath <roland@redhat.com> | 2010-06-02 10:25:56 -0700 |
commit | 2a50c07836d2750baf70442f8f760bf6cd43b3af (patch) | |
tree | 264e42647d2bdbb9ff059ef92cea24f8dd77b42b /hurd/lookup-at.c | |
parent | eb5ad2eb0d06326846ed37addebe187a0f67c7c7 (diff) | |
download | glibc-2a50c07836d2750baf70442f8f760bf6cd43b3af.tar glibc-2a50c07836d2750baf70442f8f760bf6cd43b3af.tar.gz glibc-2a50c07836d2750baf70442f8f760bf6cd43b3af.tar.bz2 glibc-2a50c07836d2750baf70442f8f760bf6cd43b3af.zip |
Hurd: Fix linkat symlink handling.
Diffstat (limited to 'hurd/lookup-at.c')
-rw-r--r-- | hurd/lookup-at.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/hurd/lookup-at.c b/hurd/lookup-at.c index 7f55527d8b..728a970909 100644 --- a/hurd/lookup-at.c +++ b/hurd/lookup-at.c @@ -30,8 +30,14 @@ __file_name_lookup_at (int fd, int at_flags, error_t err; file_t result; + if ((at_flags & AT_SYMLINK_FOLLOW) && (at_flags & AT_SYMLINK_NOFOLLOW)) + return (__hurd_fail (EINVAL), MACH_PORT_NULL); + flags |= (at_flags & AT_SYMLINK_NOFOLLOW) ? O_NOLINK : 0; at_flags &= ~AT_SYMLINK_NOFOLLOW; + if (at_flags & AT_SYMLINK_FOLLOW) + flags &= ~O_NOLINK; + at_flags &= ~AT_SYMLINK_FOLLOW; if (at_flags != 0) return (__hurd_fail (EINVAL), MACH_PORT_NULL); |