summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-06-17 08:39:48 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-06-17 08:39:48 +0000
commit8d2d28269b87f9e2c043ef2ca5e13bd898d24f1d (patch)
tree178d58a27ae469a4b52f80030cfcd1bf9dc76e84
parentd6aaf94f9b2819683f638e9eabdf0b8a890dd71a (diff)
do some umask stuff too
-rw-r--r--usr.sbin/pkg_install/lib/pen.c13
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)