From: ewt Date: Fri, 1 Mar 1996 01:57:52 +0000 (+0000) Subject: ftp installs should use temp space within the directory given by X-Git-Tag: tznext/4.11.0.1.tizen20130304~11518 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4ca3469b48d03ae60ba4afb737ade9bce2333ec5;p=tools%2Flibrpm-tizen.git ftp installs should use temp space within the directory given by --root if it was used CVS patchset: 442 CVS date: 1996/03/01 01:57:52 --- diff --git a/install.c b/install.c index aac5738..a0a5ff1 100644 --- a/install.c +++ b/install.c @@ -1,3 +1,4 @@ +#include #include #include #include @@ -13,7 +14,7 @@ static int hashesPrinted = 0; static void printHash(const unsigned long amount, const unsigned long total); static void printPercent(const unsigned long amount, const unsigned long total); -static int getFtpURL(char * hostAndFile); +static int getFtpURL(char * prefix, char * hostAndFile); static void printHash(const unsigned long amount, const unsigned long total) { int hashesNeeded; @@ -72,7 +73,7 @@ void doInstall(char * prefix, char * arg, int installFlags, int interfaceFlags) if (isVerbose()) { printf("Retrieving %s\n", arg); } - fd = getFtpURL(arg + 6); + fd = getFtpURL(prefix, arg + 6); if (fd < 0) { fprintf(stderr, "error: cannot ftp %s\n", arg); } @@ -178,7 +179,7 @@ int doSourceInstall(char * prefix, char * arg, char ** specFile) { return rc; } -static int getFtpURL(char * hostAndFile) { +static int getFtpURL(char * prefix, char * hostAndFile) { char * buf; char * chptr; int ftpconn; @@ -201,7 +202,8 @@ static int getFtpURL(char * hostAndFile) { *chptr = '/'; - tmp = tmpnam(NULL); + tmp = alloca(strlen(prefix) + 60); + sprintf(tmp, "%s/usr/tmp/rpm.ftp.%d", prefix, getuid()); fd = creat(tmp, 0600); if (fd < 0) {