At 7:24 PM +0100 12/10/99, Andre Albsmeier wrote:
>On Fri, 10-Dec-1999 at 13:16:16 -0500, Garance A Drosihn wrote:
> > I'm thinking you'd what to add an lstat call after creating the
> > hardlink.  Check the new file to see if it's a symlink, and if it
>
>Can a symlink be created by link() ?  If I look at link(2), it seems
>that it will create only hardlinks... But, I am new to this and
>maybe talking nonsense only :-)

I'm thinking about what happens if the link() is given a source
file which already is a symlink.  Eg:
      touch dumbfile
      ln -s dumbfile dumbfile.sym
      ln dumbfile.sym dumbfile.hard
      ls -li dumbfile*

Hmm.  In testing the above, it is an issue under aix, although not
in the way I was expecting.  The hardlink succeeds, and you end up
with dumbfile.hard as a hard link to the 'dumbfile'.  So, the
given patch (under aix) would make a hardlink OK, but I'll have
to do some testing to determine how that effects the rest of the
checks in the most recent suggested patch.

It looks like freebsd won't let me create the hardlink to the
symlink, so this problem wouldn't come up under freebsd. However,
I do take freebsd's lpr/lpd and compile it for use on aix, irix,
and solaris here at RPI, so I do want to look into this in detail
on all four platforms.

> > I'm not sure on that, and haven't had time to look at the code
> > yet.  I'm just wondering about the case where a user might do a
> >        lpr -r -s somesymlink
> > and want to be sure this does the right thing.  I suspect that
> > currently (without this patch) lpr will copy the REAL file, and
>
>From my experience, lpr -s -r does the same as lpr -s : Create
>a symlink in the spooldir which points to the file to be printed.

Sorry.  Brain-error on my part.  I meant just
         lpr -r somesymlink
but I was thinking "symlink" so I added the -s in there by mistake.
Clearly I need more sleep before tackling this topic again...


---
Garance Alistair Drosehn           =   [EMAIL PROTECTED]
Senior Systems Programmer          or  [EMAIL PROTECTED]
Rensselaer Polytechnic Institute


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to