[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: LYNX-DEV Improvement on /tmp code fix?
From: |
Jonathan Sergent |
Subject: |
Re: LYNX-DEV Improvement on /tmp code fix? |
Date: |
Sun, 13 Jul 1997 12:53:05 -0500 |
] Look at the functions in HTFWriter.c to see what may actually happen,
] for example HTSaveToFile.
] Your code would create, just to be sure, three different temp files
] *and keep them around* till lynx exits. But the function which has
] called tempname() may use neither of LYnnnnnTMP.html, LYnnnnnTMP.txt,
] or LYnnnnnTMP.bin, but (for example) LYnnnnnTMP.gif instead, depending
] on what is being downloaded...
] so all that trouble you are going to doesn't buy you anything more
] (in that case) than is already there.
(well, it does if you're downloading HTML or text! :-) I knew about,
but forgot about, the said musical extension business.
...
So do we think it's more appropriate to change the way tempname() gets
called everywhere (add an extra parameter or something), or to make
changes like this (for HTSaveAndExecute, untested):
*** HTFWriter.c.orig Sun Jul 13 12:39:35 1997
--- HTFWriter.c Sun Jul 13 12:39:49 1997
***************
*** 392,397 ****
--- 392,398 ----
char *cp;
HTStream* me;
FILE *fp = NULL;
+ int fd = -1;
if (traversal) {
LYCancelledFetch = TRUE;
***************
*** 478,488 ****
* It's not one of the suffixes checked for a
* spoof in tempname(), so check it now. - FM
*/
! if ((fp = fopen(fnam, "r")) != NULL) {
! fclose(fp);
! fp = NULL;
goto SaveAndExecute_tempname;
! }
} else {
*cp = '.';
}
--- 479,490 ----
* It's not one of the suffixes checked for a
* spoof in tempname(), so check it now. - FM
*/
! if ((fd = open(fnam, O_CREAT|O_RDWR|O_EXCL, 0600)) == -1) {
! close(fd);
! fd = -1;
goto SaveAndExecute_tempname;
! } else
! fp = fdopen(fd, "r");
} else {
*cp = '.';
}
... in all the appropriate places? Just asking before I go do it.
--
Jonathan Sergent / address@hidden / address@hidden
;
; To UNSUBSCRIBE: Send a mail message to address@hidden
; with "unsubscribe lynx-dev" (without the
; quotation marks) on a line by itself.
;
- Re: LYNX-DEV Improvement on /tmp code fix?, (continued)
- Re: LYNX-DEV Improvement on /tmp code fix?, Jonathan Sergent, 1997/07/13
- Re: LYNX-DEV Improvement on /tmp code fix?, T.E.Dickey, 1997/07/13
- Re: LYNX-DEV Improvement on /tmp code fix?, Jonathan Sergent, 1997/07/13
- Re: LYNX-DEV Improvement on /tmp code fix?, Jonathan Sergent, 1997/07/13
- Re: LYNX-DEV Improvement on /tmp code fix?, T.E.Dickey, 1997/07/13
Re: LYNX-DEV Improvement on /tmp code fix?, Jim Dennis, 1997/07/13
Re: LYNX-DEV Improvement on /tmp code fix?, Foteos Macrides, 1997/07/13
- Re: LYNX-DEV Improvement on /tmp code fix?, Jonathan Sergent, 1997/07/13
- Re: LYNX-DEV Improvement on /tmp code fix?, Klaus Weide, 1997/07/13
- Re: LYNX-DEV Improvement on /tmp code fix?, Jonathan Sergent, 1997/07/13
- Re: LYNX-DEV Improvement on /tmp code fix?,
Jonathan Sergent <=
- Re: LYNX-DEV Improvement on /tmp code fix?, Klaus Weide, 1997/07/13
- Re: LYNX-DEV Improvement on /tmp code fix?, Jonathan Sergent, 1997/07/13
- Re: LYNX-DEV Improvement on /tmp code fix?, Klaus Weide, 1997/07/14
- Re: LYNX-DEV Improvement on /tmp code fix?, Jonathan Sergent, 1997/07/13
Re: LYNX-DEV Improvement on /tmp code fix?, Klaus Weide, 1997/07/13
Re: LYNX-DEV Improvement on /tmp code fix?, Bela Lubkin, 1997/07/13