From 098bf9567060b7378935c4ab2b3590eb8e33a01b Mon Sep 17 00:00:00 2001 From: tnn Date: Wed, 9 May 2007 20:25:20 +0000 Subject: [PATCH] Change [-O sshopt value] to [-O sshopt=value] to better conform with the way other userland apps behave. In /etc/fstab one would specify options with -O=sshopt=value. --- usr.sbin/puffs/mount_psshfs/mount_psshfs.8 | 6 +++--- usr.sbin/puffs/mount_psshfs/psshfs.c | 16 +++++----------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/usr.sbin/puffs/mount_psshfs/mount_psshfs.8 b/usr.sbin/puffs/mount_psshfs/mount_psshfs.8 index ac568c4f6190..702cce414b53 100644 --- a/usr.sbin/puffs/mount_psshfs/mount_psshfs.8 +++ b/usr.sbin/puffs/mount_psshfs/mount_psshfs.8 @@ -1,4 +1,4 @@ -.\" $NetBSD: mount_psshfs.8,v 1.6 2007/05/09 19:54:39 tnn Exp $ +.\" $NetBSD: mount_psshfs.8,v 1.7 2007/05/09 20:25:20 tnn Exp $ .\" .\" Copyright (c) 2007 Antti Kantee. All rights reserved. .\" @@ -74,10 +74,10 @@ The most notable of these is which disables the name cache and page cache for the file system. It slows operations down, but will behave better when multiple entities are accessing the same directory tree via various routes. -.It Fl O Ar sshopt value +.It Fl O Ar sshopt=value Pass an option to .Xr ssh 1 , for example -.Fl O Ar Port 22 . +.Fl O Ar Port=22 . For a list of valid options, see .Xr ssh_config 5 . .It Fl s diff --git a/usr.sbin/puffs/mount_psshfs/psshfs.c b/usr.sbin/puffs/mount_psshfs/psshfs.c index efde795d95e2..468e46993fe2 100644 --- a/usr.sbin/puffs/mount_psshfs/psshfs.c +++ b/usr.sbin/puffs/mount_psshfs/psshfs.c @@ -1,4 +1,4 @@ -/* $NetBSD: psshfs.c,v 1.21 2007/05/09 19:54:39 tnn Exp $ */ +/* $NetBSD: psshfs.c,v 1.22 2007/05/09 20:25:20 tnn Exp $ */ /* * Copyright (c) 2006 Antti Kantee. All Rights Reserved. @@ -44,7 +44,7 @@ #include #ifndef lint -__RCSID("$NetBSD: psshfs.c,v 1.21 2007/05/09 19:54:39 tnn Exp $"); +__RCSID("$NetBSD: psshfs.c,v 1.22 2007/05/09 20:25:20 tnn Exp $"); #endif /* !lint */ #include @@ -84,7 +84,7 @@ usage() { errx(1, "usage: %s " - "[-es] [-O sshopt value] [-o opts] user@host:path mountpath", + "[-es] [-O sshopt=value] [-o opts] user@host:path mountpath", getprogname()); } @@ -96,7 +96,6 @@ main(int argc, char *argv[]) struct puffs_ops *pops; mntoptparse_t mp; char **sshargs; - char *arg; char *userhost; char *hostpath; int mntflags, pflags, ch; @@ -121,13 +120,8 @@ main(int argc, char *argv[]) exportfs = 1; break; case 'O': - if (optind == argc) - usage(); - if (asprintf(&arg, "-o%s=%s", optarg, - argv[optind]) == -1) - err(1, "asprintf"); - add_ssharg(&sshargs, &nargs, arg); - optind++; + add_ssharg(&sshargs, &nargs, "-o"); + add_ssharg(&sshargs, &nargs, optarg); break; case 'o': mp = getmntopts(optarg, puffsmopts, &mntflags, &pflags);