From 3ae04902d2979a09b218993fa66ddd30f733010d Mon Sep 17 00:00:00 2001 From: mathias Date: Tue, 19 Sep 2006 20:00:49 +0000 Subject: [PATCH] * cosmetic fixes --HG-- extra : convert_revision : svn%3Aeebe1cee-a9af-4fe4-bd26-ad572b19c5ab/trunk%4051 --- src/auth_md5.c | 2 -- src/auth_pam.c | 16 ++++++++-------- src/auth_sha2.c | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/auth_md5.c b/src/auth_md5.c index bc5b215..f77406e 100644 --- a/src/auth_md5.c +++ b/src/auth_md5.c @@ -32,7 +32,6 @@ /* ---------------------------------------------------------------- *\ includes \* ---------------------------------------------------------------- */ -#include #include #include #include @@ -50,7 +49,6 @@ enum { MD5_DIGEST_STRING_LENGTH = (MD5_DIGEST_LENGTH * 2 + 1) }; -#include typedef struct { u_int32_t state[4]; /* state */ diff --git a/src/auth_pam.c b/src/auth_pam.c index 7c41632..1e0774f 100644 --- a/src/auth_pam.c +++ b/src/auth_pam.c @@ -5,7 +5,7 @@ copyr : copyright (c) 2005 by m. gumz license : see LICENSE - + start : Sa 07 Mai 2005 16:21:24 CEST $Id$ @@ -16,7 +16,7 @@ about : provide -auth pam, pam-authentification for alock - + taken from pure-ftpd's authstuff, but you can see similar stuff in xlockmore, openssh and basicly all pam-related apps :) @@ -139,7 +139,7 @@ static int alock_auth_pam_init(const char* args) { perror("password entry for uid not found"); return 0; } - + /* we can be installed setuid root to support shadow passwords, and we don't need root privileges any longer. --marekm */ setuid(getuid()); @@ -148,9 +148,9 @@ static int alock_auth_pam_init(const char* args) { } static int alock_auth_pam_deinit() { - + pwd_entry = NULL; - + return 0; } @@ -158,7 +158,7 @@ static int alock_auth_pam_auth(const char* pass) { pam_handle_t* pam_handle = NULL; - if (!pass || !pwd_entry) + if (!pass || strlen(pass) < 1 || !pwd_entry) return 0; PAM_username = pwd_entry->pw_name; @@ -169,13 +169,13 @@ static int alock_auth_pam_auth(const char* pass) { PAM_YN; pam_error = pam_end(pam_handle, pam_error); PAM_YN; - + return 1; } struct aAuth alock_auth_pam = { "pam", - alock_auth_pam_init, + alock_auth_pam_init, alock_auth_pam_auth, alock_auth_pam_deinit }; diff --git a/src/auth_sha2.c b/src/auth_sha2.c index 6a50838..1f00de6 100644 --- a/src/auth_sha2.c +++ b/src/auth_sha2.c @@ -991,7 +991,7 @@ static int alock_auth_sha2_deinit() { static int alock_auth_sha2_auth(const char* pass) { - if (!pass || !userhash || !method) + if (!pass || strlen(pass) < 1 || !userhash || !method) return 0; switch (method) {