Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Dec 1999 19:24:03 +0100
From:      Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
To:        Garance A Drosihn <drosih@rpi.edu>
Cc:        Alfred Perlstein <bright@wintelcom.net>, Andre Albsmeier <andre.albsmeier@mchp.siemens.de>, Warner Losh <imp@village.org>, current@FreeBSD.ORG
Subject:   Re: NO! Re: [PATCHES] Two fixes for lpd/lpc for review and test
Message-ID:  <19991210192403.A19799@internal>
In-Reply-To: <v04210109b476ee7e06ca@[128.113.24.47]>; from drosih@rpi.edu on Fri, Dec 10, 1999 at 01:16:16PM -0500
References:  <Pine.BSF.4.21.9912100211050.4557-100000@fw.wintelcom.net> <v04210109b476ee7e06ca@[128.113.24.47]>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 10-Dec-1999 at 13:16:16 -0500, Garance A Drosihn wrote:
> At 2:33 AM -0800 12/10/99, Alfred Perlstein wrote:
> >Can someone take a look at this?
> >
> >Basically, it makes the link to the file, if it can unlink the original
> >it will then chown the spool file if it can't delete or read the original
> >then the user didn't have permission and it backs out.
> 
> 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 :-)

> is, then delete the new file and go to nohardlink.  Then proceed
> with the rest of your code (which looks fine to me, but remember
> I'm the guy who wrote a message explicitly for one mailing list,
> and then sent it to the other one...).
> 
> 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.
After printing, the symlink is being removed and the file won't
be touched. IIRC, this is due to security reasons when doing remote
printing. No files are removed that start with a /. The unlink
command is ignored by printjob.c. But, again I maybe false...

> then remove the symlink.  I don't think we want to hard-link to
> the symlink, and then remove the original symlink.
> 
> Remember, my mind is tired enough that I could easily be making
> things up here...  It may be that the situation I'm wondering
> about is already covered by other checks in the code.

I have just looked at Alfred's patch and it seems nice to me but
that doesn't mean a lot :-)

	-Andre
> 
> 
> ---
> Garance Alistair Drosehn           =   gad@eclipse.acs.rpi.edu
> Senior Systems Programmer          or  drosih@rpi.edu
> Rensselaer Polytechnic Institute

-- 
"In a world without walls and fences, who needs windows and gates?"


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19991210192403.A19799>