Add a -F option to allow passing a configuration file to ssh(1), instead

of having to use multiple -O options on the command line.  OKed by pooka@.
This commit is contained in:
jmmv 2007-12-14 10:56:22 +00:00
parent 07b65a160e
commit d96be1e18a
2 changed files with 20 additions and 6 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: mount_psshfs.8,v 1.15 2007/12/03 18:14:48 wiz Exp $
.\" $NetBSD: mount_psshfs.8,v 1.16 2007/12/14 10:56:22 jmmv Exp $
.\"
.\" Copyright (c) 2007 Antti Kantee. All rights reserved.
.\"
@ -23,7 +23,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd November 8, 2007
.Dd December 14, 2007
.Dt MOUNT_PSSHFS 8
.Os
.Sh NAME
@ -66,6 +66,15 @@ Files are valid only for the time that
.Nm
is running and in the event of e.g. a server crash, all client retries
to access files will fail.
.It Fl F Ar configfile
Pass a configuration file to
.Xr ssh 1 .
This will make it ignore the system-wide
.Pa /etc/ssh/ssh_config
configuration file and use
.Pa configfile
instead of
.Pa ~/.ssh/config .
.It Fl o Ar [no]option
This flag can be used to give standard mount options and options
to puffs.

View File

@ -1,4 +1,4 @@
/* $NetBSD: psshfs.c,v 1.46 2007/11/30 16:24:04 pooka Exp $ */
/* $NetBSD: psshfs.c,v 1.47 2007/12/14 10:56:22 jmmv Exp $ */
/*
* Copyright (c) 2006 Antti Kantee. All Rights Reserved.
@ -41,7 +41,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: psshfs.c,v 1.46 2007/11/30 16:24:04 pooka Exp $");
__RCSID("$NetBSD: psshfs.c,v 1.47 2007/12/14 10:56:22 jmmv Exp $");
#endif /* !lint */
#include <sys/types.h>
@ -86,7 +86,8 @@ usage()
{
fprintf(stderr, "usage: %s "
"[-es] [-O sshopt=value] [-o opts] user@host:path mountpath\n",
"[-es] [-F configfile] [-O sshopt=value] [-o opts] "
"user@host:path mountpath\n",
getprogname());
exit(1);
}
@ -126,11 +127,15 @@ main(int argc, char *argv[])
add_ssharg(&sshargs, &nargs, "-axs");
add_ssharg(&sshargs, &nargs, "-oClearAllForwardings=yes");
while ((ch = getopt(argc, argv, "eo:O:r:st:")) != -1) {
while ((ch = getopt(argc, argv, "eF:o:O:r:st:")) != -1) {
switch (ch) {
case 'e':
exportfs = 1;
break;
case 'F':
add_ssharg(&sshargs, &nargs, "-F");
add_ssharg(&sshargs, &nargs, optarg);
break;
case 'O':
add_ssharg(&sshargs, &nargs, "-o");
add_ssharg(&sshargs, &nargs, optarg);