-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
33 lines (30 loc) · 784 Bytes
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <stdio.h>
#include <stdlib.h>
#include "clntsrvr.h"
int main(int argc, char **argv)
{
/*if (setuid(0) || setgid(0))*/
/*{*/
/*fprintf(stderr, "> This needs to be owned by root with the s-bit set\n");*/
/*fprintf(stderr, "chown root %s\n", argv[0]);*/
/*fprintf(stderr, "chmod +s %s\n", argv[0]);*/
/*}*/
/*printf("%d\n", geteuid());*/
/*printf("%d\n", getegid());*/
if (argc > 1 && strcmp(argv[1], "-s") == 0)
{
printf("Starting server...\n");
server();
}
if (argc > 2)
{
client(argv[1], argv[2]);
}
else
{
printf("usage:\n");
printf(" -client: %s <client_ip> <server_ip>\n", argv[0]);
printf(" -server: %s -s\n", argv[0]);
}
return 0;
}