git: 9e8d504bb5a1 - stable/14 - pam_xdg: Fix user xdg runtime directory's descriptor leak
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 03 Sep 2024 14:02:06 UTC
The branch stable/14 has been updated by olce:
URL: https://cgit.FreeBSD.org/src/commit/?id=9e8d504bb5a1e7ede55814069e213d4702172b81
commit 9e8d504bb5a1e7ede55814069e213d4702172b81
Author: Olivier Certner <olce@FreeBSD.org>
AuthorDate: 2024-08-13 21:04:09 +0000
Commit: Olivier Certner <olce@FreeBSD.org>
CommitDate: 2024-09-03 13:28:58 +0000
pam_xdg: Fix user xdg runtime directory's descriptor leak
Approved by: emaste (mentor)
Fixes: 6e69612d5df1 ("pam: Add pam_xdg module")
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 06986e899972ac3a127ab2ab46196672d0e1e5b2)
Approved by: emaste (mentor)
---
lib/libpam/modules/pam_xdg/pam_xdg.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/libpam/modules/pam_xdg/pam_xdg.c b/lib/libpam/modules/pam_xdg/pam_xdg.c
index 2c80f0a0332f..10c6467776a3 100644
--- a/lib/libpam/modules/pam_xdg/pam_xdg.c
+++ b/lib/libpam/modules/pam_xdg/pam_xdg.c
@@ -108,6 +108,7 @@ _pam_xdg_open(pam_handle_t *pamh, int flags __unused,
goto out;
}
} else {
+ close(rt_dir);
/* Check that the already create dir is correctly owned */
rv = fstatat(rt_dir_prefix, user, &sb, 0);
if (rv == -1) {