Browse Source

Fix creation of user runtime directories

Signed-off-by: Sven Eden <sven.eden@prydeworx.com>
v246-stable
Sven Eden 1 month ago
parent
commit
9de191a83f
3 changed files with 4 additions and 10 deletions
  1. +2
    -5
      src/login/logind-user.c
  2. +1
    -4
      src/login/pam_elogind.c
  3. +1
    -1
      src/login/user-runtime-dir.c

+ 2
- 5
src/login/logind-user.c View File

@ -476,13 +476,10 @@ int user_start(User *u) {
r = user_runtime_dir("start", u);
if (r < 0)
return r;
/* Save the user data so far */
user_save_internal(u);
#else // 1
/* Save the user data so far, because pam_systemd will read the XDG_RUNTIME_DIR out of it while starting up
#endif // 1
/* Save the user data so far, because pam_elogind will read the XDG_RUNTIME_DIR out of it while starting up
* systemd --user. We need to do user_save_internal() because we have not "officially" started yet. */
user_save_internal(u);
#endif // 1
/* Set slice parameters */
(void) user_update_slice(u);

+ 1
- 4
src/login/pam_elogind.c View File

@ -683,9 +683,6 @@ _public_ PAM_EXTERN int pam_sm_open_session(
assert(handle);
#if 0 /// with elogind, it is always a "logind system".
#endif // 0
if (parse_argv(handle,
argc, argv,
&class_pam,
@ -711,8 +708,8 @@ _public_ PAM_EXTERN int pam_sm_open_session(
* "systemd-user" we simply set XDG_RUNTIME_DIR and
* leave. */
#if 0 /// This does not apply to elogind, as it is not a part of init or any service manager
(void) pam_get_item(handle, PAM_SERVICE, (const void**) &service);
#if 0 /// This does not apply to elogind, as it is not a part of init or any service manager
if (streq_ptr(service, "systemd-user")) {
char rt[STRLEN("/run/user/") + DECIMAL_STR_MAX(uid_t)];

+ 1
- 1
src/login/user-runtime-dir.c View File

@ -214,6 +214,7 @@ static int run(int argc, char *argv[]) {
r = mac_selinux_init();
if (r < 0)
return r;
#else // 0
int user_runtime_dir(const char *verb, User *u) {
int r = 0;
@ -224,7 +225,6 @@ int user_runtime_dir(const char *verb, User *u) {
#endif // 0
return r;
#if 0 /// elogind has more information and can do this more conveniently
if (streq(argv[1], "start"))

Loading…
Cancel
Save