login.c, login shell, user-setable login gid

Root Boy Jim rbj at dsys.ncsl.nist.gov
Fri Jul 21 13:48:47 AEST 1989


? From:    George A. Planansky <umb!umb!gplan at 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.



More information about the Comp.sys.sun mailing list