aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bindfs.110
-rw-r--r--src/bindfs.c2
2 files changed, 8 insertions, 4 deletions
diff --git a/src/bindfs.1 b/src/bindfs.1
index b45b79d..9a03199 100644
--- a/src/bindfs.1
+++ b/src/bindfs.1
@@ -55,13 +55,15 @@ Like \fB\-\-mirror\fP but disallows access for all other users (except root).
.TP
.B \-\-map=\fIuser1/user2:@group1/@group2:...\fP, \-o map=...
Given a mapping \fIuser1/user2\fP, all files owned by user1 are shown
-as owned by user2. Additionally, when user2 creates files, they are chowned
-to user1 in the underlying directory. Works similarly for groups.
+as owned by user2. When user2 creates files, they are chowned
+to user1 in the underlying directory. When files are chowned to user2,
+they are chowned to user1 in the underlying directory. Works similarly for groups.
A single user or group may appear no more than once on the left and once on the
right of a slash in the list of mappings.
-Currently, the options \fB--user\fP, \fB--group\fP, \fB--mirror\fP and
-\fB--create-for-*\fP override the corresponding behavior of this option.
+Currently, the options \fB--user\fP, \fB--group\fP, \fB--mirror\fP,
+\fB--create-for-*\fP, \fB--chown-*\fP and \fB--chgrp-*\fP override
+the corresponding behavior of this option.
Requires mounting as root.
diff --git a/src/bindfs.c b/src/bindfs.c
index 2cebf41..35b1b48 100644
--- a/src/bindfs.c
+++ b/src/bindfs.c
@@ -615,6 +615,7 @@ static int bindfs_chown(const char *path, uid_t uid, gid_t gid)
if (uid != -1) {
switch (settings.chown_policy) {
case CHOWN_NORMAL:
+ uid = usermap_get_uid(settings.usermap_reverse, uid);
break;
case CHOWN_IGNORE:
uid = -1;
@@ -627,6 +628,7 @@ static int bindfs_chown(const char *path, uid_t uid, gid_t gid)
if (gid != -1) {
switch (settings.chgrp_policy) {
case CHGRP_NORMAL:
+ gid = usermap_get_gid(settings.usermap_reverse, gid);
break;
case CHGRP_IGNORE:
gid = -1;