about summary refs log tree commit diff
path: root/sysdeps/mach
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <pochu27@gmail.com>2010-06-02 10:24:59 -0700
committerPetr Baudis <pasky@suse.cz>2010-11-09 01:36:03 +0100
commit9ca2c3cc19959d0f37389e1bcb0b67bf93cb9768 (patch)
tree5a3662adf3bafbd6237d1306d3bb762d5f200420 /sysdeps/mach
parent827face44bf189f562225339d015a3b4b5cad023 (diff)
downloadglibc-9ca2c3cc19959d0f37389e1bcb0b67bf93cb9768.tar.gz
glibc-9ca2c3cc19959d0f37389e1bcb0b67bf93cb9768.tar.xz
glibc-9ca2c3cc19959d0f37389e1bcb0b67bf93cb9768.zip
Hurd: Fix linkat symlink handling.
(cherry picked from commit 2a50c07836d2750baf70442f8f760bf6cd43b3af)
Diffstat (limited to 'sysdeps/mach')
-rw-r--r--sysdeps/mach/hurd/linkat.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sysdeps/mach/hurd/linkat.c b/sysdeps/mach/hurd/linkat.c
index 1942144e0f..062d913e3d 100644
--- a/sysdeps/mach/hurd/linkat.c
+++ b/sysdeps/mach/hurd/linkat.c
@@ -1,5 +1,5 @@
 /* Make a link between file names relative to open directories.  Hurd version.
-   Copyright (C) 2006 Free Software Foundation, Inc.
+   Copyright (C) 2006,2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -38,7 +38,9 @@ linkat (fromfd, from, tofd, to, flags)
   file_t oldfile, linknode, todir;
   char *toname;
 
-  oldfile = __file_name_lookup_at (fromfd, flags, from, 0, 0);
+  /* POSIX says linkat doesn't follow symlinks by default, so pass
+     O_NOLINK.  That can be overridden by AT_SYMLINK_FOLLOW in FLAGS.  */
+  oldfile = __file_name_lookup_at (fromfd, flags, from, O_NOLINK, 0);
   if (oldfile == MACH_PORT_NULL)
     return -1;