summaryrefslogtreecommitdiffstats
path: root/sbin/restore/tape.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>1997-01-01 00:03:49 +0000
committerimp <imp@FreeBSD.org>1997-01-01 00:03:49 +0000
commitd19cae33a9a44c6665389b783a9504f743ef92d6 (patch)
tree7c2d15d9a1fe36ce463488bc1163cdf4515ea3d6 /sbin/restore/tape.c
parente954562707417cbd9d8b63dcc19306e389ae9325 (diff)
downloadFreeBSD-src-d19cae33a9a44c6665389b783a9504f743ef92d6.zip
FreeBSD-src-d19cae33a9a44c6665389b783a9504f743ef92d6.tar.gz
Various security related deltas from OpenBSD
dirs.c: From OpenBSD 1.2, 1.3, 1.5, 1.8, 1.10, 1.11, 1.12 1.2: use unique temporary files; netbsd pr#2544; lukem@supp.cpr.itg.telecom.com.au 1.3: updated patch from lukem@supp.cpr.itg.telecom.com.au to also make -r and -R work again 1.5: mktemp open & fdopen 1.8: /tmp// -> /tmp/ 1.10: Fix strncpy usage and correct strncat length field, from Theo. Also change some occurrence of MAXPATHLEN with sizeof(foo). 1.11: does noone know how to use strncat correctly? 1.12: use mkstemp() From NetBSD: Use open rather than create so we can specify exclusive open mode. main.c: From OpenBSD 1.2, 1.5 1.2: From NetBSD: support $TAPE. 1.5 Set umask to be read only by owner until we set real file permissions. tape.c: From NetBSD: Use open rather than create so we can specify exclusive open mode.
Diffstat (limited to 'sbin/restore/tape.c')
-rw-r--r--sbin/restore/tape.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sbin/restore/tape.c b/sbin/restore/tape.c
index fcf41e8..7aae76d 100644
--- a/sbin/restore/tape.c
+++ b/sbin/restore/tape.c
@@ -583,7 +583,8 @@ extractfile(name)
skipfile();
return (GOOD);
}
- if ((ofile = creat(name, 0666)) < 0) {
+ if ((ofile = open(name, O_WRONLY | O_CREAT | O_TRUNC,
+ 0666)) < 0) {
fprintf(stderr, "%s: cannot create file: %s\n",
name, strerror(errno));
skipfile();
OpenPOWER on IntegriCloud