From nobody Mon May 27 06:33:30 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vnm7G2WXhz5Lbwh; Mon, 27 May 2024 06:33:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vnm7G1Ynhz4Kr4; Mon, 27 May 2024 06:33:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716791610; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3p7brPFkzfbKZ8ZuQjvaFXhf72uC6hiUsxn6ljaDO+Y=; b=nNKqu5sKyuWD9nS/bzwO2eKiR7TW2oIcbbLSGwA6unrgsvLpfTXr5LBkoboIP0GFJamh+z /HU24i3Ks4bzx/eVT7jSriHN8XBMmi2AMXcs8Nc00rl9t330o2scIMtd7P10ZjBKSvFqjP R97K/a+PotuUoXLB8BUZ84nYriBMqAefdWbIphV3kVPHN9Vrns+6Hy315d/ry7TLdQRq/E QV2n+y27qn/1ji6RgcjgXtPbTRtemYG7pPjJE40za0juAZGQe+bWd8FXLZr5OK4nZWYDMr u+HkTn0BYmWZyYQmjZ1EQxUObeK7wG457HPzm24H4isRDGFZ7BRvF3KekSJ/tQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716791610; a=rsa-sha256; cv=none; b=F6IYNaCbzFFurSo1HqH0FiVpucPMB4T9GSLpWrBB2tfkUNx09CbL2Wp6SyuQEwcRILtvEu Ij9m1AQdO0Vpb+7yS73iXa+lOkDKF/VUQN5c2pP+oK7W26Q0k+W/dOnc6ZnXFRAn7zXIGC R0tj9m5kyx4fSgjg6VMF7xfgVBW5mji/h6OxfxnvGz8g3n3N7PDQOh8y+ZmPowd3RB/AJ4 vindxrMpzu7yYZuSpieVCPRya81M40cIfyY+MlKvLryTdIGLlSF4PFigO46JTIC9xNWNie GcgTOb0ZfVa3VQDcdimy3kjkOPkoUJCT/2cyMQGFueT6Z9WxpcZ7c9/KoHhVIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716791610; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3p7brPFkzfbKZ8ZuQjvaFXhf72uC6hiUsxn6ljaDO+Y=; b=eYfxKO2zDh6i9Pq5eyMhMFoowLJB77STYvKtQTmxacA0JnxlFbGfi3qJooakikVDnETPGz emDGMwlF5O0NehODLzYafpqZILyX97Y7aKQ4cAdG/4PVdmZGFP4e+rUx7l9oFgIbx/DPTj lwSvfyfjxEENrZOuYrZRxW0zftJ7EGTDEHVs8b/6Du2uQQhPPMDo2I4DntTuLq4C/GaInx yFchIZlnXSrv/pGQD25H/eplH0izpLmOC4QwDngUJ0Oey3iHwAELKGgp1FnWqUdq02HUh2 6iSS0w0Dk0oNT52E4l2ph8HZIscw1j6lrDgEXdObJcHqIGeGpuRuuBrAxNwXqw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vnm7G14phzZ35; Mon, 27 May 2024 06:33:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44R6XUh1095978; Mon, 27 May 2024 06:33:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44R6XUQX095975; Mon, 27 May 2024 06:33:30 GMT (envelope-from git) Date: Mon, 27 May 2024 06:33:30 GMT Message-Id: <202405270633.44R6XUQX095975@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: cca0ce62f367 - main - pam_xdg: pam_get_item can return NULL List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cca0ce62f367d03ed429bf99e41e6aca8cb7f2ac Auto-Submitted: auto-generated The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=cca0ce62f367d03ed429bf99e41e6aca8cb7f2ac commit cca0ce62f367d03ed429bf99e41e6aca8cb7f2ac Author: Andre Albsmeier AuthorDate: 2024-05-27 06:31:34 +0000 Commit: Emmanuel Vadot CommitDate: 2024-05-27 06:33:14 +0000 pam_xdg: pam_get_item can return NULL Fix pam_xdg as pam_get_item can return NULL, this happens when pressing control + C in xdm for example. MFC after: 1 week PR: 279268 --- lib/libpam/modules/pam_xdg/pam_xdg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libpam/modules/pam_xdg/pam_xdg.c b/lib/libpam/modules/pam_xdg/pam_xdg.c index 4d586a21566a..2c80f0a0332f 100644 --- a/lib/libpam/modules/pam_xdg/pam_xdg.c +++ b/lib/libpam/modules/pam_xdg/pam_xdg.c @@ -67,7 +67,7 @@ _pam_xdg_open(pam_handle_t *pamh, int flags __unused, /* Get user info */ rv = pam_get_item(pamh, PAM_USER, (const void **)&user); - if (rv != PAM_SUCCESS) { + if (rv != PAM_SUCCESS || user == NULL) { PAM_VERBOSE_ERROR("Can't get user information"); goto out; } @@ -221,7 +221,7 @@ _pam_xdg_close(pam_handle_t *pamh __unused, int flags __unused, /* Get user info */ rv = pam_get_item(pamh, PAM_USER, (const void **)&user); - if (rv != PAM_SUCCESS) { + if (rv != PAM_SUCCESS || user == NULL) { PAM_VERBOSE_ERROR("Can't get user information"); goto out; }