opnsense-src/lib/libpam/modules
Yan Ka Chiu b75e0eed34 pam_exec: fix segfault when authtok is null
According to pam_exec(8), the `expose_authtok` option should be ignored
when the service function is `pam_sm_setcred`. Currently `pam_exec` only
prevent prompt for anth token when `expose_authtok` is set on
`pam_sm_setcred`. This subsequently led to segfault when there isn't an
existing auth token available.

Bug reported on this: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=263893

After reading https://reviews.freebsd.org/rS349556 I am not sure if the
default behaviour supposed to be simply not prompt for authentication
token, or is it to ignore the option entirely as stated in the man page.

This patch is therefore only adding an additional NULL check on the item
`pam_get_item` provide, and exit with `PAM_SYSTEM_ERR` when such item is
NULL.

MFC after:	1 week
Reviewed by:	des, khng
Differential Revision:	https://reviews.freebsd.org/D35169
2022-05-22 12:36:48 -04:00
..
pam_chroot lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
pam_deny lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
pam_echo lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
pam_exec pam_exec: fix segfault when authtok is null 2022-05-22 12:36:48 -04:00
pam_ftpusers lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
pam_group lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
pam_guest lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
pam_krb5 pkgbase: Create a FreeBSD-kerberos package 2021-09-07 10:23:14 +02:00
pam_ksu pkgbase: Create a FreeBSD-kerberos package 2021-09-07 10:23:14 +02:00
pam_lastlog pkgbase: Put more binaries/lib in runtime 2021-12-21 10:17:27 +01:00
pam_login_access pkgbase: Put more binaries/lib in runtime 2021-12-21 10:17:27 +01:00
pam_nologin pkgbase: Put more binaries/lib in runtime 2021-12-21 10:17:27 +01:00
pam_opie pkgbase: Put more binaries/lib in runtime 2021-12-21 10:17:27 +01:00
pam_opieaccess pkgbase: Put more binaries/lib in runtime 2021-12-21 10:17:27 +01:00
pam_passwdqc DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
pam_permit lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
pam_radius Forward Reply-Message attributes to the user, unless suppressed by the 2018-05-16 13:47:30 +00:00
pam_rhosts lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
pam_rootok lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
pam_securetty pkgbase: Put more binaries/lib in runtime 2021-12-21 10:17:27 +01:00
pam_self pkgbase: Put more binaries/lib in runtime 2021-12-21 10:17:27 +01:00
pam_ssh ssh: update to OpenSSH v8.9p1 2022-04-13 16:00:56 -04:00
pam_tacplus lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
pam_unix pkgbase: Put more binaries/lib in runtime 2021-12-21 10:17:27 +01:00
Makefile Build libpam modules in parallel. 2016-04-14 01:17:37 +00:00
Makefile.inc Use SRCTOP-relative paths to other directories instead of .CURDIR-relative ones 2017-01-20 03:27:47 +00:00
modules.inc Conditionalize building radius support into libpam, ppp, etc via 2015-02-04 06:53:45 +00:00