Use execv to cat out hosts list to see who's been blocked.
This commit is contained in:
parent
7c0f494f40
commit
258e2c8de3
9
main.c
9
main.c
@ -46,13 +46,12 @@ void showHosts()
|
|||||||
{
|
{
|
||||||
pid_t child = fork();
|
pid_t child = fork();
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
char * argv[] = {
|
|
||||||
"/etc/hosts"
|
char *const parmList[] = {"/bin/cat", "/etc/hosts", NULL};
|
||||||
};
|
|
||||||
|
|
||||||
if (child == 0)
|
if (child == 0)
|
||||||
{
|
{
|
||||||
execv("/bin/cat", argv);
|
execv("/bin/cat", parmList);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -88,7 +87,7 @@ int main(int argc, char **argv)
|
|||||||
usage();
|
usage();
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
else
|
else if (strcmp(argv[i], "show") == 0)
|
||||||
{
|
{
|
||||||
showHosts();
|
showHosts();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user