From: Lennart Poettering Date: Thu, 21 Oct 2021 16:48:30 +0000 (+0200) Subject: homework: apply mount flags also for CIFS mounts X-Git-Tag: v250-rc1~396^2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c9080dfb0b31d2a55755b13947812394b4719c44;p=thirdparty%2Fsystemd.git homework: apply mount flags also for CIFS mounts --- diff --git a/src/home/homework-cifs.c b/src/home/homework-cifs.c index f0a1d51b8f3..b9200531632 100644 --- a/src/home/homework-cifs.c +++ b/src/home/homework-cifs.c @@ -99,6 +99,11 @@ int home_setup_cifs( return log_error_errno(SYNTHETIC_ERRNO(ENOKEY), "Failed to mount home directory with supplied password."); + /* Adjust MS_SUID and similar flags */ + r = mount_nofollow_verbose(LOG_ERR, NULL, HOME_RUNTIME_WORK_DIR, NULL, MS_BIND|MS_REMOUNT|user_record_mount_flags(h), NULL); + if (r < 0) + return r; + setup->root_fd = open(HOME_RUNTIME_WORK_DIR, O_RDONLY|O_CLOEXEC|O_DIRECTORY|O_NOFOLLOW); if (setup->root_fd < 0) return log_error_errno(errno, "Failed to open home directory: %m");