From nobody Mon Jun 03 07:36:22 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 4Vt5BZ5Dzrz5M2Hr; Mon, 03 Jun 2024 07:36:22 +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 4Vt5BZ4cPfz45k5; Mon, 3 Jun 2024 07:36:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717400182; 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=n9wC8gW61mO+PqL7rkMCmzm587M+6H08BJPTJHVBXag=; b=tGaF5JgcYEQVpkoZwFcYWgOR5pFjI4Mc6eoPNEzj7rN1Fi1BTSDP71HU1pEyXApyc/r8Ba qx9ujLLrm5Tyb4urGfEGMIdU+XZ/psFOuLIp+6ixe8hF0ojG0RGCjAb1DQcZFnG3kBkxnr cpebbstC41ZOgNxqTJqIKy6VdFTpI/iIwEUKBMCQ53RgdcnBHmCpsx9yBnXXwOjYuc/nPH xYZC/sl3yoKmPzEBZ5BJwG4ariixFI2eWzqmxhXsdLDk6mc4TY8LYLrWbc9Cj1lO+uXiaf KIAAsE4FuOn++glrAI3m12B9nAKokHPLqr9o2h7XAMRe7flKzQgCqwks5Xq0cA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717400182; a=rsa-sha256; cv=none; b=boREQph7itysvNkYJA094fGUJzRG9KA2isL7/AhEQyE23Ehkp4BfrI5GqOOgH9lUtwOPr9 kfY8K+Jucffkv2XTeb+jl8yzc/6Oojjw5DLP2Wj0Ed/GsBlSNy4vwUkKIUXXd1aX8vk1B+ PV9Ajr4c2VjlIL1MGj5BTlmFKTmiVLCTPDagtPiXMdtK8akuypBM5d3p/iw4P9T2LCahhu /lzqxpNoI4hmeQmg2uBKymrt+MyqwPy98OCqr15KtWuCXN8iqDz3UcGtG+PDl9Coa0S2W7 TiMusOVOflEbV/TwmU12XURuyosOvTPaP8qNSfUVvQJiHFXLx9QSDn6TtHabiQ== 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=1717400182; 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=n9wC8gW61mO+PqL7rkMCmzm587M+6H08BJPTJHVBXag=; b=uOAQb/CAGyhd/YKfSDXBeynaYHFFFExE9OuAIw+oJ54902tZSRiQ3ZZuH0yR5/ibbnHOKX CRzqeYPurYY//IV8OsB+orUNl+9jDOdoY5mglQi06u+gdU1gorqPZ+NGKBgkibvZH0nLpC s1rUINsHVNMKtFW3CCkKVH96BWUFi2FgSvdMv98ckJIC838h49umMRmAb77TBhOn9/wrLP gNh8DO2Lfkvu6cqdOQjVoU2lc04ps/bVpXG89iGz3ymC80vbktnA5WvnHNQ7k2s09n64UO ADxr6WIFVTp93nXNgvizWhbJxVg05A0ggdhzM+RkwcgpxNLza/bsLW3yWYH5Xg== 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 4Vt5BZ4CllzR4L; Mon, 3 Jun 2024 07:36:22 +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 4537aM9H063155; Mon, 3 Jun 2024 07:36:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4537aM9S063152; Mon, 3 Jun 2024 07:36:22 GMT (envelope-from git) Date: Mon, 3 Jun 2024 07:36:22 GMT Message-Id: <202406030736.4537aM9S063152@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Emmanuel Vadot Subject: git: 9fe726012df9 - stable/14 - 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 9fe726012df9a125a40df0b70a2e5c6f6b7bb913 Auto-Submitted: auto-generated The branch stable/14 has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=9fe726012df9a125a40df0b70a2e5c6f6b7bb913 commit 9fe726012df9a125a40df0b70a2e5c6f6b7bb913 Author: Andre Albsmeier AuthorDate: 2024-05-27 06:31:34 +0000 Commit: Emmanuel Vadot CommitDate: 2024-06-03 07:35:41 +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 (cherry picked from commit cca0ce62f367d03ed429bf99e41e6aca8cb7f2ac) --- 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; }