X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/3b600ead559fe112c8ab5ec49de92ae74ae4a1c9..c4a78beadb6fec94784844776ae92ba20000bea0:/usr/src/cmd/atrun.c?ds=inline diff --git a/usr/src/cmd/atrun.c b/usr/src/cmd/atrun.c index 8b01befc3e..401862a8cf 100644 --- a/usr/src/cmd/atrun.c +++ b/usr/src/cmd/atrun.c @@ -22,6 +22,8 @@ char **argv; struct direct dirent; FILE *dirf; + setuid(0); + setgid(0); chdir(DIR); makenowtime(); if ((dirf = fopen(".", "r")) == NULL) { @@ -78,6 +80,7 @@ char *file; register pid, i; char sbuf[64]; + /* printf("running %s\n", file); */ if (fork()!=0) return; for (i=0; i<15; i++) @@ -88,8 +91,6 @@ char *file; chdir(PDIR); if (stat(file, &stbuf) == -1) exit(1); - setgid(stbuf.st_gid); - setuid(stbuf.st_uid); if (pid = fork()) { if (pid == -1) exit(1); @@ -97,6 +98,8 @@ char *file; unlink(file); exit(0); } + setgid(stbuf.st_gid); + setuid(stbuf.st_uid); nice(3); execl("/bin/sh", "sh", file, 0); execl("/usr/bin/sh", "sh", file, 0);