From 2c5a7f2d3c4bf5bde608a7f2213b637bf32e027a Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Fri, 6 Sep 2019 17:42:51 +0000 Subject: Print HPR_BANNER_WALL to all users in shutdown(8) too --- src/shutdown/s6-linux-init-shutdown.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/shutdown') 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) -- cgit v1.2.3