diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-10-15 10:17:35 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-10-15 10:17:35 +0000 |
commit | 5c0492969bf0ca9f49646b000fd072b74fb37d61 (patch) | |
tree | aef7716051b08b46e0ac3d06d62ffdb28cf9dbcf /sbin/savecore/savecore.c | |
parent | a45400417463c113cb3d0fccf173fc8ac9d132c1 (diff) |
umask for writes; from joerg@freebsd.org
Diffstat (limited to 'sbin/savecore/savecore.c')
-rw-r--r-- | sbin/savecore/savecore.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sbin/savecore/savecore.c b/sbin/savecore/savecore.c index afd8590b692..5b0567f998d 100644 --- a/sbin/savecore/savecore.c +++ b/sbin/savecore/savecore.c @@ -1,4 +1,4 @@ -/* $OpenBSD: savecore.c,v 1.6 1996/08/20 04:22:40 deraadt Exp $ */ +/* $OpenBSD: savecore.c,v 1.7 1996/10/15 10:17:32 deraadt Exp $ */ /* $NetBSD: savecore.c,v 1.26 1996/03/18 21:16:05 leo Exp $ */ /*- @@ -357,6 +357,9 @@ save_core() register FILE *fp; register int bounds, ifd, nr, nw, ofd; char *rawp, path[MAXPATHLEN]; + mode_t um; + + um = umask(S_IRWXG|S_IRWXO); /* * Get the current number and update the bounds file. Do the update @@ -479,6 +482,7 @@ err2: syslog(LOG_WARNING, (void)fclose(fp); else (void)close(ofd); + (void)umask(um); } char * |