Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/cron/cron/popen.c
Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | |||||
* Special version of popen which avoids call to shell. This insures no one | * Special version of popen which avoids call to shell. This insures no one | ||||
* may create a pipe to a hidden program as a side effect of a list or dir | * may create a pipe to a hidden program as a side effect of a list or dir | ||||
* command. | * command. | ||||
*/ | */ | ||||
static PID_T *pids; | static PID_T *pids; | ||||
static int fds; | static int fds; | ||||
FILE * | FILE * | ||||
cron_popen(program, type, e) | cron_popen(program, type, e, pidptr) | ||||
char *program, *type; | char *program, *type; | ||||
entry *e; | entry *e; | ||||
PID_T *pidptr; | |||||
{ | { | ||||
register char *cp; | register char *cp; | ||||
FILE *iop; | FILE *iop; | ||||
int argc, pdes[2]; | int argc, pdes[2]; | ||||
PID_T pid; | PID_T pid; | ||||
char *usernm; | char *usernm; | ||||
char *argv[MAX_ARGS + 1]; | char *argv[MAX_ARGS + 1]; | ||||
# if defined(LOGIN_CAP) | # if defined(LOGIN_CAP) | ||||
▲ Show 20 Lines • Show All 144 Lines • ▼ Show 20 Lines | |||||
pfree: | pfree: | ||||
#if WANT_GLOBBING | #if WANT_GLOBBING | ||||
for (argc = 1; argv[argc] != NULL; argc++) { | for (argc = 1; argv[argc] != NULL; argc++) { | ||||
/* blkfree((char **)argv[argc]); */ | /* blkfree((char **)argv[argc]); */ | ||||
free((char *)argv[argc]); | free((char *)argv[argc]); | ||||
} | } | ||||
#endif | #endif | ||||
*pidptr = pid; | |||||
return(iop); | return(iop); | ||||
} | } | ||||
int | int | ||||
cron_pclose(iop) | cron_pclose(iop) | ||||
FILE *iop; | FILE *iop; | ||||
{ | { | ||||
register int fdes; | register int fdes; | ||||
Show All 18 Lines |