diff options
author | Henry Stern <stern@fsi.io> | 2015-09-11 07:52:50 -0300 |
---|---|---|
committer | Henry Stern <stern@fsi.io> | 2015-09-11 12:52:33 -0300 |
commit | f7b7a42f8c9e148f53c09b4eabaa3797ecbb9915 (patch) | |
tree | 44f4761af3605a409436990f4b3167ed39cfd055 /src/bindfs.1 | |
parent | b4cdacc28e45f9c3b727db3a5e128e7ed5380e1a (diff) | |
download | bindfs-f7b7a42f8c9e148f53c09b4eabaa3797ecbb9915.tar.gz |
Add functionality to transparently resolve symbolic links.
There exist use cases where you would want bindfs to transparently
resolve symbolic links, such as when you are creating a chroot
environment with a bound fs. This change adds an option,
--resolve-symlinks, that modifies the behaviour of the process_path
and bindfs_symlink functions.
The process_path function is modified to return a mutable char* that
must be freed. When settings.resolve_symlinks is enabled the
process_path function calls realpath on the relative path to
transparently resolve the symbolic link.
A side effect of this change is that broken symbolic links will appear
in directory listings but any attempt to access the file of that name
will return the ENOENT error code. A subsequent commit offers an
alternative behaviour of not resolving broken symbolic links.
All callers of process_path are modified to check the return value of
process_path to make sure realpath and strdup were successful. They
also free the result after use to prevent memory leakage.
The bindfs_symlink function is modified to return EPERM when
resolve-symlinks is enabled. This must be done to prevent access to
arbitrary files on the filesystem.
Diffstat (limited to 'src/bindfs.1')
-rw-r--r-- | src/bindfs.1 | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/bindfs.1 b/src/bindfs.1 index 81e5961..a3904c8 100644 --- a/src/bindfs.1 +++ b/src/bindfs.1 @@ -263,6 +263,11 @@ The underlying file's ctime will still be updated normally. Shows the hard link count of all files as 1. .TP +.B \-\-resolve\-symlinks, \-o resolve-symlinks +Transparently resolves symbolic links. Disables creation of new symbolic +links. + +.TP .B \-\-multithreaded, \-o multithreaded Run bindfs in multithreaded mode. While bindfs is designed to be otherwise thread-safe, there is currently a race condition that may pose |