summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2018-06-07 12:38:22 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2018-06-07 12:38:22 +0000
commit2caa705bebc970e59f2b7500b0b0604cae926ab2 (patch)
tree2c81a780648555eb16aec5adf1b2f39ff6682a74
parent5797f4f3721c8e59b6d6eda169c35c841e97ffaf (diff)
downloadutmps-2caa705bebc970e59f2b7500b0b0604cae926ab2.tar.xz
Add utmpxname, change default socket names, ready for 0.0.1.0
-rw-r--r--COPYING2
-rw-r--r--INSTALL2
-rwxr-xr-xconfigure8
-rw-r--r--doc/index.html6
-rw-r--r--doc/utmps-utmpd.html2
-rw-r--r--doc/utmps-wtmpd.html2
-rw-r--r--package/deps.mak9
-rw-r--r--src/include/utmps/utmpx.h1
-rw-r--r--src/utmps/deps-lib/utmps1
-rw-r--r--src/utmps/utmpxname.c24
10 files changed, 42 insertions, 15 deletions
diff --git a/COPYING b/COPYING
index 9e2739b..361dcb6 100644
--- a/COPYING
+++ b/COPYING
@@ -1,4 +1,4 @@
-Copyright (c) 2017 Laurent Bercot <ska-skaware@skarnet.org>
+Copyright (c) 2018 Laurent Bercot <ska-skaware@skarnet.org>
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
diff --git a/INSTALL b/INSTALL
index 53d90eb..0033850 100644
--- a/INSTALL
+++ b/INSTALL
@@ -6,7 +6,7 @@ Build Instructions
- A POSIX-compliant C development environment
- GNU make version 3.81 or later
- - skalibs version 2.6.1.0 or later: http://skarnet.org/software/skalibs/
+ - skalibs version 2.6.4.0 or later: http://skarnet.org/software/skalibs/
This software will run on any operating system that implements
POSIX.1-2008, available at:
diff --git a/configure b/configure
index f21429a..423c5c1 100755
--- a/configure
+++ b/configure
@@ -45,8 +45,8 @@ Optional features:
--enable-absolute-paths do not rely on PATH to access this package's binaries,
hardcode absolute BINDIR/foobar paths instead [disabled]
- --with-utmp-socket=PATH assume the utmpd socket is at PATH [/run/utmps/utmpd-socket]
- --with-wtmp-socket=PATH assume the wtmpd socket is at PATH [/run/utmps/wtmpd-socket]
+ --with-utmp-socket=PATH assume the utmpd socket is at PATH [/run/utmps/.utmpd-socket]
+ --with-wtmp-socket=PATH assume the wtmpd socket is at PATH [/run/utmps/.wtmpd-socket]
EOF
exit 0
@@ -160,8 +160,8 @@ addlibdpath=''
vpaths=''
vpathd=''
build=
-utmpdpath=/run/utmps/utmpd-socket
-wtmpdpath=/run/utmps/wtmpd-socket
+utmpdpath=/run/utmps/.utmpd-socket
+wtmpdpath=/run/utmps/.wtmpd-socket
for arg ; do
case "$arg" in
diff --git a/doc/index.html b/doc/index.html
index 45027f9..2db9eba 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -20,8 +20,8 @@
<h2> What is it&nbsp;? </h2>
<p>
- utmps is an implementation of the <tt>utmp.h</tt> and <tt>utmpx.h</tt>
-family of functions performing user accounting on Unix systems.
+ utmps is an implementation of the <tt>utmpx.h</tt> family of functions
+performing user accounting on Unix systems.
</p>
<p>
@@ -56,7 +56,7 @@ running utmp functions are just clients to this daemon.
<li> A POSIX-compliant system with a standard C development environment </li>
<li> GNU make, version 3.81 or later </li>
<li> <a href="//skarnet.org/software/skalibs/">skalibs</a> version
-2.6.1.0 or later. It's a build-time requirement. It's also a run-time
+2.6.4.0 or later. It's a build-time requirement. It's also a run-time
requirement if you link against the shared version of the skalibs
library. </li>
</ul>
diff --git a/doc/utmps-utmpd.html b/doc/utmps-utmpd.html
index 57fa6ac..78ca490 100644
--- a/doc/utmps-utmpd.html
+++ b/doc/utmps-utmpd.html
@@ -40,7 +40,7 @@ on how to run such a service.
</p>
<p>
-<tt>/run/utmps/utmpd-socket</tt> is the default place where utmps's
+<tt>/run/utmps/.utmpd-socket</tt> is the default place where utmps's
implementation of the <tt>utmpx.h</tt> functions expects the utmpd
service to be. It can be changed at build time by giving the
<tt>--with-utmp-socket=PATH</tt> option to configure.
diff --git a/doc/utmps-wtmpd.html b/doc/utmps-wtmpd.html
index a1e090b..fb49963 100644
--- a/doc/utmps-wtmpd.html
+++ b/doc/utmps-wtmpd.html
@@ -40,7 +40,7 @@ on how to run such a service.
</p>
<p>
-<tt>/run/utmps/wtmpd-socket</tt> is the default place where utmps's
+<tt>/run/utmps/.wtmpd-socket</tt> is the default place where utmps's
implementation of the <tt>updwtmpx()</tt> function expects the wtmpd
service to be. It can be changed at build time by giving the
<tt>--with-wtmp-socket=PATH</tt> option to configure.
diff --git a/package/deps.mak b/package/deps.mak
index 303fc9c..7d9b6b0 100644
--- a/package/deps.mak
+++ b/package/deps.mak
@@ -12,6 +12,7 @@ src/utmps/getutxline.o src/utmps/getutxline.lo: src/utmps/getutxline.c src/utmps
src/utmps/logwtmp.o src/utmps/logwtmp.lo: src/utmps/logwtmp.c src/include/utmps/utmpx.h
src/utmps/pututxline.o src/utmps/pututxline.lo: src/utmps/pututxline.c src/utmps/utmps-internal.h src/include/utmps/utmps.h src/include/utmps/utmpx.h
src/utmps/setutxent.o src/utmps/setutxent.lo: src/utmps/setutxent.c src/utmps/utmps-internal.h src/include/utmps/utmps.h src/include/utmps/utmpx.h
+src/utmps/updwtmpx.o src/utmps/updwtmpx.lo: src/utmps/updwtmpx.c src/include/utmps/config.h src/include/utmps/utmps.h
src/utmps/utmps-utmpd.o src/utmps/utmps-utmpd.lo: src/utmps/utmps-utmpd.c src/utmps/utmps-internal.h src/include/utmps/utmpx.h
src/utmps/utmps-wtmpd.o src/utmps/utmps-wtmpd.lo: src/utmps/utmps-wtmpd.c src/utmps/utmps-internal.h src/include/utmps/utmpx.h
src/utmps/utmps_end.o src/utmps/utmps_end.lo: src/utmps/utmps_end.c src/include/utmps/utmps.h
@@ -26,15 +27,15 @@ src/utmps/utmps_start.o src/utmps/utmps_start.lo: src/utmps/utmps_start.c src/in
src/utmps/utmps_updwtmpx.o src/utmps/utmps_updwtmpx.lo: src/utmps/utmps_updwtmpx.c src/utmps/utmps-internal.h src/include/utmps/utmps.h src/include/utmps/utmpx.h
src/utmps/utmps_utmpx_pack.o src/utmps/utmps_utmpx_pack.lo: src/utmps/utmps_utmpx_pack.c src/include/utmps/utmpx.h
src/utmps/utmps_utmpx_unpack.o src/utmps/utmps_utmpx_unpack.lo: src/utmps/utmps_utmpx_unpack.c src/include/utmps/utmpx.h
-src/utmps/updwtmpx.o src/utmps/updwtmpx.lo: src/utmps/updwtmpx.c src/include/utmps/config.h src/include/utmps/utmps.h
+src/utmps/utmpxname.o src/utmps/utmpxname.lo: src/utmps/utmpxname.c src/include/utmps/utmpx.h
ifeq ($(strip $(STATIC_LIBS_ARE_PIC)),)
-libutmps.a.xyzzy: src/utmps/endutxent.o src/utmps/getutxent.o src/utmps/getutxid.o src/utmps/getutxline.o src/utmps/logwtmp.o src/utmps/pututxline.o src/utmps/setutxent.o src/utmps/utmps_end.o src/utmps/utmps_getent.o src/utmps/utmps_getid.o src/utmps/utmps_getline.o src/utmps/utmps_here.o src/utmps/utmps_here_maybe_init.o src/utmps/utmps_putline.o src/utmps/utmps_rewind.o src/utmps/utmps_start.o src/utmps/utmps_updwtmpx.o src/utmps/utmps_utmpx_pack.o src/utmps/utmps_utmpx_unpack.o src/utmps/updwtmpx.o
+libutmps.a.xyzzy: src/utmps/endutxent.o src/utmps/getutxent.o src/utmps/getutxid.o src/utmps/getutxline.o src/utmps/logwtmp.o src/utmps/pututxline.o src/utmps/setutxent.o src/utmps/updwtmpx.o src/utmps/utmpxname.o src/utmps/utmps_end.o src/utmps/utmps_getent.o src/utmps/utmps_getid.o src/utmps/utmps_getline.o src/utmps/utmps_here.o src/utmps/utmps_here_maybe_init.o src/utmps/utmps_putline.o src/utmps/utmps_rewind.o src/utmps/utmps_start.o src/utmps/utmps_updwtmpx.o src/utmps/utmps_utmpx_pack.o src/utmps/utmps_utmpx_unpack.o
else
-libutmps.a.xyzzy: src/utmps/endutxent.lo src/utmps/getutxent.lo src/utmps/getutxid.lo src/utmps/getutxline.lo src/utmps/logwtmp.lo src/utmps/pututxline.lo src/utmps/setutxent.lo src/utmps/utmps_end.lo src/utmps/utmps_getent.lo src/utmps/utmps_getid.lo src/utmps/utmps_getline.lo src/utmps/utmps_here.lo src/utmps/utmps_here_maybe_init.lo src/utmps/utmps_putline.lo src/utmps/utmps_rewind.lo src/utmps/utmps_start.lo src/utmps/utmps_updwtmpx.lo src/utmps/utmps_utmpx_pack.lo src/utmps/utmps_utmpx_unpack.lo src/utmps/updwtmpx.lo
+libutmps.a.xyzzy: src/utmps/endutxent.lo src/utmps/getutxent.lo src/utmps/getutxid.lo src/utmps/getutxline.lo src/utmps/logwtmp.lo src/utmps/pututxline.lo src/utmps/setutxent.lo src/utmps/updwtmpx.lo src/utmps/utmpxname.lo src/utmps/utmps_end.lo src/utmps/utmps_getent.lo src/utmps/utmps_getid.lo src/utmps/utmps_getline.lo src/utmps/utmps_here.lo src/utmps/utmps_here_maybe_init.lo src/utmps/utmps_putline.lo src/utmps/utmps_rewind.lo src/utmps/utmps_start.lo src/utmps/utmps_updwtmpx.lo src/utmps/utmps_utmpx_pack.lo src/utmps/utmps_utmpx_unpack.lo
endif
libutmps.so.xyzzy: EXTRA_LIBS := -lskarnet
-libutmps.so.xyzzy: src/utmps/endutxent.lo src/utmps/getutxent.lo src/utmps/getutxid.lo src/utmps/getutxline.lo src/utmps/logwtmp.lo src/utmps/pututxline.lo src/utmps/setutxent.lo src/utmps/utmps_end.lo src/utmps/utmps_getent.lo src/utmps/utmps_getid.lo src/utmps/utmps_getline.lo src/utmps/utmps_here.lo src/utmps/utmps_here_maybe_init.lo src/utmps/utmps_putline.lo src/utmps/utmps_rewind.lo src/utmps/utmps_start.lo src/utmps/utmps_updwtmpx.lo src/utmps/utmps_utmpx_pack.lo src/utmps/utmps_utmpx_unpack.lo src/utmps/updwtmpx.lo
+libutmps.so.xyzzy: src/utmps/endutxent.lo src/utmps/getutxent.lo src/utmps/getutxid.lo src/utmps/getutxline.lo src/utmps/logwtmp.lo src/utmps/pututxline.lo src/utmps/setutxent.lo src/utmps/updwtmpx.lo src/utmps/utmpxname.lo src/utmps/utmps_end.lo src/utmps/utmps_getent.lo src/utmps/utmps_getid.lo src/utmps/utmps_getline.lo src/utmps/utmps_here.lo src/utmps/utmps_here_maybe_init.lo src/utmps/utmps_putline.lo src/utmps/utmps_rewind.lo src/utmps/utmps_start.lo src/utmps/utmps_updwtmpx.lo src/utmps/utmps_utmpx_pack.lo src/utmps/utmps_utmpx_unpack.lo
utmps-utmpd: EXTRA_LIBS :=
utmps-utmpd: src/utmps/utmps-utmpd.o libutmps.a.xyzzy -lskarnet
utmps-wtmpd: EXTRA_LIBS :=
diff --git a/src/include/utmps/utmpx.h b/src/include/utmps/utmpx.h
index cdc6a8c..d0f3457 100644
--- a/src/include/utmps/utmpx.h
+++ b/src/include/utmps/utmpx.h
@@ -61,6 +61,7 @@ extern struct utmpx *getutxid (struct utmpx const *) ;
extern struct utmpx *getutxline (struct utmpx const *) ;
extern struct utmpx *pututxline (struct utmpx const *) ;
+extern int utmpxname (char const *) ;
extern void updwtmpx (char const *, struct utmpx const *) ;
extern void logwtmp (char const *, char const *, char const *) ;
diff --git a/src/utmps/deps-lib/utmps b/src/utmps/deps-lib/utmps
index 430b7fb..c73d439 100644
--- a/src/utmps/deps-lib/utmps
+++ b/src/utmps/deps-lib/utmps
@@ -6,6 +6,7 @@ logwtmp.o
pututxline.o
setutxent.o
updwtmpx.o
+utmpxname.o
utmps_end.o
utmps_getent.o
utmps_getid.o
diff --git a/src/utmps/utmpxname.c b/src/utmps/utmpxname.c
new file mode 100644
index 0000000..650f0a4
--- /dev/null
+++ b/src/utmps/utmpxname.c
@@ -0,0 +1,24 @@
+/* ISC license. */
+
+#include <errno.h>
+#include <utmps/utmpx.h>
+
+ /*
+ utmps does not support changing the utmp file: this file is
+ hardcoded as $wd/utmp, $wd being the working directory of
+ the utmps-utmpd daemon.
+
+ Software that needs to change the utmp file should instead
+ run its own instance of utmps-utmpd to access the alternate
+ file the software wants, and connect to that instance.
+
+ A stub is still provided so software can *build* and work
+ in the cases where it doesn't try accessing a non-default
+ utmp file.
+ */
+
+int utmpxname (char const *file)
+{
+ (void)file ;
+ return (errno = ENOSYS, -1) ;
+}