From 1abdbe64a33eaefe24708e8c020a3ca2bba0c6c0 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Tue, 24 Jun 2008 15:24:01 +0000 Subject: Add '-F' option to specify the ssh config file --- ChangeLog | 5 +++++ sshfs.1 | 3 +++ sshfs.c | 9 +++++++++ 3 files changed, 17 insertions(+) diff --git a/ChangeLog b/ChangeLog index 0d89652..5fc2f13 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-06-24 Miklos Szeredi + + * Add '-F' option to specify the ssh config file. Patch by Pat + Pascal. + 2008-05-06 Miklos Szeredi * Fix bug in caching which could cause file corruption for append diff --git a/sshfs.1 b/sshfs.1 index f1d6b5e..5a0ea54 100644 --- a/sshfs.1 +++ b/sshfs.1 @@ -37,6 +37,9 @@ equivalent to '\-o port=PORT' \fB\-C\fR equivalent to '\-o compression=yes' .TP +\fB\-F\fR ssh_configfile +specifies alternative ssh configuration file +.TP \fB\-1\fR equivalent to '\-o ssh_protocol=1' .TP diff --git a/sshfs.c b/sshfs.c index 6f5c256..1d59a0f 100644 --- a/sshfs.c +++ b/sshfs.c @@ -288,6 +288,7 @@ enum { KEY_HELP, KEY_VERSION, KEY_FOREGROUND, + KEY_CONFIGFILE, }; #define SSHFS_OPT(t, p, v) { t, offsetof(struct sshfs, p), v } @@ -321,6 +322,7 @@ static struct fuse_opt sshfs_opts[] = { FUSE_OPT_KEY("debug", KEY_FOREGROUND), FUSE_OPT_KEY("-d", KEY_FOREGROUND), FUSE_OPT_KEY("-f", KEY_FOREGROUND), + FUSE_OPT_KEY("-F ", KEY_CONFIGFILE), FUSE_OPT_END }; @@ -2834,6 +2836,7 @@ static void usage(const char *progname) "SSHFS options:\n" " -p PORT equivalent to '-o port=PORT'\n" " -C equivalent to '-o compression=yes'\n" +" -F ssh_configfile specifies alternative ssh configuration file\n" " -1 equivalent to '-o ssh_protocol=1'\n" " -o reconnect reconnect to server\n" " -o sshfs_sync synchronous writes\n" @@ -2924,6 +2927,12 @@ static int sshfs_opt_proc(void *data, const char *arg, int key, ssh_add_arg("-oCompression=yes"); return 0; + case KEY_CONFIGFILE: + tmp = g_strdup_printf("-F%s", arg + 2); + ssh_add_arg(tmp); + g_free(tmp); + return 0; + case KEY_HELP: usage(outargs->argv[0]); fuse_opt_add_arg(outargs, "-ho"); -- cgit v1.2.3