The news/knews port no longer builds because the visibility of P_tmpdir in /usr/include/stdio.h has been changed. From stdio.h we have /* System V/ANSI C; this is the wrong way to do this, do *not* use these. */ #if __XSI_VISIBLE #define P_tmpdir "/var/tmp/" #endif Fix: Replace knews/files/patch-file.c with the following patch. How-To-Repeat: cd /usr/ports/news/knews make
Responsible Changed From-To: freebsd-ports->kde over to maintainer
Adding to audit trail: : : Message-Id: <20020907200926.GB3699@xor.obsecurity.org> : Date: Sat, 7 Sep 2002 13:09:26 -0700 : From: Kris Kennaway <kris@obsecurity.org> : : On Sat, Sep 07, 2002 at 10:06:50AM -0700, Steven G. Kargl wrote: : : > The news/knews port no longer builds because the visibility of : > P_tmpdir in /usr/include/stdio.h has been changed. From stdio.h : > we have : : Hi Steven, : : Thanks for the patch. Wouldn't it be better to use _PATH_TMP from : <paths.h> for this purpose, though? :
Adding to audit trail: : : Message-Id: <200209072100.g87L04Kb023312@troutmask.apl.washington.edu> : Date: Sat, 7 Sep 2002 14:00:04 -0700 (PDT) : From: "Steven G. Kargl" <kargl@troutmask.apl.washington.edu> : : Kris Kennaway said: : > On Sat, Sep 07, 2002 at 10:06:50AM -0700, Steven G. Kargl wrote: : > > The news/knews port no longer builds because the visibility of : > > P_tmpdir in /usr/include/stdio.h has been changed. From stdio.h : > > we have : > : > Thanks for the patch. Wouldn't it be better to use _PATH_TMP from : > <paths.h> for this purpose, though? : : I didn't know about _PATH_TMP. I guess everywhere I : hardcoded "/var/tmp", one can use _PATH_TMP. :
On Sun, Sep 08, 2002 at 02:40:04PM -0700, Giorgos Keramidas wrote: >The following reply was made to PR ports/42510; it has been noted by GNATS. > >From: Giorgos Keramidas <keramida@FreeBSD.org> >To: bug-followup@FreeBSD.org >Cc: >Subject: Re: ports/42510: Fix build of news/knews on -current >Date: Mon, 9 Sep 2002 00:34:54 +0300 > > Adding to audit trail: > : > : Message-Id: <20020907200926.GB3699@xor.obsecurity.org> > : Date: Sat, 7 Sep 2002 13:09:26 -0700 > : From: Kris Kennaway <kris@obsecurity.org> > : > : On Sat, Sep 07, 2002 at 10:06:50AM -0700, Steven G. Kargl wrote: > : > : > The news/knews port no longer builds because the visibility of > : > P_tmpdir in /usr/include/stdio.h has been changed. From stdio.h > : > we have > : > : Hi Steven, > : > : Thanks for the patch. Wouldn't it be better to use _PATH_TMP from > : <paths.h> for this purpose, though? > : Once this is decided (I'm staying out of it), I'll commit a patch. I'm handling matters (while I'm recovering from illness) since Will has a heavy school load for the next week. -- Alan Eldridge Unix/C(++) IT Pro, 20 yrs, seeking new employment. (http://wwweasel.geeksrus.net/~alane/resume.txt) KDE, KDE-FreeBSD Teams (http://www.kde.org, http://freebsd.kde.org/)
No wonder I stopped maintaining ports. It's a PITA to get a simple fix committed. Here a new patch that also fixes the port. -- Steve http://troutmask.apl.washington.edu/~kargl/ --- src/file.c.orig Fri Jan 9 09:16:19 1998 +++ src/file.c Sun Sep 8 15:22:11 2002 @@ -6,6 +6,7 @@ #include <sys/stat.h> #include "expand.h" #include "file.h" +#include <paths.h> #if 0 # define FILE_MASK 0666 @@ -185,16 +186,24 @@ int create_temp_fd(char **name) { int fd; - - *name = tmpnam(NULL); - if (!*name) - fd = -1; - else { - unlink(*name); - fd = open(*name, O_RDWR|O_CREAT|O_EXCL, S_IRUSR|S_IWUSR); - if (fd < 0) - *name = NULL; - } + char filename[FILENAME_MAX]; + + if (getenv("TMPDIR") != NULL) { + strlcpy(filename, getenv("TMPDIR"), FILENAME_MAX); + strlcat(filename, "/tmp.XXXXXX", FILENAME_MAX); + } else if (access(_PATH_VARTMP, (R_OK|W_OK)) == 0) { + strlcpy(filename, _PATH_VARTMP, FILENAME_MAX); + strlcat(filename, "/tmp.XXXXXX", FILENAME_MAX); + } else if (access(_PATH_TMP, (R_OK|W_OK)) == 0) { + strlcpy(filename, _PATH_TMP, FILENAME_MAX); + strlcat(filename, "/tmp.XXXXXX", FILENAME_MAX); + } else + strlcpy(filename, "tmp.XXXXXX", FILENAME_MAX); + + if ((fd = mkstemp(filename)) == -1) + *name = NULL; + else + *name = filename; return fd; }
On Sun, Sep 08, 2002 at 03:50:03PM -0700, Steven G. Kargl wrote: >The following reply was made to PR ports/42510; it has been noted by GNATS. > >From: "Steven G. Kargl" <kargl@troutmask.apl.washington.edu> >To: bug-followup@freebsd.org >Cc: >Subject: Subject: Re: ports/42510: Fix build of news/knews on -current >Date: Sun, 8 Sep 2002 15:46:08 -0700 (PDT) > > No wonder I stopped maintaining ports. It's > a PITA to get a simple fix committed. > > Here a new patch that also fixes the port. If you guys (especially Kris K) can't agree on a patch, I'm just going to say fsck it and write my own, OK? I'm recovering from pneumonia and I don't have time for this. So, Kris, why don't you decide what to use? -- Alan Eldridge Unix/C(++) IT Pro, 20 yrs, seeking new employment. (http://wwweasel.geeksrus.net/~alane/resume.txt) KDE, KDE-FreeBSD Teams (http://www.kde.org, http://freebsd.kde.org/)
Responsible Changed From-To: kde->freebsd-ports Not a kde port.
Responsible Changed From-To: freebsd-ports->kris I'm testing the fix for this
State Changed From-To: open->closed Patch committed, thanks!