[hackers] [ubase] Add initial pw_check() || sin

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

commit 77a2f9f92c41ca78da37b4bf576ca5612883b16d
Author: sin <sin_AT_2f30.org>
Date: Mon Jun 9 10:51:02 2014 +0100

    Add initial pw_check()

diff --git a/passwd.h b/passwd.h
index c986116..88881f7 100644
--- a/passwd.h
+++ b/passwd.h
_AT_@ -1,4 +1,5 @@
 /* See LICENSE file for copyright and license details. */
 /* passwd.c */
-int pw_scan(char *, struct passwd *);
+int pw_check(struct passwd *, const char *);
 int pw_copy(int, int, const struct passwd *);
+int pw_scan(char *, struct passwd *);
diff --git a/util/passwd.c b/util/passwd.c
index d65038e..4929317 100644
--- a/util/passwd.c
+++ b/util/passwd.c
_AT_@ -1,12 +1,102 @@
 /* See LICENSE file for copyright and license details. */
+#include <errno.h>
 #include <pwd.h>
+#include <shadow.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <unistd.h>
+#include "../passwd.h"
 #include "../text.h"
 #include "../util.h"
 
 int
+pw_check(struct passwd *pw, const char *pass)
+{
+ char *cryptpass, *p;
+ struct spwd *spw;
+
+ p = pw->pw_passwd;
+ switch (pw->pw_passwd[0]) {
+ case '!':
+ case '*':
+ eprintf("denied
");
+ }
+
+ if (pw->pw_passwd[0] == '
Received on Mon Jun 09 2014 - 12:12:58 CEST

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