lkml.org 
[lkml]   [1997]   [Dec]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: security warning
Date
> No, 2.0.x also followed symlinks for create(), I'm fairly certain. It used
> to be pretty painful to do, actually, but others did it, and I think
> people even pointed to programs that wanted it done.

2.0 does not follow the symlink for the last node of creat, and its
vital it doesnt.

ln -s /tmp/nosuchfile foofile
./a.out

2.0 -EEXIST
2.1 creates it

touch /tmp/nosuchfile

./a.out

2.0 -EEXIST
2.1 creates it

Test code

#include <stdio.h>
#include <fcntl.h>

int main(int argc,char *argv[])
{
if(open("foofile", O_EXCL|O_CREAT|O_TRUNC, 0600)==-1)
perror("foofile");
return 0;
}

Alan


\
 
 \ /
  Last update: 2005-03-22 13:40    [W:0.088 / U:0.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site