summaryrefslogtreecommitdiff
path: root/src/shutdown/s6-linux-init-shutdown.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2019-05-12 23:02:05 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2019-05-12 23:02:05 +0000
commit75d6cad031eecd4b39ad0e000586666419e87865 (patch)
treec7aca208725f77a30b494e1f83c7f0dba028c0a3 /src/shutdown/s6-linux-init-shutdown.c
parent0467356533d60ab7de402f1e8d02a356e11dbbd3 (diff)
downloads6-linux-init-75d6cad031eecd4b39ad0e000586666419e87865.tar.xz
No utmpx errors; no additional /dev/console message when shutdown -a fails
Diffstat (limited to 'src/shutdown/s6-linux-init-shutdown.c')
-rw-r--r--src/shutdown/s6-linux-init-shutdown.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/shutdown/s6-linux-init-shutdown.c b/src/shutdown/s6-linux-init-shutdown.c
index 757ca7c..8e310ec 100644
--- a/src/shutdown/s6-linux-init-shutdown.c
+++ b/src/shutdown/s6-linux-init-shutdown.c
@@ -33,8 +33,6 @@
#define AC_FILE "/etc/shutdown.allow"
#define AC_BUFSIZE 4096
#define AC_MAX 64
-#define AC_SHORT_MESSAGE "no authorized users logged in\n"
-#define AC_MESSAGE "s6-linux-init-shutdown: " AC_SHORT_MESSAGE
/* shutdown 01:23: date/time format parsing */
@@ -153,7 +151,6 @@ static inline int match_users_with_utmp (char const *const *users, unsigned int
for (unsigned int i = 0 ; i < n ; i++)
if (!strncmp(utx->ut_user, users[i], UT_NAMESIZE)) goto yes ;
}
- if (errno) strerr_warnwu1sys("getutxent") ;
endutxent() ;
return 0 ;
@@ -188,14 +185,7 @@ static inline void access_control (void)
buf[st.st_size] = 0 ;
n = parse_authorized_users(buf, users, AC_MAX) ;
if (!n || !match_users_with_utmp(users, n))
- {
- fd = open_append("/dev/console") ;
- if (fd == -1)
- strerr_diefu1sys(111, "open /dev/console") ;
- if (allwrite(fd, AC_MESSAGE, sizeof(AC_MESSAGE) - 1) < sizeof(AC_MESSAGE) - 1)
- strerr_diefu1sys(111, "write to /dev/console") ;
- strerr_dief1x(1, AC_SHORT_MESSAGE) ;
- }
+ strerr_dief1x(1, "no authorized users logged in") ;
}