aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Pärtel <martin.partel@gmail.com>2019-03-27 22:32:56 +0200
committerMartin Pärtel <martin.partel@gmail.com>2019-03-27 22:34:13 +0200
commit64f51e9588d9a91174f5d69437d038f92c126e0d (patch)
tree54d9993bcf4f6a188c2214525852028316b11242 /src
parentb197a7ed3cd9b5ae6aec7dfbea706bdf4ccfced7 (diff)
downloadbindfs-64f51e9588d9a91174f5d69437d038f92c126e0d.tar.gz
(formatting)
Diffstat (limited to 'src')
-rw-r--r--src/bindfs.c6
-rw-r--r--src/usermap.c8
2 files changed, 9 insertions, 5 deletions
diff --git a/src/bindfs.c b/src/bindfs.c
index b5455f1..332aa74 100644
--- a/src/bindfs.c
+++ b/src/bindfs.c
@@ -451,16 +451,16 @@ static int chown_new_file(const char *path, struct fuse_context *fc, int (*chown
file_group = usermap_get_gid_or_default(settings.usermap_reverse, fc->gid, file_group);
if (file_owner != (uid_t)-1) {
- if (!unapply_uid_offset(&file_owner)) {
+ if (!unapply_uid_offset(&file_owner)) {
return -UID_GID_OVERFLOW_ERRNO;
- }
+ }
}
if (file_group != (gid_t)-1) {
if (!unapply_gid_offset(&file_group)) {
return -UID_GID_OVERFLOW_ERRNO;
}
- }
+ }
if (settings.create_for_uid != -1)
file_owner = settings.create_for_uid;
diff --git a/src/usermap.c b/src/usermap.c
index a85b597..2357f76 100644
--- a/src/usermap.c
+++ b/src/usermap.c
@@ -99,7 +99,9 @@ const char* usermap_errorstr(UsermapStatus status)
uid_t usermap_get_uid_or_default(UserMap *map, uid_t u, uid_t deflt)
{
int i;
- if (u == -1) return -1;
+ if (u == -1) {
+ return -1;
+ }
for (i = 0; i < map->user_size; ++i) {
if (map->user_from[i] == u) {
return map->user_to[i];
@@ -111,7 +113,9 @@ uid_t usermap_get_uid_or_default(UserMap *map, uid_t u, uid_t deflt)
gid_t usermap_get_gid_or_default(UserMap *map, gid_t g, gid_t deflt)
{
int i;
- if (g == -1) return -1;
+ if (g == -1) {
+ return -1;
+ }
for (i = 0; i < map->group_size; ++i) {
if (map->group_from[i] == g) {
return map->group_to[i];