diff options
author | 2013-10-08 03:10:36 +0000 | |
---|---|---|
committer | 2013-10-08 03:10:36 +0000 | |
commit | 0cc9193b84add9eaaab3f617db4ca3d88960b414 (patch) | |
tree | a6fd355cae4291ba5440501723ce14fc116811b5 | |
parent | Obtain the uptime of the running system using the new CLOCK_UPTIME, (diff) | |
download | wireguard-openbsd-0cc9193b84add9eaaab3f617db4ca3d88960b414.tar.xz wireguard-openbsd-0cc9193b84add9eaaab3f617db4ca3d88960b414.zip |
POSIX specifies that when the pax input file requests a hardlink
to a symlinks, that it be exactly that and not a hardlink to the
file pointed to by the symlink. Use linkat() to get what we want.
ok deraadt@
-rw-r--r-- | bin/pax/file_subs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/pax/file_subs.c b/bin/pax/file_subs.c index 2b29646943c..43ac002ba1d 100644 --- a/bin/pax/file_subs.c +++ b/bin/pax/file_subs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: file_subs.c,v 1.33 2013/04/16 18:06:35 millert Exp $ */ +/* $OpenBSD: file_subs.c,v 1.34 2013/10/08 03:10:36 guenther Exp $ */ /* $NetBSD: file_subs.c,v 1.4 1995/03/21 09:07:18 cgd Exp $ */ /*- @@ -307,7 +307,7 @@ mk_link(char *to, struct stat *to_sb, char *from, int ign) * try again) */ for (;;) { - if (link(to, from) == 0) + if (linkat(AT_FDCWD, to, AT_FDCWD, from, 0) == 0) break; oerrno = errno; if (!nodirs && chk_path(from, to_sb->st_uid, to_sb->st_gid) == 0) |