Skip to content

Commit

Permalink
Add '-F' option to specify the ssh config file
Browse files Browse the repository at this point in the history
  • Loading branch information
szmi committed Jun 24, 2008
1 parent 4b28b15 commit 1abdbe6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2008-06-24 Miklos Szeredi <miklos@szeredi.hu>

* Add '-F' option to specify the ssh config file. Patch by Pat
Pascal.

2008-05-06 Miklos Szeredi <miklos@szeredi.hu>

* Fix bug in caching which could cause file corruption for append
Expand Down
3 changes: 3 additions & 0 deletions sshfs.1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions sshfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down Expand Up @@ -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
};

Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit 1abdbe6

Please sign in to comment.