From: Lennart Poettering Date: Fri, 15 Nov 2024 13:36:22 +0000 (+0100) Subject: pam_systemd: drop "pid" field from SessionContext X-Git-Tag: v258-rc1~1830^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=014d23c3955ac2c2c6fc7c8e235daccae201c8fd;p=thirdparty%2Fsystemd.git 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. --- 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,