[comp.sys.sun] login.c, login shell, user-setable login gid

gplan@husc6.harvard.edu (George A. Planansky) (07/13/89)

Questions on changing user gid's & passwd's

I want to modify login.c, so it will query a user, asking for the user's
desired group number (gid).  We do accounting by charging usage to a
user's gid -- there is a mapping between accounting projects and gid's.  A
modified login would let a user select what project will be billed, at
login time.

Currently we have a newgrp command in users' .login files, which does let
them choose a project.  BUT, it kills much of the functionality of the
.login file.  And it's messy.

QUESTION:  We are running several diskless client 3/60 workstations, off a
3/280 server, using Yellow Pages, Sun OS 4.01.  I don't have OS 4 source.
IF I use my 4.3 bsd login.c, will that work fine with OS 4, or are there
differences from the OS 4 login that will cause problems?

QUESTION:  instead of modifying login, can I ask the /etc/passwd login
shell to do something at login time, like run a script, that will let a
user determine the login gid?  How would I do this?

I would like to let users change their /etc/passwd gid, as they already
can change their shell.  However, use of Yellow Pages means such a change
needs root intervention, to propogate the changed passwd data and update
the Yellow Pages databases.  

QUESTION:  What is a good way to let a user change her/his passwd gid, on
OS4 running Yellow Pages? 

(QUESTION:  Our yppasswd daemon isn't running.  What are the steps I
should follow, to get yppasswd to work.)

Thanks in advance for your help.

George Planansky, Atmosphere Environment Research, Cambridge Mass.
617 547-6207

Please email replies to: gplan@ra.umb.edu

rbj@dsys.ncsl.nist.gov (Root Boy Jim) (07/21/89)

? From:    George A. Planansky <umb!umb!gplan@husc6.harvard.edu>

? I want to modify login.c, so it will query a user, asking for the user's
? desired group number (gid).  We do accounting by charging usage to a
? user's gid -- there is a mapping between accounting projects and gid's.  A
? modified login would let a user select what project will be billed, at
? login time.

Never do real work when a simple kluge will do. In /etc/passwd put:

rbj-11:WyEyDjUAPfVRU:602:11:Root Boy Jim:/u/rbj:/bin/tcsh
rbj-22:WyEyDjUAPfVRU:602:22:Root Boy Jim:/u/rbj:/bin/tcsh

In /etc/group put:

foo:*:10:rbj-11,rbj-22
bar:*:22:rbj-11,rbj-22

Then simply login as rbj-11 or rbj-22. If you like, change the names
rbj-11 and rbj-22 to rbj-foo and rbj-bar.

Unfortunately, this restricts the real username length, but...

Your 4.3 login will probably work. To test it, simply telnet to localhost
after su'ing so you can back it out if need be.

? George Planansky, Atmosphere Environment Research, Cambridge Mass.
? 617 547-6207

	Root Boy Jim
	Have GNU, Will Travel.