summaryrefslogtreecommitdiff
path: root/build/build.c
diff options
context:
space:
mode:
authorewt <devnull@localhost>1997-08-28 19:13:54 +0000
committerewt <devnull@localhost>1997-08-28 19:13:54 +0000
commitd4e8084b2a8ee8d5eae97a3273f09b4fa3a6eea6 (patch)
treec7efae524db88c06b623be0f045df9a72478c958 /build/build.c
parentfe6d4834696c89e5fcdd258439889b153197fb5d (diff)
downloadrpm-d4e8084b2a8ee8d5eae97a3273f09b4fa3a6eea6.tar.gz
rpm-d4e8084b2a8ee8d5eae97a3273f09b4fa3a6eea6.tar.bz2
rpm-d4e8084b2a8ee8d5eae97a3273f09b4fa3a6eea6.zip
replaced temporary file creation to be significantly safer
CVS patchset: 1809 CVS date: 1997/08/28 19:13:54
Diffstat (limited to 'build/build.c')
-rw-r--r--build/build.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/build/build.c b/build/build.c
index 7673a7aa8..bf16ece07 100644
--- a/build/build.c
+++ b/build/build.c
@@ -56,6 +56,7 @@ struct Script *openScript(Spec spec, int builddir, char *name)
struct Script *script = malloc(sizeof(struct Script));
struct PackageRec *main_package = spec->packages;
char *s, * arch, * os;
+ int fd;
int_32 foo;
rpmGetArchInfo(&arch, NULL);
@@ -66,8 +67,9 @@ struct Script *openScript(Spec spec, int builddir, char *name)
exit(RPMERR_INTERNAL);
}
- script->name = tempnam(rpmGetVar(RPMVAR_TMPPATH), "rpmbuild");
- script->file = fopen(script->name, "w");
+ if (makeTempFile(NULL, &script->name, &fd))
+ exit(1);
+ script->file = fdopen(fd, "w");
/* Prepare the script */
fprintf(script->file,