diff options
author | Martin Pärtel <martin.partel@gmail.com> | 2012-03-13 17:09:15 +0200 |
---|---|---|
committer | Martin Pärtel <martin.partel@gmail.com> | 2012-03-13 17:09:15 +0200 |
commit | 05b33ffb546ff18fba19b6ecd172ce1d6b178105 (patch) | |
tree | 5a6493afb2f13cd5e2c1980adecb8d77aad62672 /src | |
parent | 7a1f1763ac6a36e6d4617d9a24d19655332d0577 (diff) | |
download | bindfs-05b33ffb546ff18fba19b6ecd172ce1d6b178105.tar.gz |
Added root check for --map.
Diffstat (limited to 'src')
-rw-r--r-- | src/bindfs.1 | 2 | ||||
-rw-r--r-- | src/bindfs.c | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/bindfs.1 b/src/bindfs.1 index 8a92246..b45b79d 100644 --- a/src/bindfs.1 +++ b/src/bindfs.1 @@ -63,6 +63,8 @@ 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. +Requires mounting as root. + .SH FILE CREATION POLICY New files and directories are created so they are owned by the mounter. diff --git a/src/bindfs.c b/src/bindfs.c index 24d4f53..897ae01 100644 --- a/src/bindfs.c +++ b/src/bindfs.c @@ -1429,6 +1429,10 @@ int main(int argc, char *argv[]) /* Parse usermap */ if (od.map) { + if (getuid() != 0) { + fprintf(stderr, "Error: You need to be root to use --map !\n", od.group); + return 1; + } if (!parse_user_map(settings.usermap, settings.usermap_reverse, od.map)) { /* parse_user_map printed an error */ return 1; |