From 01d39fc6201cab39a93a2e2cea39266b391b0fc1 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Wed, 31 Dec 2025 15:15:53 +0100 Subject: [PATCH 1/2] configure.ac, lib/Makefile.am: Respect $(bindir) in PASSWD_PROGRAM Suggested-by: Evgeny Grin (Karlson2k) Signed-off-by: Alejandro Colomar --- configure.ac | 3 --- lib/Makefile.am | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index c01264c004..e2bcf4b87e 100644 --- a/configure.ac +++ b/configure.ac @@ -97,9 +97,6 @@ done]) AC_DEFINE_UNQUOTED([FAILLOG_FILE], ["$shadow_cv_logdir/faillog"], [Path for faillog file.]) -AC_DEFINE_UNQUOTED([PASSWD_PROGRAM], ["$exec_prefix/bin/passwd"], - [Path to passwd program.]) - AC_ARG_ENABLE([shadowgrp], [AS_HELP_STRING([--enable-shadowgrp], [enable shadow group support @<:@default=yes@:>@])], [case "${enableval}" in diff --git a/lib/Makefile.am b/lib/Makefile.am index 7c488f8266..dcbd4beaac 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -1,7 +1,8 @@ AUTOMAKE_OPTIONS = 1.0 foreign -DEFS = +DEFS = \ + -DPASSWD_PROGRAM='"$(bindir)/passwd"' noinst_LTLIBRARIES = libshadow.la From 33485016d6de8c68da822ec1bd787f833c1ded20 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Wed, 31 Dec 2025 19:09:04 +0100 Subject: [PATCH 2/2] lib/: Rename PASSWD_PROGRAM => PATH_PASSWD For consistency with definitions. Signed-off-by: Alejandro Colomar --- lib/Makefile.am | 2 +- lib/age.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/Makefile.am b/lib/Makefile.am index dcbd4beaac..b8802fd687 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -2,7 +2,7 @@ AUTOMAKE_OPTIONS = 1.0 foreign DEFS = \ - -DPASSWD_PROGRAM='"$(bindir)/passwd"' + -DPATH_PASSWD='"$(bindir)/passwd"' noinst_LTLIBRARIES = libshadow.la diff --git a/lib/age.c b/lib/age.c index bdb789e30d..a0a12e6261 100644 --- a/lib/age.c +++ b/lib/age.c @@ -23,11 +23,11 @@ #include "shadow/gshadow/endsgent.h" -#ident "$Id$" - -#ifndef PASSWD_PROGRAM -#define PASSWD_PROGRAM "/bin/passwd" +#ifndef PATH_PASSWD +#define PATH_PASSWD "/bin/passwd" #endif + + /* * expire - force password change if password expired * @@ -116,9 +116,9 @@ int expire (const struct passwd *pw, /*@null@*/const struct spwd *sp) _exit (126); } - (void) execl (PASSWD_PROGRAM, PASSWD_PROGRAM, pw->pw_name, (char *) NULL); + (void) execl(PATH_PASSWD, PATH_PASSWD, pw->pw_name, (char *) NULL); err = errno; - perror ("Can't execute " PASSWD_PROGRAM); + perror("Can't execute " PATH_PASSWD); _exit ((ENOENT == err) ? E_CMD_NOTFOUND : E_CMD_NOEXEC); } else if ((pid_t) -1 == pid) { perror ("fork");