summaryrefslogtreecommitdiff
path: root/src/qmail-authuser.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/qmail-authuser.c')
-rw-r--r--src/qmail-authuser.c45
1 files changed, 24 insertions, 21 deletions
diff --git a/src/qmail-authuser.c b/src/qmail-authuser.c
index 2cdb01e..c26d61b 100644
--- a/src/qmail-authuser.c
+++ b/src/qmail-authuser.c
@@ -1,7 +1,10 @@
+#include <pwd.h>
#include <unistd.h>
#include <stdio.h>
+#include <crypt.h>
+
#include "buffer.h"
#include "byte.h"
#include "case.h"
@@ -21,32 +24,29 @@
#include "auto_qmail.h"
#include "control.h"
#include "global.h"
+#include "hasspnam.h"
+#include "hasuserpw.h"
#include "hmac_md5.h"
#include "md5.h"
#include "sha1.h"
#include "sha256.h"
-#define FDAUTH 3
-#define FDGOSSIP 1
-#define SOCKET_CALL "-s"
-#define DOVECOT_SERVICE "-x"
-#define POP_USER "qmail-pop3d"
-
-extern char *crypt();
-#include <pwd.h>
-static struct passwd *pw;
-#include "hasspnam.h"
#ifdef HASGETSPNAM
#include <shadow.h>
static struct spwd *spw;
#endif
-#include "hasuserpw.h"
#ifdef HASUSERPW
#include <userpw.h>
static struct userpw *upw;
#endif
+#define FDAUTH 3
+#define FDGOSSIP 1
+#define SOCKET_CALL "-s"
+#define DOVECOT_SERVICE "-x"
+#define POP_USER "qmail-pop3d"
+
/** @file qmail-authuser.c
@return 0: ok
1: credentials failure
@@ -55,6 +55,8 @@ static struct userpw *upw;
111: temporary problem checking the password
*/
+static struct passwd *pw;
+
char authbuf[512];
buffer ba = BUFFER_INIT(write, FDAUTH, authbuf, sizeof(authbuf));
@@ -65,16 +67,17 @@ stralloc user = {0}; // user w/o domain appended
stralloc homedir = {0};
stralloc shell = {0};
-/** @brief Supported storage methods:
- (1) authuser:[=]plainpasswd,
- (2) authuser:%hashpasswd,
- (3) authuser:?, authuser:!, *:?, *:! (! -> +environment)
- (4) x:+ -> checkvpw; x = { user@domain, @domain, @ } vmailmgr
- (5) x:& -> vchkpw; x = { user@domain, @domain, @ } vpopmail
- (6) x:= -> qmail-client; x = { user@domain, @domain, @ } dovecot
- Supported auth methods:
- user/login/plain: (1,2,3,4,5,6),
- cram-md5/apop: (1,5)
+/**
+ @brief Supported storage methods:
+ (1) authuser:[=]plainpasswd,
+ (2) authuser:%hashpasswd,
+ (3) authuser:?, authuser:!, *:?, *:! (! -> +environment)
+ (4) x:+ -> checkvpw; x = { user@domain, @domain, @ } vmailmgr
+ (5) x:& -> vchkpw; x = { user@domain, @domain, @ } vpopmail
+ (6) x:= -> qmail-client; x = { user@domain, @domain, @ } dovecot
+ Supported auth methods:
+ user/login/plain: (1,2,3,4,5,6),
+ cram-md5/apop: (1,5)
*/
void exit(int fail)