diff options
| author | Emmanuel Vadot <manu@FreeBSD.org> | 2024-02-27 07:05:00 +0000 |
|---|---|---|
| committer | Emmanuel Vadot <manu@FreeBSD.org> | 2024-04-11 13:24:49 +0000 |
| commit | 4d2dad92ee23f49c38d6dd72581fbee35a2f81b2 (patch) | |
| tree | c069c419b2ec4476d717759a54762734787fe34d | |
| parent | cd9fff7b0431953db2f50d10fb1ba87809bcc6d6 (diff) | |
pam_xdg: Reset rv to 0
Otherwise on success it ontain the return value of asprintf.
Sponsored by: Beckhoff Automation GmbH & Co. KG
Fixes: 2d2950c88933 ("pam_xdg: Check asprintf return value")
(cherry picked from commit 5acbe6d1fb552eeaf44955c2780f2e9d4a70cad3)
| -rw-r--r-- | lib/libpam/modules/pam_xdg/pam_xdg.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libpam/modules/pam_xdg/pam_xdg.c b/lib/libpam/modules/pam_xdg/pam_xdg.c index d8ba6899da2f..f1a9b13d581c 100644 --- a/lib/libpam/modules/pam_xdg/pam_xdg.c +++ b/lib/libpam/modules/pam_xdg/pam_xdg.c @@ -151,6 +151,7 @@ _pam_xdg_open(pam_handle_t *pamh, int flags __unused, rv = PAM_SESSION_ERR; goto out; } + rv = 0; session_file = openat(rt_dir_prefix, xdg_session_file, O_CREAT | O_EXCL, RUNTIME_DIR_MODE); free(xdg_session_file); if (session_file >= 0) @@ -272,6 +273,7 @@ _pam_xdg_close(pam_handle_t *pamh __unused, int flags __unused, rv = PAM_SESSION_ERR; goto out; } + rv = 0; session_file = openat(rt_dir_prefix, xdg_session_file, 0); if (session_file >= 0) { unlinkat(rt_dir_prefix, xdg_session_file, 0); |
