diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2014-11-04 21:44:05 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2014-11-04 21:44:05 -0800 |
commit | cdc7b575452a621fb467004d607288af6dd4c802 (patch) | |
tree | 594d4901ecdebebb60872b5df86223c4f2c40d32 /config | |
parent | a69c64584f614eeaeac92a068715ced5777b0ec9 (diff) |
Only pass -u & -w args to sessreg if --with-{u,w}tmp-file=path specified
If not specified, let sessreg use its builtin defaults instead of
replicating the logic here (and possibly getting it wrong), especially
since in sessreg-1.0.8 and earlier, using the -u & -w flags forces
the use of the utmp/wtmp code and not the newer utmpx/wtmpx code.
If --without-{u,w}tmp-file or --with-{u,w}tmp-file=none is specified,
pass "none" as arguments to sessreg to disable writing to that file.
v2: better handling of --with & --without arguments when not passing path,
add documentation of the 3 choices to README
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'config')
-rw-r--r-- | config/Makefile.am | 14 | ||||
-rw-r--r-- | config/Xreset.cpp | 2 | ||||
-rw-r--r-- | config/Xstartup.cpp | 2 |
3 files changed, 15 insertions, 3 deletions
diff --git a/config/Makefile.am b/config/Makefile.am index 30e22ea..e1484f1 100644 --- a/config/Makefile.am +++ b/config/Makefile.am @@ -49,8 +49,20 @@ XPMDEFINES = -DXPM -DBITMAPDIR=$(XDM_PIXMAPDIR) -DXDM_PIXMAP=$(XDM_PIXMAP) \ MKTEMP_DEFINES = -DMKTEMP_COMMAND=$(MKTEMP_COMMAND) #endif +if SET_UTMP_FILE +UTMP_CPP_FLAGS = -DUTMP_FILE="$(UTMP_FILE)" -DUTMP_FLAG="-u $(UTMP_FILE)" +else +UTMP_CPP_FLAGS = -DUTMP_FILE="" -DUTMP_FLAG="" +endif + +if SET_WTMP_FILE +WTMP_CPP_FLAGS = -DWTMP_FILE="$(WTMP_FILE)" -DWTMP_FLAG="-w $(WTMP_FILE)" +else +WTMP_CPP_FLAGS = -DWTMP_FILE="" -DWTMP_FLAG="" +endif + CPP_FILES_FLAGS = -DBINDIR="$(bindir)" -DDEFAULTVT="$(DEFAULTVT)" \ - -DUTMP_FILE="$(UTMP_FILE)" -DWTMP_FILE="$(WTMP_FILE)" \ + $(UTMP_CPP_FLAGS) $(WTMP_CPP_FLAGS) \ -DXDMDIR="$(XDMLIBDIR)" -DXDMLOGDIR="$(XDMLOGDIR)" \ -DXDMXAUTHDIR="$(XDMXAUTHDIR)" \ -DXDMPIDDIR="$(XDMPIDDIR)" -DXDMCONFIGDIR="$(XDMCONFIGDIR)" \ diff --git a/config/Xreset.cpp b/config/Xreset.cpp index 321cd89..5327402 100644 --- a/config/Xreset.cpp +++ b/config/Xreset.cpp @@ -1,5 +1,5 @@ XCOMM!/bin/sh XCOMM Deregister a login. (Derived from TakeConsole as follows:) XCOMM -BINDIR/sessreg -d -w WTMP_FILE -u UTMP_FILE \ +BINDIR/sessreg -d WTMP_FLAG UTMP_FLAG \ -x XDMCONFIGDIR/Xservers -l $DISPLAY -h "" $USER diff --git a/config/Xstartup.cpp b/config/Xstartup.cpp index 001cef2..9329460 100644 --- a/config/Xstartup.cpp +++ b/config/Xstartup.cpp @@ -1,5 +1,5 @@ XCOMM!/bin/sh XCOMM Register a login (derived from GiveConsole as follows:) XCOMM -exec BINDIR/sessreg -a -w WTMP_FILE -u UTMP_FILE \ +exec BINDIR/sessreg -a WTMP_FLAG UTMP_FLAG \ -x XDMCONFIGDIR/Xservers -l $DISPLAY -h "" $USER |