diff options
Diffstat (limited to 'usr.sbin/pkg_install')
-rw-r--r-- | usr.sbin/pkg_install/lib/pen.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/usr.sbin/pkg_install/lib/pen.c b/usr.sbin/pkg_install/lib/pen.c index ca1d501595c..835a044e6c7 100644 --- a/usr.sbin/pkg_install/lib/pen.c +++ b/usr.sbin/pkg_install/lib/pen.c @@ -1,7 +1,7 @@ -/* $OpenBSD: pen.c,v 1.3 1997/06/17 08:38:03 deraadt Exp $ */ +/* $OpenBSD: pen.c,v 1.4 1997/06/17 08:39:47 deraadt Exp $ */ #ifndef lint -static const char *rcsid = "$OpenBSD: pen.c,v 1.3 1997/06/17 08:38:03 deraadt Exp $"; +static const char *rcsid = "$OpenBSD: pen.c,v 1.4 1997/06/17 08:39:47 deraadt Exp $"; #endif /* @@ -76,13 +76,18 @@ make_playpen(char *pen, size_t sz) { char *tmp; int i = 0; + mode_t um; + um = umask(S_IWGRP|S_IWOTH); while (1) { - if (!find_play_pen(pen, sz)) + if (!find_play_pen(pen, sz)) { + umask(um); return NULL; + } if (!mktemp(pen)) { barf("Can't mktemp '%s'.", pen); + umask(um); return NULL; } if (mkdir(pen, 0755) == FAIL && i++ < 100) { @@ -91,8 +96,10 @@ make_playpen(char *pen, size_t sz) } barf("Can't mkdir '%s'.", pen); + umask(um); return NULL; } + umask(um); if (Verbose) { if (sz) |