summaryrefslogtreecommitdiff
path: root/sbin/mount
diff options
context:
space:
mode:
authorLandry Breuil <landry@cvs.openbsd.org>2012-05-29 20:01:33 +0000
committerLandry Breuil <landry@cvs.openbsd.org>2012-05-29 20:01:33 +0000
commiteaf31838f16b510a811cbac2bd9b9bcb0c19faf2 (patch)
treec937946ee97e436d15e743a2304551c0a9465927 /sbin/mount
parentb759790f188506d35195230d5f04f36182504242 (diff)
Make 'mount nfssrv:/path' without mount point work again :
- dont error out in realpath() check if argv contains @ or : (ie, is a nfs remote path) - relax getfsspec() call so that it succeeds for nfs remote paths too, not only for duid devices. Now we behave like Linux & FreeBSD (at least).. Prompted by a diff from giovanni@ for xfce4-mount ok jsing@ krw@
Diffstat (limited to 'sbin/mount')
-rw-r--r--sbin/mount/mount.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c
index bbf302157df..d612f5da380 100644
--- a/sbin/mount/mount.c
+++ b/sbin/mount/mount.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mount.c,v 1.52 2011/04/12 14:51:40 jsing Exp $ */
+/* $OpenBSD: mount.c,v 1.53 2012/05/29 20:01:32 landry Exp $ */
/* $NetBSD: mount.c,v 1.24 1995/11/18 03:34:29 cgd Exp $ */
/*
@@ -201,7 +201,7 @@ main(int argc, char * const argv[])
if (typelist != NULL)
usage();
- if (realpath(*argv, mntpath) == NULL)
+ if (realpath(*argv, mntpath) == NULL && strpbrk(argv[0], ":@") == NULL)
err(1, "realpath %s", *argv);
if (hasopt(options, "update")) {
if ((mntbuf = getmntpt(mntpath)) == NULL)
@@ -233,8 +233,7 @@ main(int argc, char * const argv[])
} else {
if ((fs = getfsfile(mntpath)) == NULL &&
(fs = getfsspec(mntpath)) == NULL &&
- (isduid(*argv, 0) == 0 ||
- (fs = getfsspec(*argv)) == NULL))
+ (fs = getfsspec(*argv)) == NULL)
errx(1, "can't find fstab entry for %s.",
*argv);
if (BADTYPE(fs->fs_type))