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

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

commit 4b05ca07cc622f0b50092cda3318cd804730eafc
Author: sin <sin_AT_2f30.org>
Date: Mon Jun 9 10:59:48 2014 +0100

    Port login(1) to pw_check()

diff --git a/login.c b/login.c
index 68b0c34..25f6e87 100644
--- a/login.c
+++ b/login.c
_AT_@ -2,13 +2,13 @@
 #include <errno.h>
 #include <grp.h>
 #include <pwd.h>
-#include <shadow.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <sys/ioctl.h>
 #include <sys/types.h>
 #include <unistd.h>
+#include "passwd.h"
 #include "config.h"
 #include "util.h"
 
_AT_@ -24,8 +24,7 @@ int
 main(int argc, char *argv[])
 {
         struct passwd *pw;
- struct spwd *spw;
- char *pass, *cryptpass;
+ char *pass;
         uid_t uid;
         gid_t gid;
         int pflag = 0;
_AT_@ -51,53 +50,18 @@ main(int argc, char *argv[])
         else if (!pw)
                 eprintf("who are you?
");
 
- switch (pw->pw_passwd[0]) {
- case '!':
- case '*':
- eprintf("denied
");
- }
-
         uid = pw->pw_uid;
         gid = pw->pw_gid;
 
- /* Empty password? Login now */
- if (pw->pw_passwd[0] == '
Received on Mon Jun 09 2014 - 12:13:16 CEST

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