. verbose recovery of tcpd

. chroot shows exit status to parent
This commit is contained in:
Ben Gras 2006-03-15 14:39:20 +00:00
parent 7fecfd3740
commit e07a62161a
2 changed files with 14 additions and 3 deletions

View file

@ -3,9 +3,13 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/wait.h>
int
main(int argc, char *argv[])
{
int status;
if(argc != 3) {
fprintf(stderr, "usage: %s <root> <command>\n", argv[0]);
return 1;
@ -16,8 +20,9 @@ main(int argc, char *argv[])
return 1;
}
system(argv[2]);
return 0;
status = system(argv[2]);
if(WIFEXITED(status))
return WEXITSTATUS(status);
return 1;
}

View file

@ -64,6 +64,7 @@ static void usage(void)
int main(int argc, char **argv)
{
tcpport_t port;
int last_failed = 0;
struct nwio_tcpcl tcplistenopt;
struct nwio_tcpconf tcpconf;
struct nwio_tcpopt tcpopt;
@ -179,8 +180,13 @@ int main(int argc, char **argv)
exit(1);
}
#endif
last_failed = 1;
goto bad;
}
if(last_failed)
fprintf(stderr, "%s %s: %s: Ok\n",
arg0, service, tcp_device);
last_failed = 0;
tcpconf.nwtc_flags= NWTC_LP_SET | NWTC_UNSET_RA | NWTC_UNSET_RP;
tcpconf.nwtc_locport= port;