ubase

suckless linux base utils
git clone git://git.2f30.org/ubase
Log | Files | Refs | README | LICENSE

commit 9716ca2c7ad8a1af9e0a764cfa11613431337c31
parent 2ea51e8cd8c60c22adfb0ad5bfd4e4e589a9605a
Author: sin <sin@2f30.org>
Date:   Thu,  5 Jun 2014 17:38:38 +0100

OK we had our fun, now remove the randquotes from su.c

Diffstat:
Msu.c | 26+-------------------------
1 file changed, 1 insertion(+), 25 deletions(-)

diff --git a/su.c b/su.c @@ -8,13 +8,11 @@ #include <stdio.h> #include <string.h> #include <stdlib.h> -#include <time.h> #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) {