| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
doc/specs/formatter/.gitignore became irrelevant along with the whole
doc/specs/formatter directory after commit
96eb2dc401f785e2b35a2089dda24416ff9bb305 back in 2005.
|
|
|
|
|
|
|
|
| |
As crypt_r is expected to return a pointer into a provided crypt_data
struct, callers should not modify the string returned by crypt_r after
freeing the corresponding crypt_data struct.
Co-authored-by: Dmitry V. Levin <ldv@strace.io>
|
|
|
|
|
|
|
| |
The utmp database is unreliable for counting logged in users, since
there is no standard which defines who should create an entry at which
time for which reason. And it has a Y2038 problem with glibc/x86-64.
Query systemd-logind for the number of user sessions instead.
|
|
|
|
|
|
|
|
| |
Since systemd added new types of classes (e.g. manager*), we cannot
use the count of all sessions anymore, but have to check which class
this is.
This is backward compatible, systemd v209 or newer is required.
|
|
|
|
| |
This simplifies integration of xtests into test frameworks.
|
| |
|
|
|
|
|
|
| |
The code there cannot be compiled at least since introduction
of autotools build system by commit
23624ea6f78ec8acc167a2491c00998907fc76b1 back in 2005.
|
|
|
|
|
|
|
|
|
|
|
| |
Following the recent news about the latest change of the FSF postal address,
replace the FSF postal address in the GNU GPL license notice with the URL.
Apparently, "Information for maintainers of GNU Software" for quite
a long time suggests using the URL instead of the postal address.
Link: https://lists.gnu.org/archive/html/info-gnu/2024-09/msg00000.html
Link: https://www.gnu.org/prep/maintain/html_node/License-Notices-for-Code.html
|
|
|
|
|
|
| |
As the script is for autotools-based builds, give it a more descriptive
name, so it wouldn't be confused with build scripts for other build
systems.
|
|
|
|
| |
Make sure that config.h is included before any system header.
|
|
|
|
|
| |
Given that pam_fail_delay is always provided by libpam, checking for
HAVE_PAM_FAIL_DELAY may have any sense only in third-party modules.
|
|
|
|
|
|
|
|
| |
Given that in most places config.h is included unconditionally,
there is no point in keeping remaining HAVE_CONFIG_H checks.
Public header files do not use config.h and therefore
are not affected by this change anyway.
|
|
|
|
|
|
|
|
| |
Commit 95b464f8417d ("configure.ac: add --with-systemdunitdir option")
aka v1.5.2~51 introduced a regression: if --with-systemdunitdir is not
specified, then the pam_namespace service file is no longer installed.
Fixes: 95b464f8417d ("configure.ac: add --with-systemdunitdir option")
|
|
|
|
|
| |
... for the same reason SCONFIGDIR config.h macro was renamed to
SCONFIG_DIR.
|
|
|
|
|
|
|
| |
This way it is visibly different from the configure variable SCONFIGDIR,
which is helpful, because their values are slightly different:
the macro is quoted while the configure variable is not quoted,
and this difference may cause problems with other build systems.
|
|
|
|
|
|
|
|
|
|
| |
* doc/custom-html.xsl.in: Remove.
* configure.ac: Do not generate doc/custom-html.xsl file.
* doc/.gitignore: Remove custom-html.xsl.
* doc/Makefile.am (DISTCLEANFILES): Remove custom-html.xsl.
(EXTRA_DIST): Remove custom-html.xsl.in.
Complements: cf2fc5ff7b4a ("doc: Update PAM documentation from DockBook 4 to DocBook 5")
|
|
|
|
|
| |
* modules/pam_env/Makefile.am (AM_CFLAGS): Remove second
-I$(top_srcdir)/libpam_internal/include.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Unhardcode ".libs" subdirectory where libtool stores shared objects,
as other build systems doesn't necessarily use it.
* configure.ac (AC_DEFINE_UNQUOTED): Add LTDIR.
* modules/pam_canonicalize_user/tst-pam_canonicalize_user-retval.c:
Replace ".libs/" with LTDIR.
* modules/pam_debug/tst-pam_debug-retval.c: Likewise.
* modules/pam_deny/tst-pam_deny-retval.c: Likewise.
* modules/pam_echo/tst-pam_echo-retval.c: Likewise.
* modules/pam_env/tst-pam_env-retval.c: Likewise.
* modules/pam_faildelay/tst-pam_faildelay-retval.c: Likewise.
* modules/pam_faillock/tst-pam_faillock-retval.c: Likewise.
* modules/pam_listfile/tst-pam_listfile-retval.c: Likewise.
* modules/pam_localuser/tst-pam_localuser-retval.c: Likewise.
* modules/pam_mkhomedir/tst-pam_mkhomedir-retval.c: Likewise.
* modules/pam_nologin/tst-pam_nologin-retval.c: Likewise.
* modules/pam_permit/tst-pam_permit-retval.c: Likewise.
* modules/pam_pwhistory/tst-pam_pwhistory-retval.c: Likewise.
* modules/pam_rootok/tst-pam_rootok-retval.c: Likewise.
* modules/pam_sepermit/tst-pam_sepermit-retval.c: Likewise.
* modules/pam_succeed_if/tst-pam_succeed_if-retval.c: Likewise.
* modules/pam_time/tst-pam_time-retval.c: Likewise.
* modules/pam_warn/tst-pam_warn-retval.c: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Do not include <libintl.h> and other i18n stuff via config.h which is
included into every compilation unit, include "pam_i18n.h" explicitly
where necessary.
* configure.ac (AH_BOTTOM): Remove.
* libpam/pam_get_authtok.c: Include "pam_i18n.h".
* libpam/pam_item.c: Likewise.
* libpam/pam_strerror.c: Likewise.
* libpam_misc/misc_conv.c: Likewise.
* modules/pam_exec/pam_exec.c: Likewise.
* modules/pam_faillock/main.c: Likewise.
* modules/pam_faillock/pam_faillock.c: Likewise.
* modules/pam_lastlog/pam_lastlog.c: Likewise.
* modules/pam_limits/pam_limits.c: Likewise.
* modules/pam_mail/pam_mail.c: Likewise.
* modules/pam_mkhomedir/pam_mkhomedir.c: Likewise.
* modules/pam_pwhistory/pam_pwhistory.c: Likewise.
* modules/pam_selinux/pam_selinux.c: Likewise.
* modules/pam_selinux/pam_selinux_check.c: Likewise.
* modules/pam_timestamp/pam_timestamp.c: Likewise.
* modules/pam_unix/pam_unix_acct.c: Likewise.
* modules/pam_unix/pam_unix_passwd.c: Likewise.
* modules/pam_userdb/pam_userdb.c: Likewise.
|
|
|
|
|
|
|
|
|
|
| |
Introduce a new internal header file that is going to be used for
i18n definitions instead of providing those definitions via config.h.
providing convenient assertion testing functionality.
* libpam/include/pam_i18n.h: New file.
* libpam/Makefile.am (noinst_HEADERS): Add include/pam_i18n.h.
|
|
|
|
|
|
| |
As the first header included by pam_private.h is config.h,
there is no need to include config.h explicitly right before
pam_private.h
|
|
|
|
|
|
|
|
| |
The includedir variable in pkgconfig files used to erroneously contain
"security" subsirectory, e.g. /usr/include/security, which led to Cflags
tag containing wrong -I compiler option, e.g. -I/usr/include/security.
Fixes: b4f0e2e1f7a1 ("Add pkgconfig files for provided libraries")
|
|
|
|
|
| |
* modules/pam_rootok/pam_rootok.c (log_callback) [HAVE_LIBAUDIT]:
Silence compilation warning.
|
|
|
|
|
| |
* modules/pam_faillock/pam_faillock.c (check_tally, write_tally)
[HAVE_LIBAUDIT]: Check audit_log_user_message() return value.
|
|
|
|
|
|
|
|
| |
These macros provide fallback definitions for uid_t, gid_t, off_t,
pid_t, and size_t types which are defined in standard headers anyway.
* configure.ac (AC_TYPE_UID_T, AC_TYPE_OFF_T, AC_TYPE_PID_T,
AC_TYPE_SIZE_T): Remove.
|
|
|
|
|
|
|
| |
According to the GNU Automake manual, this macro is obsolescent,
and its explicit use should no longer be required.
* configure.ac (AM_PROG_CC_C_O): Remove.
|
|
|
|
|
|
|
| |
Given that LN_S defined by AC_PROG_LN_S is not used,
there is no point in using this macro.
* configure.ac (AC_PROG_LN_S): Remove.
|
|
|
|
|
|
|
|
| |
Given that SET_MAKE defined by AC_PROG_MAKE_SET has never been
used directly, and AM_INIT_AUTOMAKE that needs this also calls
AC_PROG_MAKE_SET itself, there is no point in using this macro.
* configure.ac (AC_PROG_MAKE_SET): Remove.
|
|
|
|
|
|
|
|
| |
According to the GNU Autoconf manual, this macro is obsolescent,
since current versions of the GNU C compiler fix the header files
automatically when installed.
* configure.ac (AC_PROG_GCC_TRADITIONAL): Remove.
|
|
|
|
|
|
|
| |
According to the GNU Autoconf manual, this macro is obsolescent,
as current systems have a working 'memcmp'.
* configure.ac (AC_FUNC_MEMCMP): Remove.
|
|
|
|
|
|
|
| |
According to the GNU Autoconf manual, this macro is obsolescent,
as current C compilers support 'const'.
* configure.ac (AC_C_CONST): Remove.
|
|
|
|
|
|
|
| |
Given that GETGROUPS_T defined by AC_TYPE_GETGROUPS has never been
checked, there is no point in using this macro.
* configure.ac (AC_TYPE_GETGROUPS): Remove.
|
|
|
|
|
|
|
|
| |
Given that TM_IN_SYS_TIME that might be defined by AC_STRUCT_TM
has never been checked, there is no point in using this obsolescent
macro.
* configure.ac (AC_STRUCT_TM): Remove.
|
|
|
|
|
|
|
| |
Given that <sys/wait.h> is included unconditionally,
there is no point in using AC_HEADER_SYS_WAIT.
* configure.ac (AC_HEADER_SYS_WAIT): Remove.
|
|
|
|
|
|
|
| |
Given that <dirent.h> is included unconditionally,
there is no point in using AC_HEADER_DIRENT.
* configure.ac (AC_HEADER_DIRENT): Remove.
|
|
|
|
|
|
|
|
|
| |
Given that utmp.h is included unconditionally in other modules,
and neither utmpx.h nor lastlog.h is used nowadays, remove obsolete
checks.
* configure.ac (AC_CHECK_HEADERS): Remove lastlog.h, utmp.h, and utmpx.h.
* modules/pam_lastlog/pam_lastlog.c: Include <utmp.h> unconditionally.
|
|
|
|
|
|
|
|
|
|
|
| |
Extend access.conf(5) syntax to support UID and GID in addition to
user and group names.
Co-authored-by: blueskycs2c <lili.ding@cs2c.com>
Signed-off-by: Dmitry V. Levin <ldv@strace.io>
Resolves: https://github.com/linux-pam/linux-pam/issues/114
Resolves: https://github.com/linux-pam/linux-pam/pull/186
Resolves: https://github.com/linux-pam/linux-pam/pull/601
|
|
|
|
|
|
| |
sign_extend_unsigned_to_ll()
Import these handy macros from strace project.
|
|
|
|
|
|
|
|
|
|
| |
Use the canonical terminal mode (line mode) and set ECHOCTL to prevent
cursor escape from the login prompt using arrows or escape sequences.
ICANON is the default in most cases anyway. ECHOCTL is default on tty, but
for example not on pty, allowing cursor to escape.
Stanislav Brabec <sbrabec@suse.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since audit_log_acct_message() was decorated with warn_unused_result
attribute, compilation of faillock helper produces the following
diagnostics:
main.c: In function 'do_user':
main.c:250:25: warning: ignoring return value of 'audit_log_acct_message' declared with attribute 'warn_unused_result' [-Wunused-result]
Given that this helper has never been picky about audit, e.g.
audit_open() errors do not affect its exit status, just silence this
new warning.
* modules/pam_faillock/main.c [HAVE_LIBAUDIT] (do_user): Silence
compilation warning.
|
|
|
|
|
|
| |
Check for econf_readConfigWithCallback() and use it if available.
Co-authored-by: Dmitry V. Levin <ldv@strace.io>
|
|
|
|
|
|
|
| |
Use this new function instead of econf_readDirs() and
econf_readDirsWithCallback().
Co-authored-by: Dmitry V. Levin <ldv@strace.io>
|
|
|
|
|
| |
This also prevents a possible segfault when pam_set_item tries to
convert an empty service_name to lower case.
|
|
|
|
|
|
| |
Log in case the database could not be initialized.
Include the errno on lookup failure.
|
|
|
|
| |
Log in case the current fscreate context could not be retrieved.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* modules/pam_namespace/pam_namespace.c (create_polydir) [WITH_SELINUX]:
Free SELinux context in case of an error.
```
Error: RESOURCE_LEAK (CWE-772):
Linux-PAM-1.6.0/modules/pam_namespace/pam_namespace.c:1433: alloc_arg: "getfscreatecon_raw" allocates memory that is stored into "oldcon_raw".
Linux-PAM-1.6.0/modules/pam_namespace/pam_namespace.c:1462: leaked_storage: Variable "oldcon_raw" going out of scope leaks the storage it points to.
1460| pam_syslog(idata->pamh, LOG_ERR,
1461| "Error creating directory %s: %m", dir);
1462|-> return PAM_SESSION_ERR;
1463| }
1464|
```
Resolves: https://issues.redhat.com/browse/RHEL-36475
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* modules/pam_namespace/pam_namespace.c [WITH_SELINUX] (form_context):
Free SELinux context before returning.
```
Error: RESOURCE_LEAK (CWE-772):
Linux-PAM-1.6.0/modules/pam_namespace/pam_namespace.c:928: alloc_arg: "getexeccon" allocates memory that is stored into "scon".
Linux-PAM-1.6.0/modules/pam_namespace/pam_namespace.c:1004: leaked_storage: Variable "scon" going out of scope leaks the storage it points to.
1002| }
1003| /* Should never get here */
1004|-> return PAM_SUCCESS;
1005| }
1006| #endif
```
Resolves: https://issues.redhat.com/browse/RHEL-36475
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* modules/pam_timestamp/pam_timestamp.c (pam_sm_authenticate)
[WITH_OPENSSL]: Close the timestamp file if hmac_size returned
an error.
```
Error: RESOURCE_LEAK (CWE-772):
Linux-PAM-1.6.0/modules/pam_timestamp/pam_timestamp.c:450: open_fn: Returning handle opened by "open". [Note: The source code implementation of the function has been overridden by a user model.]
Linux-PAM-1.6.0/modules/pam_timestamp/pam_timestamp.c:450: var_assign: Assigning: "fd" = handle returned from "open(path, 131072)".
Linux-PAM-1.6.0/modules/pam_timestamp/pam_timestamp.c:460: noescape: Resource "fd" is not freed or pointed-to in "fstat".
Linux-PAM-1.6.0/modules/pam_timestamp/pam_timestamp.c:484: leaked_handle: Handle variable "fd" going out of scope leaks the handle.
482| #ifdef WITH_OPENSSL
483| if (hmac_size(pamh, debug, &maclen)) {
484|-> return PAM_AUTH_ERR;
485| }
486| #else
```
Resolves: https://issues.redhat.com/browse/RHEL-36475
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* modules/pam_rootok/pam_rootok.c (log_callback): Close the audit socket
if vasprintf returned an error.
```
Error: RESOURCE_LEAK (CWE-772):
Linux-PAM-1.6.0/modules/pam_rootok/pam_rootok.c:59: open_fn: Returning handle opened by "audit_open".
Linux-PAM-1.6.0/modules/pam_rootok/pam_rootok.c:59: var_assign: Assigning: "audit_fd" = handle returned from "audit_open()".
Linux-PAM-1.6.0/modules/pam_rootok/pam_rootok.c:69: leaked_handle: Handle variable "audit_fd" going out of scope leaks the handle.
67| va_end(ap);
68| if (ret < 0) {
69|-> return 0;
70| }
71| audit_log_user_avc_message(audit_fd, AUDIT_USER_AVC, buf, NULL, NULL,
```
Resolves: https://issues.redhat.com/browse/RHEL-36475
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
|