Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site wlcrjs.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxn!ihnp4!wlcrjs!tsp From: tsp@wlcrjs.UUCP (Tom Poindexter) Newsgroups: net.micro.pc Subject: PC-Xenix 1 mb file size fix (ulimit) Message-ID: <727@wlcrjs.UUCP> Date: Fri, 28-Jun-85 11:41:45 EDT Article-I.D.: wlcrjs.727 Posted: Fri Jun 28 11:41:45 1985 Date-Received: Sat, 29-Jun-85 03:35:52 EDT Distribution: net Organization: chi-net, Public Access UN*X, Chicago IL Lines: 110 Some of you using PC-Xenix 1.0 know about the 1mb file size limit imposed by {ibm,microsoft}. I have written a small hack around this. The attached programs are intended to be the login shell, invoked at login time. They really just act as a wedge, setting a larger ulimit(), and invoking the real shell. The small trick is that the real uid has to be root uid for ulimit to set a larger size, so the routine gets the real uid, sets root uid, then sets the real id after the ulimit call. Two programs are provided: bigsh.c as a wedge for /bin/sh, and bigcsh.c as a wedge for /bin/csh. I didn't bother writting one for vsh. You probably want to test this on a single uid first before changing all users. (this is not in shar format). Feel free to set the USIZE define to whatever trips your trigger. Tom Poindexter -------------------bigsh.c------------------ /* * bigsh.c - sets a larger ulimit (USIZE) and invokes /bin/sh. * * use this program as the shell in /etc/passwd. * this program should be installed in /bin: * cc -i -o bigsh bigsh.c * chmod 4711 bigsh * chown root bigsh; chgrp root bigsh * * see bigcsh.c for csh */ /* define ulimit size, in 512 byte chunks */ #define USIZE 40960L /* yields 20mb, who's counting anyway? */ #includemain(argc,argv) int argc; char *argv[]; { int user; long ulimit(); user = getuid(); /* get real user id */ setuid(0); /* set root id for ulimit call */ ulimit(UL_SFILLIM,USIZE); /* set the new limit */ setuid(user); /* reset the user id */ execl("/bin/sh","-sh",(char *) 0); /* invoke sh as login shell */ } -------------------bigcsh.c------------------ /* * bigcsh.c - sets a larger ulimit (USIZE) and invokes /bin/csh. * * use this program as the shell in /etc/passwd. * this program should be installed in /bin: * cc -i -o bigcsh bigcsh.c * chmod 4711 bigcsh * chown root bigcsh; chgrp root bigcsh * * see bigsh.c for sh */ /* define ulimit size, in 512 byte chunks */ #define USIZE 40960L /* yields 20mb, who's counting anyway? */ #include main(argc,argv) int argc; char *argv[]; { int user; long ulimit(); user = getuid(); /* get real user id */ setuid(0); /* set root id for ulimit call */ ulimit(UL_SFILLIM,USIZE); /* set the new limit */ setuid(user); /* reset the user id */ execl("/bin/csh","-csh",(char *) 0); /* invoke csh as login shell */ } --------------------------------------------- -- Tom Poindexter UUCP: ihnp4!wlcrjs!tsp Compuserve: 70040,1223 Source: STW526 Dialcom: 44:SFP008