From 8a7e1f1f3007136f06049a0b89d71dda70ab0a6f Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Thu, 17 Sep 2009 12:36:26 +0000 Subject: Small changes. --- Makefile | 8 ++++++-- netnuke.c | 10 +++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 6676c01..578abf1 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,11 @@ CFLAGS=-std=c99 -Wall -pipe -O2 +DEFINES= LFLAGS=-lutil -ltermcap -OUTPUT=netnuke +PACKAGE=netnuke all: - cc -o ${OUTPUT} ${LFLAGS} ${CFLAGS} netnuke.c + gcc $(SVNDEF) -o $(PACKAGE) $(DEFINES) $(CFLAGS) $(LFLAGS) netnuke.c + strip netnuke +clean: + rm netnuke diff --git a/netnuke.c b/netnuke.c index 7983a08..9e81cf7 100644 --- a/netnuke.c +++ b/netnuke.c @@ -480,7 +480,8 @@ int filterArg(const char* key, char* value, short flags) int main(int argc, char* argv[]) { - printf("\033[2J"); + /* ANSI clear-screen sequence */ + //printf("\033[2J"); int tok = 0; /* Static arguments that must happen first */ @@ -566,6 +567,13 @@ int main(int argc, char* argv[]) } } + /* Check for root privs before going any further */ + if((getuid()) != 0) + { + fprintf(stderr, "You must be root first, sorry.\n"); + exit(3); + } + int i = 0; int mt = 0; -- cgit