summaryrefslogtreecommitdiff
path: root/sbin/mount_nfs
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2003-07-03 22:41:41 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2003-07-03 22:41:41 +0000
commit68c4ff61328d01e604a97f41a255784b3ba007b2 (patch)
tree7424873456d7982920c124a4f0a56cb7140ca8c8 /sbin/mount_nfs
parentf231113e2426ef83d1f4662298c597f2d2719ed5 (diff)
use realpath() in helpers instead of doing it ourselves every time.
also fixes pr1662. from otto moerbeek
Diffstat (limited to 'sbin/mount_nfs')
-rw-r--r--sbin/mount_nfs/mount_nfs.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sbin/mount_nfs/mount_nfs.c b/sbin/mount_nfs/mount_nfs.c
index 89b87b2ccdb..4ae18bb626a 100644
--- a/sbin/mount_nfs/mount_nfs.c
+++ b/sbin/mount_nfs/mount_nfs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mount_nfs.c,v 1.32 2003/06/11 06:22:14 deraadt Exp $ */
+/* $OpenBSD: mount_nfs.c,v 1.33 2003/07/03 22:41:40 tedu Exp $ */
/* $NetBSD: mount_nfs.c,v 1.12.4.1 1996/05/25 22:48:05 fvdl Exp $ */
/*
@@ -180,7 +180,7 @@ main(int argc, char *argv[])
struct nfs_args *nfsargsp;
struct nfs_args nfsargs;
int mntflags, altflags, num;
- char *name, *p, *spec;
+ char name[MAXPATHLEN], *p, *spec;
retrycnt = DEF_RETRY;
@@ -368,7 +368,8 @@ main(int argc, char *argv[])
usage();
spec = *argv++;
- name = *argv;
+ if (realpath(*argv, name) == NULL)
+ err(1, "realpath %s", name);
if (!getnfsargs(spec, nfsargsp))
exit(1);