aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Pärtel <martin.partel@gmail.com>2013-07-22 11:11:43 +0300
committerMartin Pärtel <martin.partel@gmail.com>2013-07-22 11:11:43 +0300
commitd32bc6026591ff6758025e29bc1e70c536fbd942 (patch)
treeb2e4ef84876a9e38bd3f540007935bf77d9f6962
parenta87b4abe272ab928ee972ff875ca5b49ee14769a (diff)
downloadbindfs-d32bc6026591ff6758025e29bc1e70c536fbd942.tar.gz
Rename chmod-perms to chmod-filter.
-rw-r--r--ChangeLog4
-rw-r--r--src/bindfs.c15
-rwxr-xr-xtests/test_bindfs.rb2
3 files changed, 12 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 7ff122c..96fa2ab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-07-22 Martin Pärtel <martin dot partel at gmail dot com>
+
+ * Added --chmod-filter, contributed by Anton Ageev. Thanks!
+
2013-05-08 Martin Pärtel <martin dot partel at gmail dot com>
* Fixed building against latest FUSE e.g. on Ubuntu 13.04.
diff --git a/src/bindfs.c b/src/bindfs.c
index e067f59..cfd67a0 100644
--- a/src/bindfs.c
+++ b/src/bindfs.c
@@ -114,7 +114,7 @@ static struct Settings {
int chmod_allow_x;
- struct permchain *chmod_permchain; /* the --chmod-perms option */
+ struct permchain *chmod_permchain; /* the --chmod-filter option */
enum XAttrPolicy {
XATTR_UNIMPLEMENTED,
@@ -967,8 +967,8 @@ static void print_usage(const char *progname)
" --chmod-normal Try to chmod the original files (the default).\n"
" --chmod-ignore Have all chmods fail silently.\n"
" --chmod-deny Have all chmods fail with 'permission denied'.\n"
+ " --chmod-filter Change permissions of chmod requests.\n"
" --chmod-allow-x Allow changing file execute bits in any case.\n"
- " --chmod-perms Alter permissions when to chmod the original file.\n"
"\n"
"Extended attribute policy:\n"
" --xattr-none Do not implement xattr operations.\n"
@@ -1013,7 +1013,6 @@ enum OptionKey {
OPTKEY_CHMOD_IGNORE,
OPTKEY_CHMOD_DENY,
OPTKEY_CHMOD_ALLOW_X,
- OPTKEY_CHMOD_PERMS,
OPTKEY_XATTR_NONE,
OPTKEY_XATTR_READ_ONLY,
OPTKEY_XATTR_READ_WRITE,
@@ -1343,7 +1342,7 @@ int main(int argc, char *argv[])
char *create_for_user;
char *create_for_group;
char *create_with_perms;
- char *chmod_perms;
+ char *chmod_filter;
int no_allow_other;
int multithreaded;
} od;
@@ -1391,8 +1390,8 @@ int main(int argc, char *argv[])
OPT2("--chmod-normal", "chmod-normal", OPTKEY_CHMOD_NORMAL),
OPT2("--chmod-ignore", "chmod-ignore", OPTKEY_CHMOD_IGNORE),
OPT2("--chmod-deny", "chmod-deny", OPTKEY_CHMOD_DENY),
+ OPT_OFFSET2("--chmod-filter=%s", "chmod-filter=%s", chmod_filter, -1),
OPT2("--chmod-allow-x", "chmod-allow-x", OPTKEY_CHMOD_ALLOW_X),
- OPT_OFFSET2("--chmod-perms=%s", "chmod-perms=%s", chmod_perms, -1),
OPT2("--xattr-none", "xattr-none", OPTKEY_XATTR_NONE),
OPT2("--xattr-ro", "xattr-ro", OPTKEY_XATTR_READ_ONLY),
@@ -1541,9 +1540,9 @@ int main(int argc, char *argv[])
return 1;
}
}
- if (od.chmod_perms) {
- if (add_chmod_rules_to_permchain(od.chmod_perms, settings.chmod_permchain) != 0) {
- fprintf(stderr, "Invalid permission specification: '%s'\n", od.chmod_perms);
+ if (od.chmod_filter) {
+ if (add_chmod_rules_to_permchain(od.chmod_filter, settings.chmod_permchain) != 0) {
+ fprintf(stderr, "Invalid permission specification: '%s'\n", od.chmod_filter);
return 1;
}
}
diff --git a/tests/test_bindfs.rb b/tests/test_bindfs.rb
index 26c7b20..f8a9d89 100755
--- a/tests/test_bindfs.rb
+++ b/tests/test_bindfs.rb
@@ -258,7 +258,7 @@ testenv("--chmod-deny --chmod-allow-x") do
assert_exception(EPERM) { chmod(0700, 'mnt/dir') } # chmod on dir should not work
end
-testenv("--chmod-perms=g-w,o-rwx") do
+testenv("--chmod-filter=g-w,o-rwx") do
touch('src/file')
chmod(0666, 'mnt/file')