diff options
author | ewt <devnull@localhost> | 1997-08-28 19:13:54 +0000 |
---|---|---|
committer | ewt <devnull@localhost> | 1997-08-28 19:13:54 +0000 |
commit | d4e8084b2a8ee8d5eae97a3273f09b4fa3a6eea6 (patch) | |
tree | c7efae524db88c06b623be0f045df9a72478c958 /build/build.c | |
parent | fe6d4834696c89e5fcdd258439889b153197fb5d (diff) | |
download | rpm-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.c | 6 |
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, |