static char sccsid
[] = "@(#)shio.c 5.1 (Berkeley) %G%";
* shio(cmd, fi, fo, user) execute shell of command with
* char *cmd, *fi, *fo; fi and fo as standard input/output
* non zero - failed - status from child
char *cmd
, *fi
, *fo
, *user
;
DEBUG(3, "shio - %s\n", cmd
);
if ((pid
= fork()) == 0) {
signal(SIGQUIT
, SIG_IGN
);
signal(SIGKILL
, SIG_IGN
);
|| (gninfo(user
, &uid
, path
) != 0)
f
= open(subfile(fi
), 0);
f
= creat(subfile(fo
), 0666);
execl(SHELL
, "sh", "-c", cmd
, (char *)0);
while ((ret
= wait(&status
)) != pid
&& ret
!= -1);
DEBUG(3, "status %d\n", status
);