lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LYNX-DEV [Fwd: BoS: A vulnerability in Lynx (all versions)]


From: Kari E. Hurtta
Subject: Re: LYNX-DEV [Fwd: BoS: A vulnerability in Lynx (all versions)]
Date: Wed, 7 May 1997 23:51:48 +0300 (EDT)

Hynek Med:
> On Wed, 7 May 1997, Alan Cox wrote:
> 
> > > a) create the file with 600 pemissions anyway, to guarantee privacy
> > > b) pick a very random name for the file
> > > c) check if the file about to be created isn't already a symlink/hardlink
> > > d) optionally do all this in a subdirectory with 700 permissions as your
> > > script suggests
> > > 
> > > I don't know any C, does some kind of standart mktemp() function do this
> > > all? Is it available on all systems?
> > 
> > mktemp isnt sufficient. mkstemp() is but not on all OS's. The algorithm
> > above has a race condition...
> 
> Yes, but a hard to win race, and provided the filename is really random
> it's almost impossible. (Please correct me if I'm wrong.) 

Well. It is possible to use:

        name=mktemp(template);
        if (fd=open(name,O_RDWR|O_EXCL|O_CREAT) < 0) {

        }
        f = fdopen(fd,"r+");

O_EXCL does not follow symbol links [exception: HP-UX prior
the version 9.07]

Using of mktemp is not necessary here.
;
; To UNSUBSCRIBE:  Send a mail message to address@hidden
;                  with "unsubscribe lynx-dev" (without the
;                  quotation marks) on a line by itself.
;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]