Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ AC_SUBST([LIBSUBID_ABI_MINOR], [libsubid_abi_minor])
AC_SUBST([LIBSUBID_ABI_MICRO], [libsubid_abi_micro])
AC_SUBST([LIBSUBID_ABI], [libsubid_abi])

dnl Some hacks...
test "x$prefix" = "xNONE" && prefix="/usr"
test "X$prefix" = "X/usr" && exec_prefix=""

AC_USE_SYSTEM_EXTENSIONS

AC_ENABLE_STATIC
Expand Down Expand Up @@ -103,9 +99,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
Expand Down
3 changes: 2 additions & 1 deletion lib/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@

AUTOMAKE_OPTIONS = 1.0 foreign

DEFS =
DEFS = \
-DPATH_PASSWD='"$(bindir)/passwd"'

noinst_LTLIBRARIES = libshadow.la

Expand Down
12 changes: 6 additions & 6 deletions lib/age.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down Expand Up @@ -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");
Expand Down
8 changes: 4 additions & 4 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
EXTRA_DIST = \
.indent.pro

ubindir = ${prefix}/bin
usbindir = ${prefix}/sbin
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the current state of MR, the same exec_prefix will be used for ubindir && bindir

Do we keepubindir and usbindir in such case?
Or they are intentionally separate in Makefile.am so one can use make variables to have different values for ubindir and bindir e.g.

make install ubindir=/tmp/bin usbindir=/tmp/sbin

Otherwise LGTM and +1 for removing hacks :-)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to remove them, but in a separate PR. I'd say even in a separate release, just to make sure we don't break anything at some point.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alejandro-colomar Are you intentionally moving all binaries from "/bin" to "/usr/bin"?
It makes sense to move all of them, but then you should use just standard functionality and completely remove use of ubindir and usbindir.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I want that; however, I'd like the transition to be gradual, to make sure each patch is easy to review for correctness.

ubindir = $(exec_prefix)/bin
usbindir = $(exec_prefix)/sbin
suidperms = 4755
sgidperms = 2755

AM_CPPFLAGS = \
-I${top_srcdir}/lib \
-I$(top_srcdir)/lib \
-I$(top_srcdir) \
-DLOCALEDIR=\"$(datadir)/locale\" \
$(ECONF_CPPFLAGS)
Expand All @@ -24,7 +24,7 @@ AM_CFLAGS = $(LIBBSD_CFLAGS)
#
# also /lib/libshadow.so.x.xx (if any) could be moved to /usr/lib
# and installation would be much simpler (just two directories,
# $prefix/bin and $prefix/sbin, no install-data hacks...)
# $exec_prefix/bin and $exec_prefix/sbin, no install-data hacks...)

bin_PROGRAMS = login
sbin_PROGRAMS = nologin
Expand Down
Loading