diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2002-06-08 18:09:31 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2002-06-08 18:09:31 +0000 |
commit | 6f18c8b091131f86fe9dba3486471f643a4bb646 (patch) | |
tree | 0ed13632c28cecaa809d4fd431d21e742f99800e | |
parent | 54321b9a4d4242ee1168e8c68f9d9308b6bc8aa4 (diff) |
Force lpd socket to be mode 0660, group daemon
-rw-r--r-- | usr.sbin/lpr/lpd/lpd.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/lpr/lpd/lpd.c b/usr.sbin/lpr/lpd/lpd.c index e731fda086b..f0e6150c9fd 100644 --- a/usr.sbin/lpr/lpd/lpd.c +++ b/usr.sbin/lpr/lpd/lpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lpd.c,v 1.33 2002/06/08 01:53:43 millert Exp $ */ +/* $OpenBSD: lpd.c,v 1.34 2002/06/08 18:09:30 millert Exp $ */ /* $NetBSD: lpd.c,v 1.33 2002/01/21 14:42:29 wiz Exp $ */ /* @@ -45,7 +45,7 @@ static const char copyright[] = #if 0 static const char sccsid[] = "@(#)lpd.c 8.7 (Berkeley) 5/10/95"; #else -static const char rcsid[] = "$OpenBSD: lpd.c,v 1.33 2002/06/08 01:53:43 millert Exp $"; +static const char rcsid[] = "$OpenBSD: lpd.c,v 1.34 2002/06/08 18:09:30 millert Exp $"; #endif #endif /* not lint */ @@ -294,7 +294,6 @@ main(int argc, char **argv) sigaddset(&mask, SIGTERM); sigprocmask(SIG_BLOCK, &mask, &omask); - (void)umask(07); signal(SIGHUP, mcleanup); signal(SIGINT, mcleanup); signal(SIGQUIT, mcleanup); @@ -310,8 +309,10 @@ main(int argc, char **argv) syslog(LOG_ERR, "ubind: %m"); exit(1); } + chmod(_PATH_SOCKETNAME, 0660) + chown(_PATH_SOCKETNAME, -1, real_gid) PRIV_END; - (void)umask(0); + (void)umask(0); /* XXX */ sigprocmask(SIG_SETMASK, &omask, NULL); FD_ZERO(&defreadfds); FD_SET(funix, &defreadfds); |