summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2019-09-06 17:42:51 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2019-09-06 17:42:51 +0000
commit2c5a7f2d3c4bf5bde608a7f2213b637bf32e027a (patch)
treef55a4ed30b6e842d05f319f570997405c22c4989 /src
parent5276157151d44fe7cf09060b413e81a1420c1b93 (diff)
downloads6-linux-init-2c5a7f2d3c4bf5bde608a7f2213b637bf32e027a.tar.xz
Print HPR_BANNER_WALL to all users in shutdown(8) too
Diffstat (limited to 'src')
-rw-r--r--src/shutdown/s6-linux-init-shutdown.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/shutdown/s6-linux-init-shutdown.c b/src/shutdown/s6-linux-init-shutdown.c
index 2a85ba9..1492505 100644
--- a/src/shutdown/s6-linux-init-shutdown.c
+++ b/src/shutdown/s6-linux-init-shutdown.c
@@ -247,7 +247,15 @@ int main (int argc, char const *const *argv)
if (!argc) dieusage() ;
parse_time(&when, argv[0]) ;
tain_sub(&when, &when, &STAMP) ;
- if (argv[1]) hpr_wall(argv[1]) ;
+ if (argv[1])
+ {
+ size_t len = strlen(argv[1]) ;
+ char msg[sizeof(HPR_WALL_BANNER) + 1 + len] ;
+ memcpy(msg, HPR_WALL_BANNER, sizeof(HPR_WALL_BANNER) - 1) ;
+ msg[sizeof(HPR_WALL_BANNER) - 1] = '\n' ;
+ memcpy(msg + sizeof(HPR_WALL_BANNER), argv[1], len + 1) ;
+ hpr_wall(msg) ;
+ }
if (what < 4)
{
if (gracetime > 300)