use TMPPATH var
authorroot <devnull@localhost>
Tue, 17 Sep 1996 19:14:00 +0000 (19:14 +0000)
committerroot <devnull@localhost>
Tue, 17 Sep 1996 19:14:00 +0000 (19:14 +0000)
CVS patchset: 1030
CVS date: 1996/09/17 19:14:00

checksig.c

index c046c49..4e25ded 100644 (file)
@@ -48,7 +48,7 @@ int doReSign(int add, char *passPhrase, char **argv)
        }
 
        /* Write the rest to a temp file */
-       strcpy(sigtarget, tmpnam(NULL));
+       strcpy(sigtarget, tempnam(getVar(RPMVAR_TMPPATH), "rpmsigtarget"));
        ofd = open(sigtarget, O_WRONLY|O_CREAT|O_TRUNC, 0644);
        while ((count = read(fd, buffer, sizeof(buffer))) > 0) {
            if (count == -1) {
@@ -172,7 +172,7 @@ int doCheckSig(int pgp, char **argv)
            continue;
        }
        /* Write the rest to a temp file */
-       strcpy(sigtarget, tmpnam(NULL));
+       strcpy(sigtarget, tempnam(getVar(RPMVAR_TMPPATH), "rpmsigtarget"));
        ofd = open(sigtarget, O_WRONLY|O_CREAT|O_TRUNC, 0644);
        while ((count = read(fd, buffer, sizeof(buffer))) > 0) {
            if (count == -1) {
@@ -182,7 +182,8 @@ int doCheckSig(int pgp, char **argv)
                exit(1);
            }
            if (write(ofd, buffer, count) < 0) {
-               perror("Couldn't write header/archive to temp file");
+               fprintf(stderr, "Unable to write %s", sigtarget);
+               perror("");
                close(ofd);
                unlink(sigtarget);
                exit(1);