summaryrefslogtreecommitdiffstats
path: root/bin/ln
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2015-01-16 06:39:28 +0000
committerderaadt <deraadt@openbsd.org>2015-01-16 06:39:28 +0000
commitb9fc9a728fce9c4289b7e9a992665e28d5629a54 (patch)
tree72b2433e418dfa1aef5fcf8305617b97979a25d8 /bin/ln
parentimprove checksum parsing slightly. now handles filenames with spaces. (diff)
downloadwireguard-openbsd-b9fc9a728fce9c4289b7e9a992665e28d5629a54.tar.xz
wireguard-openbsd-b9fc9a728fce9c4289b7e9a992665e28d5629a54.zip
Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
Diffstat (limited to 'bin/ln')
-rw-r--r--bin/ln/ln.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/ln/ln.c b/bin/ln/ln.c
index 8d86167cbef..653875cc84a 100644
--- a/bin/ln/ln.c
+++ b/bin/ln/ln.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ln.c,v 1.21 2014/05/23 04:38:57 guenther Exp $ */
+/* $OpenBSD: ln.c,v 1.22 2015/01/16 06:39:32 deraadt Exp $ */
/* $NetBSD: ln.c,v 1.10 1995/03/21 09:06:10 cgd Exp $ */
/*
@@ -30,7 +30,7 @@
* SUCH DAMAGE.
*/
-#include <sys/param.h>
+#include <sys/types.h>
#include <sys/stat.h>
#include <err.h>
@@ -41,6 +41,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
int fflag; /* Unlink existing files. */
int hflag; /* Check new name for symlink first. */
@@ -112,7 +113,7 @@ int
linkit(char *target, char *source, int isdir)
{
struct stat sb;
- char *p, path[MAXPATHLEN];
+ char *p, path[PATH_MAX];
int (*statf)(const char *, struct stat *);
int exists, n;