From 9716ca2c7ad8a1af9e0a764cfa11613431337c31 Mon Sep 17 00:00:00 2001 From: sin Date: Thu, 5 Jun 2014 17:38:38 +0100 Subject: [PATCH] OK we had our fun, now remove the randquotes from su.c --- su.c | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/su.c b/su.c index 8c8d21c..20adfad 100644 --- a/su.c +++ b/su.c @@ -8,13 +8,11 @@ #include #include #include -#include #include "config.h" #include "util.h" extern char **environ; -static const char *randreply(void); static int dologin(struct passwd *); static void @@ -54,8 +52,6 @@ main(int argc, char *argv[]) else usage(); - srand(time(NULL)); - errno = 0; pw = getpwnam(usr); if (errno) @@ -99,7 +95,7 @@ main(int argc, char *argv[]) if (!cryptpass) eprintf("crypt:"); if (strcmp(cryptpass, spw->sp_pwdp) != 0) - eprintf(randreply()); + eprintf("incorrect password\n"); } } else { if (uid) { @@ -145,26 +141,6 @@ dosu: return EXIT_SUCCESS; } -static const char * -randreply(void) -{ - static const char *replies[] = { - "Time flies like an arrow, fruit flies like a banana.\n", - "Denied.\n", - "You type like a dairy farmer.\n", - "CChheecckk yyoouurr dduupplleexx sswwiittcchh..\n", - "I met a girl with 12 nipples, it sounds weird dozen tit?\n", - "Here I am, brain the size of a planet and they ask me to keep hashing rubbish.\n", - "Clones are people two.\n", - "Your mom is an interesting su response.\n", - "no.\n", - "Your mom forgot to null-terminate???B?33??Abort (core dumped)\n", - "A fool-proof method for sculpting an elephant: first, get a huge block of marble; then you chip away everything that doesn't look like an elephant.\n", - "Bloating .data for fun and profit.\n", - }; - return replies[rand() % LEN(replies)]; -} - static int dologin(struct passwd *pw) {