[PATCH:sessreg 4/5] Stop disabling utmpx & wtmpx calls when -u & -w arguments are passed

Alan Coopersmith alan.coopersmith at oracle.com
Tue Nov 4 19:13:25 PST 2014


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 at oracle.com>
---
 sessreg.c |    8 ++++++++
 1 file changed, 8 insertions(+)

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':
-- 
1.7.9.2



More information about the xorg-devel mailing list