Skip to content

Commit

Permalink
fix shellcheck identified issues, spelling and whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
a1346054 committed Aug 17, 2021
1 parent 9700b35 commit 5aa231b
Show file tree
Hide file tree
Showing 15 changed files with 63 additions and 71 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/issue-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ PLEASE READ BEFORE REPORTING AN ISSUE

SSHFS does not have any active, regular contributors or developers. The current maintainer continues to apply pull requests and tries to make regular releases, but unfortunately has no capacity to do any development beyond addressing high-impact issues. When reporting bugs, please understand that unless you are including a pull request or are reporting a critical issue, you will probably not get a response.

To prevent the issue tracker from being flooded with issues that no-one is intending to work on, and to give more visibilty to critical issues that users should be aware of and that most urgently need attention, I will also close most bug reports once they've been inactive for a while.
To prevent the issue tracker from being flooded with issues that no-one is intending to work on, and to give more visibility to critical issues that users should be aware of and that most urgently need attention, I will also close most bug reports once they've been inactive for a while.

Please note that this isn't meant to imply that you haven't found a bug - you most likely have and I'm grateful that you took the time to report it. Unfortunately, SSHFS is a purely volunteer driven project,
and at the moment there simply aren't any volunteers.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ addons:
- libglib2.0-dev
install: test/travis-install.sh
script: test/travis-build.sh

16 changes: 6 additions & 10 deletions ChangeLog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ Release 3.7.2 (2021-06-08)
tried - returning EEXIST if the access was successful.
Fixes: https://github.com/libfuse/sshfs/issues/243


Release 3.7.1 (2020-11-09)
--------------------------

* Minor bugfixes.


Release 3.7.0 (2020-01-03)
--------------------------

Expand All @@ -25,7 +23,6 @@ Release 3.7.0 (2020-01-03)
needed anymore. If you depend on this workaround, please let the SSHFS maintainers know,
otherwise support for the workaround will be removed completely in a future version.


Release 3.6.0 (2019-11-03)
--------------------------

Expand All @@ -38,7 +35,6 @@ Release 3.6.0 (2019-11-03)
* Fixed a number of compiler warnings.
* Improved performance under OS X.


Release 3.5.2 (2019-04-13)
--------------------------

Expand Down Expand Up @@ -108,13 +104,13 @@ Release 3.1.0 (2017-08-04)

* For improved backwards compatibility, SSHFS now also silently
accepts the old ``-o cache_*`` options.

Release 3.0.0 (2017-07-08)
--------------------------

* sshfs now requires libfuse 3.1.0 or newer.
* When supported by the kernel, sshfs now uses writeback caching.
* The `cache` option has been renamed to `dir_cache` for clarity.
* The `cache` option has been renamed to `dir_cache` for clarity.
* Added unit tests
* --debug now behaves like -o debug_sshfs, i.e. it enables sshfs
debugging messages rather than libfuse debugging messages.
Expand All @@ -129,7 +125,7 @@ Release 3.0.0 (2017-07-08)
* Removed support for `-o workaround=all`. Workarounds should always
enabled explicitly and only when needed. There is no point in always
enabling a potentially changing set of workarounds.

Release 2.9 (2017-04-17)
------------------------

Expand Down Expand Up @@ -168,14 +164,14 @@ Release 2.4 (2012-03-08)
------------------------

* New `slave` option.
* New `idmap`, `uidmap` and `gidmap` options.
* New `idmap`, `uidmap` and `gidmap` options.
* Various small bugfixes.

Release 2.3 (2011-07-01)
------------------------

* Support hard link creation if server is OpenSSH 5.7 or later
* Small improvements and bug fixes
* Small improvements and bug fixes
* Check mount point and options before connecting to ssh server
* New 'delay_connect' option

Expand All @@ -188,7 +184,7 @@ Release 2.2 (2008-10-20)
Release 2.1 (2008-07-11)
------------------------

* Small improvements and bug fixes
* Small improvements and bug fixes

Release 2.0 (2008-04-23)
------------------------
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Normally, the default build options will work fine. If you
nevertheless want to adjust them, you can do so with the *mesonconf*
command::

$ mesonconf # list options
$ mesonconf # list options
$ mesonconf -D strip=true # set an option

To build, test and install SSHFS, you then use Ninja (running the
Expand Down
13 changes: 6 additions & 7 deletions cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ static void *cache_init(struct fuse_conn_info *conn,
{
void *res;
res = cache.next_oper->init(conn, cfg);

// Cache requires a path for each request
cfg->nullpath_ok = 0;

Expand Down Expand Up @@ -300,7 +300,6 @@ static int cache_readlink(const char *path, char *buf, size_t size)
return err;
}


static int cache_opendir(const char *path, struct fuse_file_info *fi)
{
(void) path;
Expand All @@ -318,9 +317,9 @@ static int cache_releasedir(const char *path, struct fuse_file_info *fi)
{
int err;
struct file_handle *cfi;

cfi = (struct file_handle*) fi->fh;

if(cfi->is_open) {
fi->fh = cfi->fs_fh;
err = cache.next_oper->releasedir(path, fi);
Expand Down Expand Up @@ -365,7 +364,7 @@ static int cache_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
struct node *node;

assert(offset == 0);

pthread_mutex_lock(&cache.lock);
node = cache_lookup(path);
if (node != NULL && node->dir != NULL) {
Expand All @@ -391,8 +390,8 @@ static int cache_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
}
cfi->is_open = 1;
cfi->fs_fh = fi->fh;
}
}

ch.path = path;
ch.buf = buf;
ch.filler = filler;
Expand Down
2 changes: 1 addition & 1 deletion compat/fuse_opt.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ extern "C" {
/**
* Option description
*
* This structure describes a single option, and and action associated
* This structure describes a single option, and action associated
* with it, in case it matches.
*
* More than one such match may occur, in which case the action for
Expand Down
1 change: 0 additions & 1 deletion make_release_tarball.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,3 @@ gpg --armor --detach-sign "${TAG}.tar.xz"
PREV_TAG="$(git tag --list 'sshfs-3*' --sort=-taggerdate --merged "${TAG}^"| head -1)"
echo "Contributors from ${PREV_TAG} to ${TAG}:"
git log --pretty="format:%an <%aE>" "${PREV_TAG}..${TAG}" | sort -u

2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ endif


rst2man = find_program('rst2man', 'rst2man.py', required: false)

cfg = configuration_data()

cfg.set_quoted('PACKAGE_VERSION', meson.project_version())
Expand Down
40 changes: 20 additions & 20 deletions sshfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
/*
Handling of multiple SFTP connections
--------------------------------------
An SFTP server is free to return responses to outstanding requests in arbitrary
order. However, execution of requests may only be re-ordered and parallelized as long
as "the results in the responses will be the same as if [the client] had sent the
Expand All @@ -158,11 +158,11 @@
involved) wait for the other requests to complete. This means that e.g. a readdir
request would have to block on most other activity in the same directory, eliminating a
major advantage of using multiple connections.
In practice, we can luckily take advantage of the knowledge that most FUSE requests are
the result of (synchronous) syscalls from userspace that will block until the
corresponding FUSE response has been sent.
If -o sshfs_sync is used, SSHFS always waits for the SFTP server response before
returning a FUSE response to userspace. If userspace makes concurrent system calls,
there is no ordering guarantee in the first place, so we do not have to worry about
Expand Down Expand Up @@ -523,7 +523,7 @@ static struct fuse_opt sshfs_opts[] = {
/* For backwards compatibility */
SSHFS_OPT("cache=yes", dir_cache, 1),
SSHFS_OPT("cache=no", dir_cache, 0),

FUSE_OPT_KEY("writeback_cache=no", FUSE_OPT_KEY_DISCARD),
FUSE_OPT_KEY("unreliable_append", FUSE_OPT_KEY_DISCARD),

Expand Down Expand Up @@ -1073,7 +1073,7 @@ static struct conn* get_conn(const struct sshfs_file *sf,

if (sshfs.max_conns == 1)
return &sshfs.conns[0];

if (sf != NULL)
return sf->conn;

Expand Down Expand Up @@ -1906,7 +1906,7 @@ static void *sshfs_init(struct fuse_conn_info *conn,

// SFTP only supports 1-second time resolution
conn->time_gran = 1000000000;

return NULL;
}

Expand Down Expand Up @@ -2371,13 +2371,13 @@ static int sshfs_mkdir(const char *path, mode_t mode)
// Commutes with pending write(), so we can use any connection
err = sftp_request(get_conn(NULL, NULL), SSH_FXP_MKDIR, &buf, SSH_FXP_STATUS, NULL);
buf_free(&buf);

if (err == -EPERM) {
if (sshfs.op->access(path, R_OK) == 0) {
return -EEXIST;
}
}

return err;
}

Expand All @@ -2394,7 +2394,7 @@ static int sshfs_mknod(const char *path, mode_t mode, dev_t rdev)

// Commutes with pending write(), so we can use any connection
conn = get_conn(NULL, NULL);

buf_init(&buf, 0);
buf_add_path(&buf, path);
buf_add_uint32(&buf, SSH_FXF_WRITE | SSH_FXF_CREAT | SSH_FXF_EXCL);
Expand Down Expand Up @@ -2532,7 +2532,7 @@ static int sshfs_rename(const char *from, const char *to, unsigned int flags)
}
pthread_mutex_unlock(&sshfs.lock);
}

return err;
}

Expand Down Expand Up @@ -2589,12 +2589,12 @@ static int sshfs_chmod(const char *path, mode_t mode,
buf_init(&buf, 0);
if (sf == NULL)
buf_add_path(&buf, path);
else
else
buf_add_buf(&buf, &sf->handle);

buf_add_uint32(&buf, SSH_FILEXFER_ATTR_PERMISSIONS);
buf_add_uint32(&buf, mode);

/* FIXME: really needs LSETSTAT extension (debian Bug#640038) */
// Commutes with pending write(), so we can use any connection
// if the file is not open.
Expand All @@ -2618,7 +2618,7 @@ static int sshfs_chown(const char *path, uid_t uid, gid_t gid,
if (!sshfs_file_is_conn(sf))
return -EIO;
}

if (sshfs.remote_uid_detected) {
if (uid == sshfs.local_uid)
uid = sshfs.remote_uid;
Expand All @@ -2635,7 +2635,7 @@ static int sshfs_chown(const char *path, uid_t uid, gid_t gid,
buf_init(&buf, 0);
if (sf == NULL)
buf_add_path(&buf, path);
else
else
buf_add_buf(&buf, &sf->handle);
buf_add_uint32(&buf, SSH_FILEXFER_ATTR_UIDGID);
buf_add_uint32(&buf, uid);
Expand Down Expand Up @@ -2685,7 +2685,7 @@ static int sshfs_utimens(const char *path, const struct timespec tv[2],
buf_init(&buf, 0);
if (sf == NULL)
buf_add_path(&buf, path);
else
else
buf_add_buf(&buf, &sf->handle);
buf_add_uint32(&buf, SSH_FILEXFER_ATTR_ACMODTIME);
buf_add_uint32(&buf, asec);
Expand Down Expand Up @@ -2740,7 +2740,7 @@ static int sshfs_open_common(const char *path, mode_t mode,

if (fi->flags & O_APPEND)
pflags |= SSH_FXF_APPEND;

sf = g_new0(struct sshfs_file, 1);
list_init(&sf->write_reqs);
pthread_cond_init(&sf->write_finished, NULL);
Expand All @@ -2750,7 +2750,7 @@ static int sshfs_open_common(const char *path, mode_t mode,
pthread_mutex_lock(&sshfs.lock);
sf->modifver= sshfs.modifver;
if (sshfs.max_conns > 1) {
ce = g_hash_table_lookup(sshfs.conntab, path);
ce = g_hash_table_lookup(sshfs.conntab, path);
if (!ce) {
ce = g_malloc(sizeof(struct conntab_entry));
ce->refcount = 0;
Expand Down Expand Up @@ -3354,7 +3354,7 @@ static int sshfs_truncate(const char *path, off_t size,
sshfs_inc_modifver();
if (sshfs.truncate_workaround)
return sshfs_truncate_workaround(path, size, fi);

buf_init(&buf, 0);

if (sf != NULL)
Expand Down Expand Up @@ -3397,7 +3397,7 @@ static int sshfs_getattr(const char *path, struct stat *stbuf,
buf_add_buf(&buf, &sf->handle);
err = sftp_request(sf->conn, SSH_FXP_FSTAT, &buf,
SSH_FXP_ATTRS, &outbuf);
}
}
if (!err) {
err = buf_get_attrs(&outbuf, stbuf, NULL);
#ifdef __APPLE__
Expand Down
Loading

0 comments on commit 5aa231b

Please sign in to comment.