summaryrefslogtreecommitdiffstats
path: root/src/home/homework-cifs.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2021-08-31 10:46:06 +0200
committerLennart Poettering <lennart@poettering.net>2021-08-31 10:51:50 +0200
commit279e060e2549183101ebf94e9739b70ed499c4c1 (patch)
tree480bcafbcec243fe397729c8449750ab91dbd66b /src/home/homework-cifs.c
parenthomed: add missing capabilities for SMB/CIFS backend (diff)
downloadsystemd-279e060e2549183101ebf94e9739b70ed499c4c1.tar.xz
systemd-279e060e2549183101ebf94e9739b70ed499c4c1.zip
homed: make sure to use right asssesors for GID + access mode
Don't reach directly into the UserRecord struct, but use the right assessors, so that the "unspecified" case is covered.
Diffstat (limited to 'src/home/homework-cifs.c')
-rw-r--r--src/home/homework-cifs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/home/homework-cifs.c b/src/home/homework-cifs.c
index 2254eb59cd..cf3c58431a 100644
--- a/src/home/homework-cifs.c
+++ b/src/home/homework-cifs.c
@@ -58,8 +58,8 @@ int home_prepare_cifs(
f = safe_fclose(f);
- if (asprintf(&options, "credentials=%s,uid=" UID_FMT ",forceuid,gid=" UID_FMT ",forcegid,file_mode=0%3o,dir_mode=0%3o",
- p, h->uid, h->uid, h->access_mode, h->access_mode) < 0)
+ if (asprintf(&options, "credentials=%s,uid=" UID_FMT ",forceuid,gid=" GID_FMT ",forcegid,file_mode=0%3o,dir_mode=0%3o",
+ p, h->uid, user_record_gid(h), user_record_access_mode(h), user_record_access_mode(h)) < 0)
return log_oom();
r = safe_fork("(mount)", FORK_RESET_SIGNALS|FORK_RLIMIT_NOFILE_SAFE|FORK_DEATHSIG|FORK_LOG|FORK_STDOUT_TO_STDERR, &mount_pid);