[hackers] [ubase] Port su(1) to use pw_check() || sin

From: <git_AT_suckless.org>
Date: Mon, 09 Jun 2014 12:13:11 +0200

commit 12083d49e57b33e3cdb455d386b058bc0f2bdae0
Author: sin <sin_AT_2f30.org>
Date: Mon Jun 9 10:55:41 2014 +0100

    Port su(1) to use pw_check()

diff --git a/su.c b/su.c
index 20adfad..1c69ce3 100644
--- a/su.c
+++ b/su.c
_AT_@ -4,10 +4,10 @@
 #include <errno.h>
 #include <pwd.h>
 #include <grp.h>
-#include <shadow.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
+#include "passwd.h"
 #include "config.h"
 #include "util.h"
 
_AT_@ -27,9 +27,8 @@ static int pflag = 0;
 int
 main(int argc, char *argv[])
 {
- char *usr = "root", *pass, *cryptpass;
+ char *usr = "root", *pass;
         char *shell;
- struct spwd *spw;
         struct passwd *pw;
         char *newargv[2];
         uid_t uid;
_AT_@ -59,55 +58,15 @@ main(int argc, char *argv[])
         else if (!pw)
                 eprintf("who are you?
");
 
- switch (pw->pw_passwd[0]) {
- case '!':
- case '*':
- eprintf("denied
");
- }
-
- /* Empty password? Su now */
- if (pw->pw_passwd[0] == '
Received on Mon Jun 09 2014 - 12:13:11 CEST

This archive was generated by hypermail 2.3.0 : Mon Jun 09 2014 - 12:24:09 CEST