exit(RPMERR_INTERNAL);
}
- script->name = tempnam("/var/tmp", "rpmbuild");
+ script->name = tempnam(getVar(RPMVAR_TMPPATH), "rpmbuild");
script->file = fopen(script->name, "w");
/* Prepare the script */
Header sig;
/* Write the archive to a temp file so we can get the size */
- archiveTemp = tempnam("/var/tmp", "rpmbuild");
+ archiveTemp = tempnam(getVar(RPMVAR_TMPPATH), "rpmbuild");
if ((fd = open(archiveTemp, O_WRONLY|O_CREAT|O_TRUNC, 0644)) == -1) {
fprintf(stderr, "Could not open %s\n", archiveTemp);
return 1;
addEntry(header, RPMTAG_ARCHIVESIZE, INT32_TYPE, &archiveSize, 1);
/* Now write the header and append the archive */
- sigtarget = tempnam("/var/tmp", "rpmbuild");
+ sigtarget = tempnam(getVar(RPMVAR_TMPPATH), "rpmbuild");
if ((fd = open(sigtarget, O_WRONLY|O_CREAT|O_TRUNC, 0644)) == -1) {
fprintf(stderr, "Could not open %s\n", sigtarget);
unlink(archiveTemp);
/**** Create links for all the sources ****/
- tempdir = tempnam("/var/tmp", "rpmbuild");
+ tempdir = tempnam(getVar(RPMVAR_TMPPATH), "rpmbuild");
mkdir(tempdir, 0700);
filelist = newStringBuf(); /* List in the header */
if (rootdir) {
tmpPath = alloca(strlen(rootdir) + 15);
strcpy(tmpPath, rootdir);
- strcat(tmpPath, "/var/tmp");
+ strcat(tmpPath, getVar(RPMVAR_TMPPATH));
} else
- tmpPath = "/var/tmp";
+ tmpPath = getVar(RPMVAR_TMPPATH);
/* the file pointer for fd is pointing at the cpio archive */
if (installArchive(archivePrefix, fd, files, archiveFileCount, notify,
if (rootdir) {
tmpPath = alloca(strlen(rootdir) + 15);
strcpy(tmpPath, rootdir);
- strcat(tmpPath, "/var/tmp");
+ strcat(tmpPath, getVar(RPMVAR_TMPPATH));
} else
- tmpPath = "/var/tmp";
+ tmpPath = getVar(RPMVAR_TMPPATH);
if (installArchive(realSourceDir, fd, NULL, 0, NULL, &specFile, tmpPath)) {
return 1;
* size key you like). We also honor PGPPATH finally.
*/
+#include <paths.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
int res = RPMSIG_OK;
/* Write out the signature */
- sigfile = tempnam("/var/tmp", "rpmsig");
+ sigfile = tempnam(getVar(RPMVAR_TMPPATH), "rpmsig");
sfd = open(sigfile, O_WRONLY|O_CREAT|O_TRUNC, 0644);
write(sfd, sig, count);
close(sfd);