From 014d23c3955ac2c2c6fc7c8e235daccae201c8fd Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 15 Nov 2024 14:36:22 +0100 Subject: [PATCH] pam_systemd: drop "pid" field from SessionContext 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 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/login/pam_systemd.c b/src/login/pam_systemd.c index dd7ba64fb05..fd27d0ff810 100644 --- a/src/login/pam_systemd.c +++ b/src/login/pam_systemd.c @@ -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,