2006-12-06 17:26:54 -06:00
|
|
|
|
|
|
|
if BUILD_LAST
|
2009-07-03 18:18:01 -05:00
|
|
|
usrbin_exec_PROGRAMS += last
|
2021-03-26 05:49:59 -05:00
|
|
|
MANPAGES += login-utils/last.1
|
|
|
|
MANLINKS += login-utils/lastb.1
|
2014-11-19 04:54:47 -06:00
|
|
|
last_SOURCES = login-utils/last.c lib/monotonic.c
|
2015-03-06 07:20:19 -06:00
|
|
|
last_LDADD = $(LDADD) libcommon.la $(REALTIME_LIBS)
|
2013-08-06 11:19:37 -05:00
|
|
|
|
|
|
|
install-exec-hook-last:
|
2013-09-27 07:02:58 -05:00
|
|
|
cd $(DESTDIR)$(usrbin_execdir) && ln -sf last lastb
|
2013-08-06 11:19:37 -05:00
|
|
|
|
|
|
|
INSTALL_EXEC_HOOKS += install-exec-hook-last
|
2020-07-08 17:13:40 -05:00
|
|
|
|
|
|
|
if FUZZING_ENGINE
|
|
|
|
check_PROGRAMS += test_last_fuzz
|
|
|
|
|
|
|
|
# https://google.github.io/oss-fuzz/getting-started/new-project-guide/#Requirements
|
|
|
|
nodist_EXTRA_test_last_fuzz_SOURCES = dummy.cxx
|
|
|
|
|
|
|
|
test_last_fuzz_SOURCES = login-utils/last.c
|
|
|
|
test_last_fuzz_CFLAGS = $(AM_CFLAGS) -DFUZZ_TARGET
|
ci: deal with uninstrumented binaries using instrumented libs
All `eject` tests were failing under ASan, since they call /bin/mount,
which is uninstrumented, but it picks up the instrumented `libblkid`
library, causing ASan to complain:
gcc:
ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
eject: unmount of `/home/runner/work/util-linux/util-linux/tests/output/eject/umount-by-disk-mounted-mnt' failed
clang:
/bin/umount: symbol lookup error: /home/runner/work/util-linux/util-linux/.libs/libblkid.so.1: undefined symbol: __sancov_lowest_stack
eject: unmount of `/home/runner/work/util-linux/util-linux/tests/output/eject/umount-by-disk-mounted-mnt' failed
Subsequently, all tests which require the `scsi_debug` module get skipped,
since it's still in use due to the failed umount:
fdisk: align 512/4K ... SKIPPED (cannot remove scsi_debug module (rmmod))
fdisk: align 512/4K +alignment_offset ... SKIPPED (cannot remove scsi_debug module (rmmod))
fdisk: align 512/4K +MD ... SKIPPED (cannot remove scsi_debug module (rmmod))
In case of gcc this can be easily resolved by setting $LD_PRELOAD to the
respective ASan library. clang makes this a bit more difficult, since it
compiles the ASan library statically, so firstly we need to force dynamic
linking (via -shared-asan), and then add the runtime DSO path to the
linker cache, since it's in a non-standard path.
2021-01-29 15:01:02 -06:00
|
|
|
test_last_fuzz_LDFLAGS = -lpthread
|
2020-07-08 17:13:40 -05:00
|
|
|
test_last_fuzz_LDADD = $(LDADD) libcommon.la $(LIB_FUZZING_ENGINE)
|
|
|
|
endif
|
|
|
|
|
2006-12-06 17:26:54 -06:00
|
|
|
endif
|
|
|
|
|
2012-03-12 09:16:09 -05:00
|
|
|
if BUILD_SULOGIN
|
|
|
|
sbin_PROGRAMS += sulogin
|
2021-03-26 05:49:59 -05:00
|
|
|
MANPAGES += login-utils/sulogin.8
|
2012-05-30 09:10:11 -05:00
|
|
|
sulogin_SOURCES = \
|
2012-12-23 15:14:21 -06:00
|
|
|
login-utils/sulogin.c \
|
|
|
|
login-utils/sulogin-consoles.c \
|
2020-11-17 04:27:48 -06:00
|
|
|
login-utils/sulogin-consoles.h
|
|
|
|
if USE_PLYMOUTH_SUPPORT
|
|
|
|
sulogin_SOURCES += lib/plymouth-ctrl.c
|
|
|
|
endif
|
2012-07-09 09:23:51 -05:00
|
|
|
sulogin_LDADD = $(LDADD) libcommon.la
|
2012-12-23 15:14:21 -06:00
|
|
|
|
2012-03-12 09:16:09 -05:00
|
|
|
if HAVE_LIBCRYPT
|
|
|
|
sulogin_LDADD += -lcrypt
|
|
|
|
endif
|
|
|
|
if HAVE_SELINUX
|
|
|
|
sulogin_LDADD += -lselinux
|
|
|
|
endif
|
2012-12-23 15:14:21 -06:00
|
|
|
|
|
|
|
check_PROGRAMS += test_consoles
|
|
|
|
test_consoles_SOURCES = login-utils/sulogin-consoles.c
|
2016-02-22 13:20:14 -06:00
|
|
|
test_consoles_CFLAGS = $(AM_CFLAGS) -DTEST_PROGRAM
|
2016-02-22 12:48:30 -06:00
|
|
|
test_consoles_LDADD = $(LDADD) libcommon.la
|
2012-03-12 09:16:09 -05:00
|
|
|
endif # BUILD_SULOGIN
|
|
|
|
|
2006-12-06 17:26:54 -06:00
|
|
|
|
2012-05-29 07:14:38 -05:00
|
|
|
if BUILD_LOGIN
|
|
|
|
bin_PROGRAMS += login
|
2021-03-26 05:49:59 -05:00
|
|
|
MANPAGES += login-utils/login.1
|
2012-05-29 07:14:38 -05:00
|
|
|
login_SOURCES = \
|
2012-05-30 09:10:11 -05:00
|
|
|
login-utils/login.c \
|
|
|
|
login-utils/logindefs.c \
|
2012-06-04 03:36:37 -05:00
|
|
|
login-utils/logindefs.h
|
2014-12-09 20:40:31 -06:00
|
|
|
login_LDADD = $(LDADD) libcommon.la -lpam
|
|
|
|
if HAVE_LINUXPAM
|
|
|
|
login_LDADD += -lpam_misc
|
|
|
|
endif
|
2012-05-29 07:14:38 -05:00
|
|
|
if HAVE_AUDIT
|
|
|
|
login_LDADD += -laudit
|
|
|
|
endif
|
|
|
|
if HAVE_SELINUX
|
|
|
|
login_LDADD += -lselinux
|
|
|
|
endif
|
2019-09-03 08:04:43 -05:00
|
|
|
if HAVE_ECONF
|
|
|
|
login_LDADD += -leconf
|
|
|
|
endif
|
2012-05-29 07:14:38 -05:00
|
|
|
endif # BUILD_LOGIN
|
|
|
|
|
|
|
|
|
2013-09-30 06:36:26 -05:00
|
|
|
if BUILD_NOLOGIN
|
|
|
|
sbin_PROGRAMS += nologin
|
2021-03-26 05:49:59 -05:00
|
|
|
MANPAGES += login-utils/nologin.8
|
2013-09-30 06:36:26 -05:00
|
|
|
nologin_SOURCES = login-utils/nologin.c
|
2020-11-06 04:43:18 -06:00
|
|
|
nologin_LDADD = $(LDADD) libcommon.la
|
2013-09-30 06:36:26 -05:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
2012-06-29 09:34:46 -05:00
|
|
|
if BUILD_UTMPDUMP
|
|
|
|
usrbin_exec_PROGRAMS += utmpdump
|
2021-03-26 05:49:59 -05:00
|
|
|
MANPAGES += login-utils/utmpdump.1
|
2012-06-29 09:34:46 -05:00
|
|
|
utmpdump_SOURCES = login-utils/utmpdump.c
|
2016-05-15 04:25:48 -05:00
|
|
|
utmpdump_LDADD = $(LDADD) libcommon.la
|
2012-06-29 09:34:46 -05:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
2012-05-29 07:41:01 -05:00
|
|
|
if BUILD_CHFN_CHSH
|
|
|
|
usrbin_exec_PROGRAMS += chfn chsh
|
2021-03-26 05:49:59 -05:00
|
|
|
MANPAGES += \
|
2012-05-30 09:10:11 -05:00
|
|
|
login-utils/chfn.1 \
|
|
|
|
login-utils/chsh.1
|
2012-05-29 07:41:01 -05:00
|
|
|
|
2014-12-14 15:38:56 -06:00
|
|
|
chfn_chsh_sources = \
|
|
|
|
login-utils/ch-common.h \
|
|
|
|
login-utils/ch-common.c
|
2012-05-29 07:41:01 -05:00
|
|
|
chfn_chsh_cflags = $(SUID_CFLAGS) $(AM_CFLAGS)
|
|
|
|
chfn_chsh_ldflags = $(SUID_LDFLAGS) $(AM_LDFLAGS)
|
2017-04-23 12:51:51 -05:00
|
|
|
chfn_chsh_ldadd = libcommon.la $(READLINE_LIBS)
|
2013-02-13 06:44:34 -06:00
|
|
|
|
|
|
|
if CHFN_CHSH_PASSWORD
|
2014-12-09 20:40:31 -06:00
|
|
|
chfn_chsh_ldadd += -lpam
|
|
|
|
if HAVE_LINUXPAM
|
|
|
|
chfn_chsh_ldadd += -lpam_misc
|
|
|
|
endif
|
2013-02-13 06:44:34 -06:00
|
|
|
chfn_chsh_sources += \
|
|
|
|
login-utils/auth.c \
|
|
|
|
login-utils/auth.h
|
2014-12-09 20:40:31 -06:00
|
|
|
endif # CHFN_CHSH_PASSWORD
|
2012-05-29 07:41:01 -05:00
|
|
|
|
2013-02-07 00:22:18 -06:00
|
|
|
if HAVE_USER
|
|
|
|
chfn_chsh_ldflags += $(LIBUSER_LIBS)
|
|
|
|
chfn_chsh_cflags += $(LIBUSER_CFLAGS)
|
2013-02-07 00:22:20 -06:00
|
|
|
chfn_chsh_sources+= \
|
|
|
|
login-utils/libuser.c \
|
|
|
|
login-utils/libuser.h
|
2013-02-13 06:44:34 -06:00
|
|
|
else
|
|
|
|
chfn_chsh_sources += \
|
|
|
|
login-utils/islocal.c \
|
|
|
|
login-utils/islocal.h \
|
|
|
|
login-utils/setpwnam.c \
|
|
|
|
login-utils/setpwnam.h
|
2013-02-07 00:22:18 -06:00
|
|
|
endif
|
|
|
|
|
2012-05-29 07:41:01 -05:00
|
|
|
if HAVE_SELINUX
|
2012-05-30 09:10:11 -05:00
|
|
|
chfn_chsh_sources += \
|
2021-01-13 06:30:31 -06:00
|
|
|
lib/selinux-utils.c \
|
|
|
|
include/selinux-utils.h
|
2012-05-29 07:41:01 -05:00
|
|
|
chfn_chsh_ldadd += -lselinux
|
|
|
|
endif
|
|
|
|
|
2014-12-14 10:45:50 -06:00
|
|
|
chfn_SOURCES = \
|
|
|
|
login-utils/chfn.c \
|
|
|
|
login-utils/logindefs.c \
|
|
|
|
login-utils/logindefs.h \
|
|
|
|
$(chfn_chsh_sources)
|
2012-05-29 07:41:01 -05:00
|
|
|
chfn_CFLAGS = $(chfn_chsh_cflags)
|
|
|
|
chfn_LDFLAGS = $(chfn_chsh_ldflags)
|
2012-07-09 09:23:51 -05:00
|
|
|
chfn_LDADD = $(LDADD) $(chfn_chsh_ldadd)
|
2019-09-03 08:04:43 -05:00
|
|
|
if HAVE_ECONF
|
|
|
|
chfn_LDADD += -leconf
|
|
|
|
endif
|
2012-05-29 07:41:01 -05:00
|
|
|
|
2012-05-30 09:10:11 -05:00
|
|
|
chsh_SOURCES = login-utils/chsh.c $(chfn_chsh_sources)
|
2012-05-29 07:41:01 -05:00
|
|
|
chsh_CFLAGS = $(chfn_chsh_cflags)
|
|
|
|
chsh_LDFLAGS = $(chfn_chsh_ldflags)
|
2012-07-09 09:23:51 -05:00
|
|
|
chsh_LDADD = $(LDADD) $(chfn_chsh_ldadd)
|
2012-05-29 07:41:01 -05:00
|
|
|
endif # BUILD_CHFN_CHSH
|
|
|
|
|
|
|
|
|
2012-05-29 07:54:06 -05:00
|
|
|
if BUILD_SU
|
2012-05-29 07:14:38 -05:00
|
|
|
bin_PROGRAMS += su
|
2021-03-26 05:49:59 -05:00
|
|
|
MANPAGES += login-utils/su.1
|
2012-05-29 07:54:06 -05:00
|
|
|
su_SOURCES = \
|
2012-05-30 09:10:11 -05:00
|
|
|
login-utils/su.c \
|
2012-08-28 11:10:58 -05:00
|
|
|
login-utils/su-common.c \
|
|
|
|
login-utils/su-common.h \
|
2012-05-30 09:10:11 -05:00
|
|
|
login-utils/logindefs.c \
|
|
|
|
login-utils/logindefs.h
|
2016-10-03 09:56:56 -05:00
|
|
|
su_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
|
2012-05-29 07:54:06 -05:00
|
|
|
su_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
|
2016-10-03 09:56:56 -05:00
|
|
|
su_LDADD = $(LDADD) libcommon.la -lpam
|
2014-12-09 20:40:31 -06:00
|
|
|
if HAVE_LINUXPAM
|
|
|
|
su_LDADD += -lpam_misc
|
2012-05-29 07:54:06 -05:00
|
|
|
endif
|
2019-07-04 04:59:23 -05:00
|
|
|
if HAVE_PTY
|
|
|
|
su_SOURCES += lib/pty-session.c \
|
2019-08-08 08:08:14 -05:00
|
|
|
include/pty-session.h \
|
|
|
|
lib/monotonic.c
|
|
|
|
su_LDADD += -lutil $(REALTIME_LIBS)
|
2017-08-17 09:09:52 -05:00
|
|
|
endif
|
2019-09-03 08:04:43 -05:00
|
|
|
if HAVE_ECONF
|
|
|
|
su_LDADD += -leconf
|
|
|
|
endif
|
2014-12-09 20:40:31 -06:00
|
|
|
endif # BUILD_SU
|
2012-05-29 07:54:06 -05:00
|
|
|
|
2012-05-30 09:10:11 -05:00
|
|
|
|
2012-08-29 10:34:26 -05:00
|
|
|
if BUILD_RUNUSER
|
2012-11-01 06:01:52 -05:00
|
|
|
sbin_PROGRAMS += runuser
|
2021-03-26 05:49:59 -05:00
|
|
|
MANPAGES += login-utils/runuser.1
|
2012-08-29 10:34:26 -05:00
|
|
|
runuser_SOURCES = \
|
|
|
|
login-utils/runuser.c \
|
|
|
|
login-utils/su-common.c \
|
|
|
|
login-utils/su-common.h \
|
|
|
|
login-utils/logindefs.c \
|
|
|
|
login-utils/logindefs.h
|
2016-10-03 09:56:56 -05:00
|
|
|
runuser_LDADD = $(LDADD) libcommon.la -lpam
|
2014-12-09 20:40:31 -06:00
|
|
|
if HAVE_LINUXPAM
|
|
|
|
runuser_LDADD += -lpam_misc
|
2012-08-29 10:34:26 -05:00
|
|
|
endif
|
2019-07-04 04:59:23 -05:00
|
|
|
if HAVE_PTY
|
|
|
|
runuser_SOURCES += lib/pty-session.c \
|
2019-08-08 08:08:14 -05:00
|
|
|
include/pty-session.h \
|
|
|
|
lib/monotonic.c
|
|
|
|
runuser_LDADD += -lutil $(REALTIME_LIBS)
|
2017-08-27 15:25:03 -05:00
|
|
|
endif
|
2019-09-03 08:04:43 -05:00
|
|
|
if HAVE_ECONF
|
|
|
|
runuser_LDADD += -leconf
|
|
|
|
endif
|
2014-12-09 20:40:31 -06:00
|
|
|
endif # BUILD_RUNUSER
|
2012-08-29 10:34:26 -05:00
|
|
|
|
|
|
|
|
2012-05-29 08:15:38 -05:00
|
|
|
if BUILD_NEWGRP
|
|
|
|
usrbin_exec_PROGRAMS += newgrp
|
2021-03-26 05:49:59 -05:00
|
|
|
MANPAGES += login-utils/newgrp.1
|
2012-05-30 09:10:11 -05:00
|
|
|
newgrp_SOURCES = login-utils/newgrp.c
|
2012-05-29 08:15:38 -05:00
|
|
|
newgrp_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
|
|
|
|
newgrp_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
|
2012-07-09 09:23:51 -05:00
|
|
|
newgrp_LDADD = $(LDADD)
|
2012-05-29 08:15:38 -05:00
|
|
|
if HAVE_LIBCRYPT
|
|
|
|
newgrp_LDADD += -lcrypt
|
|
|
|
endif
|
|
|
|
endif # BUILD_NEWGRP
|
|
|
|
|
2014-04-07 11:24:19 -05:00
|
|
|
if BUILD_LSLOGINS
|
|
|
|
usrbin_exec_PROGRAMS += lslogins
|
2021-03-26 05:49:59 -05:00
|
|
|
MANPAGES += login-utils/lslogins.1
|
2014-04-07 11:24:19 -05:00
|
|
|
lslogins_SOURCES = \
|
|
|
|
login-utils/lslogins.c \
|
|
|
|
login-utils/logindefs.c \
|
|
|
|
login-utils/logindefs.h
|
|
|
|
lslogins_LDADD = $(LDADD) libcommon.la libsmartcols.la
|
|
|
|
lslogins_CFLAGS = $(AM_CFLAGS) -I$(ul_libsmartcols_incdir)
|
|
|
|
if HAVE_SELINUX
|
|
|
|
lslogins_LDADD += -lselinux
|
|
|
|
endif
|
2014-05-27 10:34:15 -05:00
|
|
|
if HAVE_SYSTEMD
|
|
|
|
lslogins_LDADD += $(SYSTEMD_LIBS) $(SYSTEMD_JOURNAL_LIBS)
|
|
|
|
lslogins_CFLAGS += $(SYSTEMD_CFLAGS) $(SYSTEMD_JOURNAL_CFLAGS)
|
|
|
|
endif
|
2019-09-03 08:04:43 -05:00
|
|
|
if HAVE_ECONF
|
|
|
|
lslogins_LDADD += -leconf
|
|
|
|
endif
|
2014-04-07 11:24:19 -05:00
|
|
|
endif # BUILD_LSLOGINS
|
2012-05-29 07:54:06 -05:00
|
|
|
|
2012-05-29 08:20:44 -05:00
|
|
|
if BUILD_VIPW
|
|
|
|
usrsbin_exec_PROGRAMS += vipw
|
2021-03-26 05:57:07 -05:00
|
|
|
MANPAGES += login-utils/vipw.8
|
2021-03-26 05:49:59 -05:00
|
|
|
MANLINKS += login-utils/vigr.8
|
2012-02-08 02:51:34 -06:00
|
|
|
vipw_SOURCES = \
|
2012-05-30 09:10:11 -05:00
|
|
|
login-utils/vipw.c \
|
2012-06-04 03:36:37 -05:00
|
|
|
login-utils/setpwnam.h
|
2012-07-09 09:23:51 -05:00
|
|
|
vipw_LDADD = $(LDADD) libcommon.la
|
2006-12-06 17:26:54 -06:00
|
|
|
if HAVE_SELINUX
|
|
|
|
vipw_LDADD += -lselinux
|
|
|
|
endif
|
2012-05-30 09:10:11 -05:00
|
|
|
install-exec-hook-vipw::
|
|
|
|
cd $(DESTDIR)$(usrsbin_execdir) && ln -sf vipw vigr
|
|
|
|
|
|
|
|
INSTALL_EXEC_HOOKS += install-exec-hook-vipw
|
2012-05-29 08:20:44 -05:00
|
|
|
endif # BUILD_VIPW
|
2006-12-06 17:26:54 -06:00
|
|
|
|
|
|
|
|
2012-07-30 10:59:16 -05:00
|
|
|
check_PROGRAMS += \
|
2012-05-30 09:10:11 -05:00
|
|
|
test_islocal \
|
|
|
|
test_logindefs
|
|
|
|
|
|
|
|
test_islocal_SOURCES = login-utils/islocal.c
|
2011-10-04 16:45:45 -05:00
|
|
|
test_islocal_CPPFLAGS = -DTEST_PROGRAM $(AM_CPPFLAGS)
|
2011-10-05 05:10:26 -05:00
|
|
|
|
2012-05-30 09:10:11 -05:00
|
|
|
test_logindefs_SOURCES = \
|
|
|
|
login-utils/logindefs.c \
|
|
|
|
login-utils/logindefs.h
|
2011-10-05 05:10:26 -05:00
|
|
|
test_logindefs_CPPFLAGS = -DTEST_PROGRAM $(AM_CPPFLAGS)
|
2020-05-26 04:43:07 -05:00
|
|
|
test_logindefs_LDADD = $(LDADD) libcommon.la
|
2019-09-03 08:04:43 -05:00
|
|
|
if HAVE_ECONF
|
2020-05-26 04:43:07 -05:00
|
|
|
test_logindefs_LDADD += -leconf
|
2019-09-03 08:04:43 -05:00
|
|
|
endif
|
2012-06-05 10:38:09 -05:00
|
|
|
|
|
|
|
|
|
|
|
install-exec-hook:
|
|
|
|
if BUILD_SU
|
2017-06-21 04:12:04 -05:00
|
|
|
if MAKEINSTALL_DO_CHOWN
|
2017-06-20 06:12:43 -05:00
|
|
|
chown root:root $(DESTDIR)$(bindir)/su
|
2017-06-21 04:12:04 -05:00
|
|
|
endif
|
|
|
|
if MAKEINSTALL_DO_SETUID
|
2012-06-05 10:38:09 -05:00
|
|
|
chmod 4755 $(DESTDIR)$(bindir)/su
|
|
|
|
endif
|
|
|
|
endif
|