🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.sys5
Article #1087

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

#1087
From: Paul S. Sawyer
Date: Thu, 04 May 1989 18:04
47 lines
2280 bytes
In article <5627@xyzzy.UUCP>, duncan@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@unhtel.UUCP
UNH Telecommunications
Durham, NH  03824-3523      VOX: 603-862-3262         FAX: 603-862-2030
Technical Details
Message-ID: <1153@unh.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!lll-winken!uunet!unh!pss
References: <836@twwells.uucp> <4428@ihuxz.ATT.COM> <545@aurora.AthabascaU.CA> <5627@xyzzy.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!lll-winken!uunet!unh!pss
From: pss@unh.UUCP (Paul S. Sawyer)
Newsgroups: comp.bugs.sys5
Subject: Re: ulimit -- You don't need sources! (kind of long)
Summary: Don't even need C or setuid...
Keywords: sources, C
Message-ID: <1153@unh.UUCP>
Date: 4 May 89 18:04:48 GMT
References: <836@twwells.uucp> <4428@ihuxz.ATT.COM> <545@aurora.AthabascaU.CA> <5627@xyzzy.UUCP>
Organization: UNH Telecommunications
Lines: 47