Newsgroups: comp.unix.ultrix
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!hellgate.utah.edu!dog.ee.lbl.gov!epb7.lbl.gov!envbvs
From: envbvs@epb7.lbl.gov (Brian V. Smith)
Subject: Re: ln -s gives wrong error message on Ultrix 4.1
Organization: lbl
References: <1991Apr9.194356.24156@watcgl.waterloo.edu> <1991Apr11.080051.10756@pronto.mh.nl>
Message-ID: <11998@dog.ee.lbl.gov>
X-Local-Date: Thu, 11 Apr 91 10:00:12 PDT
Reply-To: envbvs@epb7.lbl.gov (Brian V. Smith)
Date: Thu, 11 Apr 91 17:00:12 GMT

In article <1991Apr11.080051.10756@pronto.mh.nl>, jv@mh.nl (Johan Vromans)
writes:
|> 
|> In article <1991Apr9.194356.24156@watcgl.waterloo.edu>
|> idallen@watcgl.waterloo.edu (Ian! D. Allen [CGL]) writes:
|> 
|> > For a nonexistent pathname "xxx" and a directory into which I do not
|> > have permission to write "/", Ultrix issues the wrong error message:
|> >...
|> >     1% ln -s xxx /
|> >     xxx: No such file or directory                         <- What?!
|> >...
|> > The "No such file or directory" that Ultrix issues is not correct for #1.
|> > The presence or absence of the link content should not affect the fact
|> > that I don't have permission to make the symbolic link.
|> 
|> It doesn't. In this case, you deserve two error messages: ENOENT
|> *AND* EPERM.
|> 
|> > Ultrix should say, like everyone else, "Permission denied".  
|> 
|> I do not agree. To me, it is more logical to check source first. If
|> you do not have a (valid) source, there is no need worrying about the
|> destination. 
|> But I can imagine that checking destination first also has it points.

No, no, no.  There is no reason that the source must exist when the symlink 
is created.  That is one of the nice things about symlinks.   It is simple
string substitution.  Try the following:  ln -s xxx aaa    
It works fine even when xxx doesn't exist, as long as one has permission
to create aaa.

-- 
Brian V. Smith    (bvsmith@lbl.gov)
Lawrence Berkeley Laboratory
I don't speak for LBL; they don't pay me enough for that.
