From 2caa705bebc970e59f2b7500b0b0604cae926ab2 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Thu, 7 Jun 2018 12:38:22 +0000 Subject: Add utmpxname, change default socket names, ready for 0.0.1.0 --- src/include/utmps/utmpx.h | 1 + src/utmps/deps-lib/utmps | 1 + src/utmps/utmpxname.c | 24 ++++++++++++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 src/utmps/utmpxname.c (limited to 'src') 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 +#include + + /* + 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) ; +} -- cgit v1.2.3