ports/93967: converters/mpack, correct hardcoded path problem in source code
Paul Schmehl
pauls at utdallas.edu
Wed Mar 1 22:30:17 UTC 2006
The following reply was made to PR ports/93967; it has been noted by GNATS.
From: Paul Schmehl <pauls at utdallas.edu>
To: bug-followup at FreeBSD.org
Cc:
Subject: Re: ports/93967: converters/mpack, correct hardcoded path problem
in source code
Date: Wed, 01 Mar 2006 16:21:18 -0600
Please make the following changes. This will correct all the incorrect
TMPDIR statements *and* fix a problem with the "sendmail" function of mpack.
Delete the Makefile patch that I sent earlier.
Delete the following files from ${FILESDIR}. They are no longer needed:
patch-ab, patch-unixpk_c and patch-unixunpk_c
Apply the patches that I sent originally except for the following two:
patch-unixpk.c and patch-unixos.c. Replace both of those patches with the
news ones included in this email.
Add the following patch:
patch-unixunpk.man
Retain the following patch that I said was fixed by the Makefile patch that
I sent:
patch-unixpk.man
Here's the two, new, patchfiles that replace the ones that I sent
previously.
--- unixos.c.orig Wed Mar 1 13:51:03 2006
+++ unixos.c Wed Mar 1 13:51:35 2006
@@ -90,7 +90,7 @@
strcpy(buf, getenv("TMPDIR"));
}
else {
- strcpy(buf, "/usr/tmp");
+ strcpy(buf, "/tmp");
}
strcat(buf, "/m-prts-");
p = getenv("USER");
@@ -136,11 +136,7 @@
int fd;
FILE *ret;
-#ifdef O_EXCL
- fd=open(fname, O_RDWR|O_CREAT|O_EXCL, 0644);
-#else
fd=open(fname, O_RDWR|O_CREAT|O_TRUNC, 0644);
-#endif
if (fd == -1)
return NULL;
--- unixpk.c.orig Wed Mar 1 09:28:13 2006
+++ unixpk.c Wed Mar 1 09:31:09 2006
@@ -164,10 +164,10 @@
strcpy(fnamebuf, getenv("TMPDIR"));
}
else {
- strcpy(fnamebuf, "/usr/tmp");
+ strcpy(fnamebuf, "/tmp");
}
strcat(fnamebuf, "/mpackXXXXXX");
- mktemp(fnamebuf);
+ close(mkstemp(fnamebuf));
outfname = strsave(fnamebuf);
}
Paul Schmehl (pauls at utdallas.edu)
Adjunct Information Security Officer
University of Texas at Dallas
AVIEN Founding Member
http://www.utdallas.edu/ir/security/
More information about the freebsd-ports-bugs
mailing list