From 6eae274a351ce903c69977c5c4d55cc45ff6de02 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Fri, 15 Jun 2018 21:51:44 +0000 Subject: Small bugfixes, prepare for 0.0.1.1 --- src/utmps/utmps-utmpd.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/utmps/utmps-utmpd.c b/src/utmps/utmps-utmpd.c index e460368..ecf8215 100644 --- a/src/utmps/utmps-utmpd.c +++ b/src/utmps/utmps-utmpd.c @@ -48,7 +48,9 @@ static void maybe_open (void) { if (fd < 0) { - fd = open("utmp", O_RDWR | O_CREAT) ; + mode_t m = umask(0) ; + fd = open("utmp", O_RDWR | O_CREAT, 0644) ; + umask(m) ; if (fd < 0) { int e = errno ; @@ -188,7 +190,9 @@ static void do_rewind (void) int main (void) { uid_t uid ; - char const *x = ucspi_get("REMOTEEUID") ; + char const *x ; + PROG = "utmps-utmpd" ; + x = ucspi_get("REMOTEEUID") ; if (!x) strerr_diefu1x(100, "get $IPCREMOTEEUID from environment") ; if (!uid0_scan(x, &uid)) strerr_dieinvalid(100, "IPCREMOTEEUID") ; if (ndelay_on(0) < 0) strerr_diefu1sys(111, "set stdin non-blocking") ; -- cgit 1.4.1