Article View: net.bugs
Article #538Re: inews/rnews posting problem: a fix/cure
From: Keith Muller
Date: Wed, 23 Apr 1986 17:47
Date: Wed, 23 Apr 1986 17:47
47 lines
2062 bytes
2062 bytes
I had the same problem quite a while ago. However in my case student accounts
were set up with both cpu and file limits to help prevent runaway homeworks
etc from loading down the machine. I couldn't remove the limits, so I added
the following into inews. (applies only to 4.[23] BSD).
Keith Muller
University of California
*** OLD/inews.c Wed Mar 19 17:14:29 1986
--- inews.c Fri Mar 21 00:39:17 1986
***************
*** 21,26 ****
--- 21,29 ----
#endif /* SCCSID */
#include "iparams.h"
+ #ifdef BSD4_2
+ #include <sys/resource.h>
+ #endif /* BSD4_2 */
#include <errno.h>
/* local defines for inews */
***************
*** 96,101 ****
--- 99,120 ----
register int i;
FILE *mfd; /* mail file file-descriptor */
char cbuf[BUFLEN]; /* command buffer */
+ #ifdef BSD4_2
+ struct rlimit reslimit; /* resource limits inherited from parent*/
+
+ /*
+ * if a user has limit set in his shell, inews when invoked from
+ * postnews might fail (such if the file size limit is small)
+ */
+ if (getrlimit(RLIMIT_CPU, &reslimit) == 0){
+ reslimit.rlim_cur = reslimit.rlim_max;
+ (void)setrlimit(RLIMIT_CPU, &reslimit);
+ }
+ if (getrlimit(RLIMIT_FSIZE, &reslimit) == 0){
+ reslimit.rlim_cur = reslimit.rlim_max;
+ (void)setrlimit(RLIMIT_FSIZE, &reslimit);
+ }
+ #endif /* BSD4_2 */
/* uuxqt doesn't close all it's files */
for (i = 3; !close(i); i++)
Technical Details
Message-ID:
<330@sdcc7.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!ittatc!dcdwest!sdcsvax!sdcc6!sdcc7!mullerReferences:
<646@nicmad.UUCP>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!ittatc!dcdwest!sdcsvax!sdcc6!sdcc7!muller From: muller@sdcc7.UUCP (Keith Muller) Newsgroups: net.bugs Subject: Re: inews/rnews posting problem: a fix/cure Message-ID: <330@sdcc7.UUCP> Date: Wed, 23-Apr-86 12:47:28 EST Article-I.D.: sdcc7.330 Posted: Wed Apr 23 12:47:28 1986 Date-Received: Sat, 26-Apr-86 05:57:15 EST References: <646@nicmad.UUCP> Distribution: net Organization: U.C. San Diego, Academic Computer Center Lines: 47 Summary: inews patch for posting problem