summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2014-11-04 16:31:31 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2014-11-04 16:31:31 -0800
commite9d23df81ae6e5beb79237cb13b555ed689b1a76 (patch)
tree51b59a9d0f63e4e9748ff8bc0a0397465ea36b8c
parent929b2f60c36b80b7a8e6237d5e8ccc981a3a1e0d (diff)
Stop disabling utmpx & wtmpx calls when -u & -w arguments are passed
The handling of the -u & -w flags would only set utmp_file & wtmp_file, leaving utmpx_file & wtmpx_file set to NULL, disabling the calls to the code to update those files. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--sessreg.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sessreg.c b/sessreg.c
index 1c13ece..a86724b 100644
--- a/sessreg.c
+++ b/sessreg.c
@@ -217,11 +217,19 @@ main (int argc, char **argv)
wtmp_file = getstring (&argv, &wflag);
if (!strcmp (wtmp_file, "none"))
wtmp_none = 1;
+#if defined(USE_UTMPX) && defined(HAVE_UPDWTMPX)
+ else
+ wtmpx_file = wtmp_file;
+#endif
break;
case 'u':
utmp_file = getstring (&argv, &uflag);
if (!strcmp (utmp_file, "none"))
utmp_none = 1;
+#if defined(USE_UTMPX) && defined(HAVE_UTMPXNAME)
+ else
+ utmpx_file = utmp_file;
+#endif
break;
#ifdef USE_LASTLOG
case 'L':