summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2018-06-15 21:51:44 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2018-06-15 21:51:44 +0000
commit6eae274a351ce903c69977c5c4d55cc45ff6de02 (patch)
tree2aeb10dab3484685a298ff51d6aa95272c8acc0d /src
parent2e793d057499345ecd86b2b88dee479419100ff2 (diff)
downloadutmps-6eae274a351ce903c69977c5c4d55cc45ff6de02.tar.xz
Small bugfixes, prepare for 0.0.1.1
Diffstat (limited to 'src')
-rw-r--r--src/utmps/utmps-utmpd.c8
1 files changed, 6 insertions, 2 deletions
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") ;