From owner-freebsd-current Fri Dec 10 13:36:41 1999 Delivered-To: freebsd-current@freebsd.org Received: from mail.rpi.edu (mail.rpi.edu [128.113.100.7]) by hub.freebsd.org (Postfix) with ESMTP id 6216115162 for ; Fri, 10 Dec 1999 13:36:38 -0800 (PST) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.acs.rpi.edu [128.113.24.47]) by mail.rpi.edu (8.9.3/8.9.3) with ESMTP id QAA170584; Fri, 10 Dec 1999 16:36:29 -0500 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <19991210192403.A19799@internal> References: <19991210192403.A19799@internal> Date: Fri, 10 Dec 1999 16:42:19 -0500 To: Andre Albsmeier From: Garance A Drosihn Subject: Re: NO! Re: [PATCHES] Two fixes for lpd/lpc for review and test Cc: Alfred Perlstein , Andre Albsmeier , Warner Losh , current@FreeBSD.ORG Content-Type: text/plain; charset="us-ascii" ; format="flowed" Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 = gad@eclipse.acs.rpi.edu Senior Systems Programmer or drosih@rpi.edu Rensselaer Polytechnic Institute To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message