From eaf31838f16b510a811cbac2bd9b9bcb0c19faf2 Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Tue, 29 May 2012 20:01:33 +0000 Subject: 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@ --- sbin/mount/mount.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'sbin/mount') 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)) -- cgit v1.2.3