ulimit -- You don't need sources! (kind of long)

Paul S. Sawyer pss at unh.UUCP
Fri May 5 04:04:48 AEST 1989


In article <5627 at xyzzy.UUCP>, duncan at rtp48.dg.com (W. Lee Duncan) writes:
> I suppose all have already though of this, but you don't need sources
> to modify login (or any other program).
> 
> Simply move /bin/login to, e.g. /usr/lib/old_login (and make it non-setuid).
> Then, create a new /bin/login program (which will be setuid to root):
> 
...
> 	/* set some big ulimit */
> 	/* call the orig. login */
...
Since INIT is running as root anyway, it can set the ulimit and then call
getty.  E.g., in /etc/inittab:

t000:2:respawn:/etc/gettyup tty000 9600

	where /etc/gettyup is:

ulimit 100000; exec /etc/getty $* 

This lets you put the higher limit on only the lines you wish.  Some versions
of init let you put the whole thing in the inittab.  (mine wouldn't,
back when I first did this)


> Note that, if you wish to have some sort of user database that's used
> to find the ulimit per user, and you access that here (instead of just
> setting the ulimit to a large value) you can get in to trouble (email
> me if you don't know what I mean here).

Yes, so why not UP the ulimit as above for EVERYBODY (as above), then do
user specific stuff within /etc/profile - - anybody can set the ulimit down;
for users you trust, or will trust someday, put it in their original
$HOME/.profile  (of course, I am speaking Sys5 and /bin/sh here, but
that's where this problem comes from in the first place... B-)

> Just use common sense and testing, and this should work fine.

(But this IS SysV !  ;-)  ;-)  ;-)



-- 
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Paul S. Sawyer              uunet!unh!unhtel!paul     paul at unhtel.UUCP
UNH Telecommunications
Durham, NH  03824-3523      VOX: 603-862-3262         FAX: 603-862-2030



More information about the Comp.bugs.sys5 mailing list