ln -s gives wrong error message on Ultrix 4.1

Brian V. Smith envbvs at epb7.lbl.gov
Fri Apr 12 03:00:12 AEST 1991


In article <1991Apr11.080051.10756 at pronto.mh.nl>, jv at mh.nl (Johan Vromans)
writes:
|> 
|> In article <1991Apr9.194356.24156 at watcgl.waterloo.edu>
|> idallen at 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 at lbl.gov)
Lawrence Berkeley Laboratory
I don't speak for LBL; they don't pay me enough for that.



More information about the Comp.unix.ultrix mailing list