]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
pam_systemd: drop "pid" field from SessionContext
authorLennart Poettering <lennart@poettering.net>
Fri, 15 Nov 2024 13:36:22 +0000 (14:36 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 17 Dec 2024 16:52:08 +0000 (17:52 +0100)
We never use the field and this is not going to change...

This addresses a weird asymmetry, as create_session_message() always
went to the process' own PID when doing pidfds but otherwise (i.e.
without pidfds) would honour the PID specified as function parameter.

src/login/pam_systemd.c

index dd7ba64fb051fa5931b738789ce6b5cfe6566d14..fd27d0ff810470f186514bd25bd95ef8fc6d1fea 100644 (file)
@@ -847,7 +847,6 @@ static uint64_t pick_default_capability_ambient_set(
 
 typedef struct SessionContext {
         const uid_t uid;
-        const pid_t pid;
         const char *service;
         const char *type;
         const char *class;
@@ -895,7 +894,7 @@ static int create_session_message(
         r = sd_bus_message_append(m,
                                   pidfd >= 0 ? "uhsssssussbss" : "uusssssussbss",
                                   (uint32_t) context->uid,
-                                  pidfd >= 0 ? pidfd : context->pid,
+                                  pidfd >= 0 ? pidfd : 0,
                                   context->service,
                                   context->type,
                                   context->class,
@@ -1122,7 +1121,6 @@ _public_ PAM_EXTERN int pam_sm_open_session(
 
         const SessionContext context = {
                 .uid = ur->uid,
-                .pid = 0,
                 .service = service,
                 .type = type,
                 .class = class,