Compare commits

...

21 Commits

Author SHA1 Message Date
Miklos Szeredi 857d634e09 Released 2.4 2012-03-08 10:36:10 +01:00
Mike Kelly 4dc10686e0 make sure idmap files aren't writable by others
otherwise, other local users could change the mapping, and gain access
to things they shouldn't
2012-03-08 10:34:39 +01:00
Chris Wolfe b3af91b123 Add slave option to run sftp over stdin and stdout
Add -o slave. This option routes the sftp communication over stdin and stdout,
bypassing SSH and network.
2012-02-14 12:55:15 +01:00
Chris Wolfe acb0832ffd Split fd into separate read and write pipes 2012-02-14 12:55:14 +01:00
Miklos Szeredi c5949f06fa fix unused but set variables
cache.c: In function ‘cache_add_attr’:
cache.c:167:9: warning: variable ‘now’ set but not used [-Wunused-but-set-variable]
cache.c: In function ‘cache_add_dir’:
cache.c:188:9: warning: variable ‘now’ set but not used [-Wunused-but-set-variable]
cache.c: In function ‘cache_add_link’:
cache.c:212:9: warning: variable ‘now’ set but not used [-Wunused-but-set-variable]
2012-02-08 10:21:33 +01:00
Chris Wolfe b0f3d73028 Remove some trailing whitespace.
Verified with `cat -vet` and `grep '\s$'`
2012-02-08 10:15:52 +01:00
Mike Kelly 75bfa9a6c0 skip blank lines 2011-12-21 10:05:08 +01:00
Mike Kelly e8e26c0bc1 increase portability
getline() isn't widely available yet, use fgets() instead
2011-12-21 10:05:08 +01:00
Mike Kelly cfcae008e3 fix typo in error message 2011-12-21 10:05:08 +01:00
Mike Kelly 7ca565d80d default to erroring if we can't remap a uid/gid
add a '-o nomap=ignore|error' option, which defaults to 'error'
2011-12-21 10:05:08 +01:00
Mike Kelly 301cc5218b Add -o idmap=file, -o uidmap=FILE, -o gidmap=FILE
These options allow you to create a pair of local files, with
username:uid/groupname:gid pairs, one per line. Alternatively, files can
be in standard /etc/passwd / /etc/group format.

The uid/gids are for the remote server, their local counterparts are
looked up with a local getpwnam/getgrnam call. Any stat() calls will
show with the remapped local uid/gid, and any chown() calls will be
remapped back to the remote uid/gid.
2011-12-20 15:33:58 +01:00
Mike Kelly d666318c7a Fix a possible small memory leak 2011-12-20 15:33:58 +01:00
Mike Kelly ea0d68651e Fix typo in error message
s/FD_CLOESEC/FD_CLOEXEC/
2011-12-20 15:33:58 +01:00
Miklos Szeredi 2f6665d84e Fix error handling in sshfs_read_end
Reported by Mike Kelly
2011-12-20 14:55:45 +01:00
Miklos Szeredi 2ce4069832 Make chown respect the UID mapping policy
Reported and tested by Vivenzio Pagliari
2011-12-05 13:11:09 +01:00
Miklos Szeredi 97228b866a Submit max 32k reads and writes to the sftp server
Also don't limit the kernel to 64k reads and writes, rather split into
32k sized chunks and send them to the server all at once.  This is
more efficient and less demanding from the server.

Reported by Ludovic Courtès.  Fix suggested by Niels Möller
2011-11-16 14:54:37 +01:00
Miklos Szeredi f3286cdf86 Add locking around modifver and connver 2011-11-14 16:28:13 +01:00
Miklos Szeredi 955751ad36 Fix double free if reconnection races with request sending
Patch by E. Kuemmerle
2011-11-14 15:12:52 +01:00
Miklos Szeredi b5f0c128f5 Remove "-oPreferredAuthentications" from ssh options
Remove "-oPreferredAuthentications" from ssh options if the
"password_stdin" option is used.  Reported by E. Kuemmerle
2011-10-21 17:12:31 +02:00
Miklos Szeredi 77d57a4a5d Add "FIXME: really needs LSETSTAT extension (debian Bug#640038)" 2011-09-23 14:33:32 +02:00
Percy Jahn 19cb995c23 sshfs: fstat workaround
Add "-oworkaround=fstat" for SFTP servers which don't support
the FSTAT message.
2011-08-24 13:22:36 +02:00
5 changed files with 730 additions and 175 deletions
+52
View File
@@ -1,3 +1,55 @@
2012-03-08 Miklos Szeredi <miklos@szeredi.hu>
* Released 2.4
2012-03-08 Miklos Szeredi <miklos@szeredi.hu>
* Make sure idmap files aren't writable by others otherwise, other
local users could change the mapping, and gain access to things
they shouldn't. Patch by Mike Kelly
2012-02-08 Chris Wolfe <cwolfe@chromium.org>
* Add -o slave. This option routes the sftp communication over stdin
and stdout, bypassing SSH and network.
2011-12-16 Mike Kelly <mike@pair.com>
* Add -o idmap=file, -o uidmap=FILE, -o gidmap=FILE. These options
allow you to create a pair of local files, similar to /etc/passwd or
/etc/group files from the remote server, and use those to remap all
the given UIDs/GIDs.
2011-11-25 Miklos Szeredi <miklos@szeredi.hu>
* Make chown respect the UID mapping policy. Reported and tested
by Vivenzio Pagliari
2011-11-16 Miklos Szeredi <miklos@szeredi.hu>
* Submit max 32k reads and writes to the sftp server. Also don't
limit the kernel to 64k reads and writes, rather split into 32k
sized chunks and send them to the server all at once. This is
more efficient and less demanding from the server. Reported by
Ludovic Courtès. Fix suggested by Niels Möller
2011-11-14 Miklos Szeredi <miklos@szeredi.hu>
* Fix double free if reconnection races with request sending.
Patch by E. Kuemmerle
* Add locking around modifver and connver
2011-10-21 Miklos Szeredi <miklos@szeredi.hu>
* Remove "-oPreferredAuthentications" from ssh options if the
"password_stdin" option is used. Reported by E. Kuemmerle
2011-08-24 Miklos Szeredi <miklos@szeredi.hu>
* Add "-oworkaround=fstat" for SFTP servers which don't support
the FSTAT message. Patch by: Percy Jahn
2011-07-01 Miklos Szeredi <miklos@szeredi.hu>
* Released 2.3
-6
View File
@@ -164,7 +164,6 @@ static struct node *cache_get(const char *path)
void cache_add_attr(const char *path, const struct stat *stbuf, uint64_t wrctr)
{
struct node *node;
time_t now;
if (!cache.on)
return;
@@ -172,7 +171,6 @@ void cache_add_attr(const char *path, const struct stat *stbuf, uint64_t wrctr)
pthread_mutex_lock(&cache.lock);
if (wrctr == cache.write_ctr) {
node = cache_get(path);
now = time(NULL);
node->stat = *stbuf;
node->stat_valid = time(NULL) + cache.stat_timeout;
if (node->stat_valid > node->valid)
@@ -185,11 +183,9 @@ void cache_add_attr(const char *path, const struct stat *stbuf, uint64_t wrctr)
static void cache_add_dir(const char *path, char **dir)
{
struct node *node;
time_t now;
pthread_mutex_lock(&cache.lock);
node = cache_get(path);
now = time(NULL);
g_strfreev(node->dir);
node->dir = dir;
node->dir_valid = time(NULL) + cache.dir_timeout;
@@ -209,11 +205,9 @@ static size_t my_strnlen(const char *s, size_t maxsize)
static void cache_add_link(const char *path, const char *link, size_t size)
{
struct node *node;
time_t now;
pthread_mutex_lock(&cache.lock);
node = cache_get(path);
now = time(NULL);
g_free(node->link);
node->link = g_strndup(link, my_strnlen(link, size-1));
node->link_valid = time(NULL) + cache.link_timeout;
+1 -1
View File
@@ -1,4 +1,4 @@
AC_INIT(sshfs-fuse, 2.3)
AC_INIT(sshfs-fuse, 2.4)
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER(config.h)
+28 -3
View File
@@ -102,6 +102,29 @@ no translation of the ID space (default)
.TP
user
only translate UID of connecting user
.TP
file
translate UIDs/GIDs based upon the contents of \fBuidfile \fR and
\fBgidfile\fR
.RE
.TP
\fB\-o\fR uidfile=FILE
file containing username:uid mappings for \fBidmap=file\fR
.RE
.TP
\fB\-o\fR gidfile=FILE
file containing groupname:gid mappings for \fBidmap=file\fR
.RE
.TP
\fB\-o\fR nomap=TYPE
with idmap=file, how to handle missing mappings
.RS 8
.TP
ignore
don't do any re-mapping
.TP
error
return an error (default)
.RE
.TP
\fB\-o\fR ssh_command=CMD
@@ -115,6 +138,8 @@ path to sftp server or subsystem (default: sftp)
.TP
\fB\-o\fR directport=PORT
directly connect to PORT bypassing ssh
\fB\-o\fR slave
communicate over stdin and stdout bypassing network
.TP
\fB\-o\fR transform_symlinks
transform absolute symlinks to relative
@@ -150,7 +175,7 @@ allow access to root
\fB\-o\fR nonempty
allow mounts over non\-empty file/dir
.HP
\fB\-o\fR default_permissions
\fB\-o\fR default_permissions
enable permission checking by kernel
.TP
\fB\-o\fR fsname=NAME
@@ -225,7 +250,7 @@ perform reads asynchronously (default)
\fB\-o\fR sync_read
perform reads synchronously
.SS "Module options:"
.TP
.TP
[subdir]
.TP
\fB\-o\fR subdir=DIR
@@ -233,7 +258,7 @@ prepend this directory to all paths (mandatory)
.TP
\fB\-o\fR [no]rellinksa
transform absolute symlinks to relative
.TP
.TP
[iconv]
.TP
\fB\-o\fR from_code=CHARSET
+649 -165
View File
File diff suppressed because it is too large Load Diff