From 67be6683e8603c4f8926e3d0c06afc7add9f4cae Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 29 Oct 2019 21:08:00 -0400 Subject: [PATCH] Real zombies are undead, not the kind you see on TV. --- ctdlsh/ctdlsh.h | 4 ++++ ctdlsh/main.c | 40 ++++++++++++++++++++++++++++++++++++++++ ctdlsh/shutdown.c | 2 +- 3 files changed, 45 insertions(+), 1 deletion(-) diff --git a/ctdlsh/ctdlsh.h b/ctdlsh/ctdlsh.h index 07ea13562..043d42b15 100644 --- a/ctdlsh/ctdlsh.h +++ b/ctdlsh/ctdlsh.h @@ -49,3 +49,7 @@ int cmd_who(int, char *); int cmd_export(int, char *); int cmd_config(int, char *); int cmd_mailq(int, char *); +int sock_puts(int, char *); +int sock_getln(int, char *, int); +void sock_printf(int, const char *, ...); +int uds_connectsock(char *); diff --git a/ctdlsh/main.c b/ctdlsh/main.c index cda33ec44..fd6663ecf 100644 --- a/ctdlsh/main.c +++ b/ctdlsh/main.c @@ -38,6 +38,26 @@ COMMAND commands[] = { }; + +struct wow { + char *cmd[5]; // increase this if we need to have larger commands + char *description; +}; + +struct wow wows[] = { + {{ "show", "eggs" } , "show how many eggs are available for serving" }, + {{ "kill", "mark", "zuckerberg" } , "die motherfucker die" }, + {{ "show", "undead", "zombies", "real" } , "show how many zombies are actually undead" }, + {{ "show", "undead", "zombies", "hollywood" } , "show how many zombies are hollywood communists" } +}; + + + + + + + + int cmd_help(int sock, char *cmdbuf) { int i; @@ -110,6 +130,7 @@ void do_main_loop(int server_socket) int i; int ret = (-1); + strcpy(prompt, "> "); /* Do an INFO command and learn the hostname for the prompt */ @@ -160,6 +181,25 @@ int main(int argc, char **argv) char cmd[1024] = { 0 }; int exitcode = 0; + + int num_wows = sizeof(wows) / sizeof(struct wow); + int j; + for (i=0; i