SCCS-vsn: usr.bin/at/atrun/atrun.c 4.8
-static char sccsid[] = "@(#)atrun.c 4.7 (Berkeley) %G%";
+static char sccsid[] = "@(#)atrun.c 4.8 (Berkeley) %G%";
#endif not lint
/*
* Synopsis: atrun
#endif not lint
/*
* Synopsis: atrun
# include <sys/dir.h>
# include <sys/file.h>
# include <sys/time.h>
# include <sys/dir.h>
# include <sys/file.h>
# include <sys/time.h>
+# include <sys/param.h>
+# include <sys/quota.h>
# include <sys/stat.h>
# include <pwd.h>
# include <sys/stat.h>
# include <pwd.h>
/*
* Run the job as the owner of the jobfile
*/
/*
* Run the job as the owner of the jobfile
*/
+ quota(Q_SETUID,jobbuf.st_uid,0,0);
+ initgroups(getname(jobbuf.st_uid),jobbuf.st_gid);
setuid(jobbuf.st_uid);
/*
* Close all open files so that we can reopen a temporary file
* for stdout and sterr.
*/
setuid(jobbuf.st_uid);
/*
* Close all open files so that we can reopen a temporary file
* for stdout and sterr.
*/
+ for (i = getdtablesize(); --i >= 0;)
*
*/
open("/dev/null", 0);
*
*/
open("/dev/null", 0);
open(errfile,O_CREAT|O_WRONLY,00644);
/*
open(errfile,O_CREAT|O_WRONLY,00644);
/*
* so we'll send the owner some mail.
*/
fprintf(stderr, "%s: Can't execl shell\n",shell);
* so we'll send the owner some mail.
*/
fprintf(stderr, "%s: Can't execl shell\n",shell);