PAM

~roguescholar/pam/+git/upstream:ldv/pam_faildelay-cast

Last commit made on 2024-01-20
Get this branch:
git clone -b ldv/pam_faildelay-cast https://git.launchpad.net/~roguescholar/pam/+git/upstream

Branch merges

Branch information

Name:
ldv/pam_faildelay-cast
Repository:
lp:~roguescholar/pam/+git/upstream

Recent commits

63476f2... by "Dmitry V. Levin" <email address hidden>

pam_faildelay: fix compilation warnings on 32bit platforms

Fix the following warning reported by gcc on 32bit platforms:

  pam_faildelay.c: In function 'pam_sm_authenticate':
  pam_faildelay.c:104:34: error: comparison of integer expressions of different signedness: 'long int' and 'unsigned int' [-Werror=sign-compare]
    104 | if (delay < 0 || delay > UINT_MAX)
        | ^
  pam_faildelay.c:123:32: error: comparison of integer expressions of different signedness: 'long int' and 'unsigned int' [-Werror=sign-compare]
    123 | if (delay < 0 || delay > UINT_MAX / S_TO_MICROS)
        | ^

* modules/pam_faildelay/pam_faildelay.c (pam_sm_authenticate): Cast
"delay" to "unsigned long" in comparisons with unsigned int.

Fixes: dd87776d3683 ("pam_faildelay: validate parameter ranges")

eeaf310... by "Dmitry V. Levin" <email address hidden>

pam_namespace: use sed instead of awk in namespace.init

Given that sed is considered a more lightweight dependency than awk,
and since sed is used by pam_namespace_helper anyway, use sed instead of
awk in namespace.init as well.

* modules/pam_namespace/namespace.init: Use sed instead of awk to obtain
the UMASK value from /etc/login.defs.

1c9ddfb... by Tobias Stoeckmann <email address hidden>

build: correctly set WITH_SELINUX conditional

React on actual test if SELinux is available, not just if SELinux
should be tested for.

Currently the supposedly disabled binaries are still installed even if
SELinux is not available.

Fixes: cb9f88ba944d ("pam_unix: build unix_update only with SELinux enabled")
Signed-off-by: Tobias Stoeckmann <email address hidden>

470b5bd... by Tobias Stoeckmann <email address hidden>

pam_unix: do not warn if password aging is disabled

Later checks will print a warning if daysleft is 0. If password
aging is disabled, leave daysleft at -1.

Resolves: https://github.com/linux-pam/linux-pam/issues/743
Fixes: 9ebc14085a3b ("pam_unix: allow disabled password aging")
Signed-off-by: Tobias Stoeckmann <email address hidden>

aec921f... by Tobias Stoeckmann <email address hidden>

libpam_misc: use size_t for sizes

Theoretically the int might overflow. Use a size_t to protect this
function which might be called from an application, because it is
exposed through pam_misc.h header.

Signed-off-by: Tobias Stoeckmann <email address hidden>

9e4e3e4... by Tobias Stoeckmann <email address hidden>

pam_env: remove escaped newlines from econf lines

The libeconf routines do not remove escaped newlines the way we want to
process them later on. Manually remove them from values.

Signed-off-by: Tobias Stoeckmann <email address hidden>
Resolves: https://github.com/linux-pam/linux-pam/issues/738
Fixes: 6135c45347b6 ("pam_env: Use vendor specific pam_env.conf and environment as fallback")

28894b3... by "Dmitry V. Levin" <email address hidden>

pam_env: fix --enable-vendordir fallback logic

* modules/pam_env/pam_env.c (_parse_config_file) [!USE_ECONF &&
VENDOR_DEFAULT_CONF_FILE]: Do not fallback to vendor pam_env.conf file
if the config file is specified via module arguments.

Link: https://github.com/linux-pam/linux-pam/issues/738
Fixes: v1.5.3~69 ("pam_env: Use vendor specific pam_env.conf and environment as fallback")

0703453... by Tobias Stoeckmann <email address hidden>

pam_env: check VENDORDIR after config.h inclusion

The VENDORDIR define has to be checked after config.h
inclusion, otherwise the ifdef test always yields false.

Fixes: 6135c45347b6 ("pam_env: Use vendor specific pam_env.conf and environment as fallback")

Signed-off-by: Tobias Stoeckmann <email address hidden>

560a1c4... by Tobias Stoeckmann <email address hidden>

libpam: fix build with --enable-read-both-confs

If configure option --enable-read-both-confs is used, the build
fails with 1.6.0 due to missing stack level depth argument passed to
_pam_parse_conf_file.

Signed-off-by: Tobias Stoeckmann <email address hidden>
Resolves: https://github.com/linux-pam/linux-pam/issues/736
Fixes: v1.6.0~205 ("libpam: avoid infinite recursion with includes")

cc9d40b... by Jacob Heider <email address hidden>

pam_namespace: include stdint.h

pam_namespace.c makes use of SIZE_MAX but doesn't include stdint.h,
resulting in the following build failures on 1.6.0:

  pam_namespace.c: In function 'process_line':
  pam_namespace.c:649:41: error: 'SIZE_MAX' undeclared (first use in this function)
    649 | if (count > UINT_MAX || count > SIZE_MAX / sizeof(uid_t)) {
        | ^~~~~~~~
  pam_namespace.c:41:1: note: 'SIZE_MAX' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?
     40 | #include "argv_parse.h"
    +++ |+#include <stdint.h>
     41 |
  pam_namespace.c:649:41: note: each undeclared identifier is reported only once for each function it appears in
    649 | if (count > UINT_MAX || count > SIZE_MAX / sizeof(uid_t)) {
        | ^~~~~~~~

Fixes: v1.6.0~100 ("pam_namespace: validate amount of uids in config")
Resolves: https://github.com/linux-pam/linux-pam/issues/733