[comp.protocols.nfs] PC-NFS Printing - User name variations

lyle@sjuphil.uucp (Wayne J. Lyle) (12/07/89)

	Sharing printers has been really no problem for me to setup.  However
we have installed a postscript laser that I want to keep track of usage by
establishing printer account.  No problem I thought, looks ok and things are
being recorded for transactions from the PC's using PC-NFS.  However then I
began to notice a high number of entries for root and an occasional entry for
user.  I know from the traffic into the data center that the numbers for the
users should be significantly higher.  Then I noticed the names on the cover
sheets.  They denote that the user is root from that particular host.

	The first thing that came to mind is that it wasn't working out. Well
later I noticed a few people sent jobs to the printer that did have their
user names on the cover sheet and they were charged for the resource.  What I
would like to know is how does pc-nfs send the file to the system so that
sometimes it is owned by root and other times it is owned by the user logged
in from the PC level????  Is it random?


BTW: System setup: Host = Sun 4/390  SunOS 4.0.3
		   PC: Various IBM Compatible PC's running MS-DOS 3.31 &
		       PC-NFS 3.0.1 (WD800E)



Wayne 


/============================================================================\
+ Wayne J. Lyle					  Systems / Networks Manager +
+ Saint Joseph's University			  Academic Computing	     +
+ UUCP:	lyle@sjuphil.sju.edu, {princeton,bpa}!sjuphil!lyle		     +
+ CSNET:lyle@sju.edu 				  PHONE:(215) 660-1524	     +
\============================================================================/
-- 
/============================================================================\
+ Wayne J. Lyle					  Systems / Networks Manager +
+ Saint Joseph's University			  Academic Computing	     +
+ UUCP:	lyle@sjuphil.sju.edu, {princeton,bpa}!sjuphil!lyle		     +
+ CSNET:lyle@sju.edu 				  PHONE:(215) 660-1524	     +
\============================================================================/

perl@pbseps.UUCP (Richard Perlman) (12/10/89)

In article <1989Dec7.004957.1105@sjuphil.uucp> lyle@sjuphil.UUCP (Wayne J. Lyle) writes:
>What I would like to know is how does pc-nfs send the file to the
>system so that sometimes it is owned by root and other times it is
>owned by the user logged in from the PC level????  Is it random?
 
Simple: If the user does not enter the right password (or no
password) when "logging-in" to PC-NFS, AND they either "Abort" or
"Ignore" PC-NFS's offer to try again, they are assigned the user
ID "nobody".  UNIX UID number "-2".

For some reason (perhaps Geoff Arnold will enlighten), the host
prints the job as root instead of "nobody."  However, in either
case you won't have useful accounting information. 

There may be a way to have your SUN host refuse print services to
users who do not login properly, Geoff?

-- 
   "The universe is not only queerer than we imagine,
    but it is queerer than we can imagine."  J.B.S. Haldane
--
Richard Perlman   |*|  perl@pbseps.pacbell.com  |*|  (415) 545-0233

geoff@hinode.East.Sun.COM (Geoff Arnold @ Sun BOS - R.H. coast near the top) (12/15/89)

Quoth perl@pbseps.PacBell.COM (Richard Perlman) (in <705@pbseps.UUCP>):
#In article <1989Dec7.004957.1105@sjuphil.uucp> lyle@sjuphil.UUCP (Wayne J. Lyle) writes:
#>What I would like to know is how does pc-nfs send the file to the
#>system so that sometimes it is owned by root and other times it is
#>owned by the user logged in from the PC level????  Is it random?
# 
#Simple: If the user does not enter the right password (or no
#password) when "logging-in" to PC-NFS, AND they either "Abort" or
#"Ignore" PC-NFS's offer to try again, they are assigned the user
#ID "nobody".  UNIX UID number "-2".

True so far.

#For some reason (perhaps Geoff Arnold will enlighten), the host
#prints the job as root instead of "nobody."  However, in either
#case you won't have useful accounting information. 

Two explanations have been suggested. I pick my words
advisedly, because I can't make it fail in-house!!! The first
is that "pcnfsd" has a bug in it: the calls to set the uid and
gid should be switched. The second is that "lpr" sometimes looks
at the real uid/gid instead of the effective uid/gid: since PCNFSD
is typically owned by root, root owns the job.

On a related note, it has been pointed out that lpr will often
use a bogus jobname if pcnfsd is configured to use a very long
path to the spool directory. You can fix this by modifying pcnfsd
so that the child process chdir's to the spool directory before
issuing the lpr: apparently (some) lpr's dislike very long
paths as arguments.

However one generic problem is that every Un*x implementation
(and every site?) seems to hack the printing stuff differently -
different spool directories, permissions, etc. Which brings me to the last
point:

#There may be a way to have your SUN host refuse print services to
#users who do not login properly, Geoff?

You all get a copy of the source to pcnfsd on the PC-NFS distribution
diskettes. (And if you don't have a copy, I can post one.) It's
there in source so that you can adapt it, guys! If you want to
stop "nobody" from printing, then add the code. If you want to
log all PC-NFS logins to a file, do so! And please share the results with
us. As I posted some months ago, we want input on what should go
into the next rev of the PCNFSD protocol.

Geoff

Geoff Arnold, PCDS Group,     | Quote of the week: Too long to include
Sun Microsystems Inc.         | here - read "Being an American" by
Internet: geoff@East.Sun.COM  | Theodore A.Kaldis, <kaldis@topaz.rutgers.edu>
Disclaimer: Obviously....     | in talk.politics.misc. Quite amazing stuff!