]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
added build option login-lastlogin
authorStefan Schubert <schubi@suse.de>
Fri, 2 Feb 2024 17:46:40 +0000 (18:46 +0100)
committerStefan Schubert <schubi@suse.de>
Fri, 2 Feb 2024 17:46:40 +0000 (18:46 +0100)
configure.ac
login-utils/login.c
meson.build
meson_options.txt

index b6434fd0fcb8174f5d37296d84e475dda2a91dce..7a0c4f29170964ce6ca778c041a29016655cf3ad 100644 (file)
@@ -2403,6 +2403,16 @@ AS_IF([test "x$enable_login_stat_mail" = xyes], [
   AC_DEFINE([LOGIN_STAT_MAIL], [1], [Should login stat() the mailbox?])
 ])
 
+AC_ARG_ENABLE([login-lastlog],
+  AS_HELP_STRING([--enable-login-lastlog], [program login writes lastlog entries]),
+  [], [enable_login_lastlogin=no]
+)
+
+AS_IF([test "x$enable_login_lastlogin" != xno], [
+  AC_DEFINE([USE_LOGIN_LASTLOG],
+           [1],
+           [Define if program login writes lastlog entries])
+])
 
 AC_ARG_ENABLE([nologin],
   AS_HELP_STRING([--disable-nologin], [do not build nologin]),
index c8544f6a17cd3e58e73683ade859006e8e596c43..c3fb1b258f8d2f9bcbfbe0e7f09c8475ba899136 100644 (file)
@@ -662,6 +662,7 @@ static void log_audit(struct login_context *cxt, int status)
 # define log_audit(cxt, status)
 #endif                         /* HAVE_LIBAUDIT */
 
+#ifdef USE_LOGIN_LASTLOG
 static void log_lastlog(struct login_context *cxt)
 {
        struct sigaction sa, oldsa_xfsz;
@@ -728,6 +729,9 @@ done:
 
        sigaction(SIGXFSZ, &oldsa_xfsz, NULL);          /* restore original setting */
 }
+#else
+# define log_lastlog(cxt)
+#endif         /* USE_LOGIN_LASTLOG */
 
 /*
  * Update wtmp and utmp logs.
index 05c0c992c0c401eb2fb1bd47b7fee973cb7f8fb4..f3fab22c8691268dcc905f93fb40383ccbb2626e 100644 (file)
@@ -84,6 +84,10 @@ build_liblastlog2 = not get_option('build-liblastlog2').disabled()
 conf.set('HAVE_LIBLASTLOG2', build_liblastlog2 ? 1 : false)
 summary('liblastlog2', build_liblastlog2 ? 'enabled' : 'disabled', section : 'components')
 
+login_lastlogin = get_option('login-lastlogin')
+conf.set('USE_LOGIN_LASTLOG', login_lastlogin ? 1 : false)
+summary('login-lastlogin', login_lastlogin ? 'enabled' : 'disabled', section : 'components')
+
 have_mountfd_api = cc.sizeof('struct mount_attr', prefix : '#include <linux/mount.h>') > 0
 conf.set('HAVE_STRUCT_MOUNT_ATTR', have_mountfd_api ? 1 : false)
 conf.set('HAVE_MOUNTFD_API', have_mountfd_api ? 1 : false)
index b3cdc2dd3e9ba31bc2f49470163476184b5c1b4e..f6d8adfdda906623ed828f23124d755a19849c0e 100644 (file)
@@ -222,3 +222,6 @@ option('pamlibdir', type : 'string',
 option('lastlog-compat-symlink', type : 'boolean',
        value : 'false',
        description : 'create lastlog compat symlink')
+option('login-lastlogin', type : 'boolean',
+       value : 'false',
+       description : 'program login writes lastlog entries')