s/qmail 4.2.29a
Next generation secure email transport
Loading...
Searching...
No Matches
Macros | Functions | Variables
qmail-authuser.c File Reference
#include <stdio.h>
#include <unistd.h>
#include "global.h"
#include "stralloc.h"
#include "buffer.h"
#include "auto_qmail.h"
#include "case.h"
#include "control.h"
#include "constmap.h"
#include "str.h"
#include "fmt.h"
#include "fd.h"
#include "open.h"
#include "byte.h"
#include "scan.h"
#include "md5.h"
#include "hmac_md5.h"
#include "sha1.h"
#include "sha256.h"
#include "pathexec.h"
#include "prot.h"
#include "wait.h"
#include "sig.h"
#include "error.h"
#include <pwd.h>
#include "hasspnam.h"
#include "hasuserpw.h"
Include dependency graph for qmail-authuser.c:

Go to the source code of this file.

Macros

#define FDAUTH   3
 
#define FDGOSSIP   1
 
#define SOCKET_CALL   "-s"
 
#define DOVECOT_SERVICE   "-x"
 
#define POP_USER   "qmail-pop3d"
 

Functions

char * crypt ()
 
void exit (int fail)
 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)
 
int dig_ascii (char *digascii, const char *digest, const int len)
 
int auth_sha1 (char *pwdhash, char *response)
 
int auth_sha256 (char *pwdhash, char *response)
 
int auth_md5 (char *pwdhash, char *response)
 
int auth_hash (char *password, char *response)
 
int auth_unix (char *user, char *response)
 
int auth_apop (unsigned char *password, unsigned char *response, unsigned char *challenge)
 
int auth_cram (unsigned char *password, unsigned char *response, unsigned char *challenge)
 
int auth_dovecot (char *user, char *response, char *socket, char *service)
 
int auth_wrapper (char *pam, char *arg1, char *arg2, char *auth, int len)
 
int main (int argc, char **argv)
 

Variables

char authbuf [512]
 
buffer ba = BUFFER_INIT(write,FDAUTH,authbuf,sizeof(authbuf))
 
struct constmap mapauthuser
 
stralloc authfile = {0}
 
stralloc disabled = {0}
 
stralloc user = {0}
 
stralloc homedir = {0}
 
stralloc shell = {0}
 

Detailed Description

Returns
0: ok 1: credentials failure 2: qmail-authuser is misused 110: can't read controls 111: temporary problem checking the password

Definition in file qmail-authuser.c.

Macro Definition Documentation

◆ DOVECOT_SERVICE

#define DOVECOT_SERVICE   "-x"

Definition at line 28 of file qmail-authuser.c.

◆ FDAUTH

#define FDAUTH   3

Definition at line 25 of file qmail-authuser.c.

◆ FDGOSSIP

#define FDGOSSIP   1

Definition at line 26 of file qmail-authuser.c.

◆ POP_USER

#define POP_USER   "qmail-pop3d"

Definition at line 29 of file qmail-authuser.c.

◆ SOCKET_CALL

#define SOCKET_CALL   "-s"

Definition at line 27 of file qmail-authuser.c.

Function Documentation

◆ auth_apop()

int auth_apop ( unsigned char *  password,
unsigned char *  response,
unsigned char *  challenge 
)

Definition at line 190 of file qmail-authuser.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ auth_cram()

int auth_cram ( unsigned char *  password,
unsigned char *  response,
unsigned char *  challenge 
)

Definition at line 205 of file qmail-authuser.c.

Here is the call graph for this function:

◆ auth_dovecot()

int auth_dovecot ( char *  user,
char *  response,
char *  socket,
char *  service 
)

Definition at line 216 of file qmail-authuser.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ auth_hash()

int auth_hash ( char *  password,
char *  response 
)

Definition at line 135 of file qmail-authuser.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ auth_md5()

int auth_md5 ( char *  pwdhash,
char *  response 
)

Definition at line 121 of file qmail-authuser.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ auth_sha1()

int auth_sha1 ( char *  pwdhash,
char *  response 
)

Definition at line 99 of file qmail-authuser.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ auth_sha256()

int auth_sha256 ( char *  pwdhash,
char *  response 
)

Definition at line 110 of file qmail-authuser.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ auth_unix()

int auth_unix ( char *  user,
char *  response 
)

Definition at line 145 of file qmail-authuser.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ auth_wrapper()

int auth_wrapper ( char *  pam,
char *  arg1,
char *  arg2,
char *  auth,
int  len 
)

Definition at line 253 of file qmail-authuser.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ crypt()

char * crypt ( )
Here is the caller graph for this function:

◆ dig_ascii()

int dig_ascii ( char *  digascii,
const char *  digest,
const int  len 
)

Definition at line 85 of file qmail-authuser.c.

Here is the caller graph for this function:

◆ exit()

void exit ( int  fail)

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)

Definition at line 77 of file qmail-authuser.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 290 of file qmail-authuser.c.

Here is the call graph for this function:

Variable Documentation

◆ authbuf

char authbuf[512]

Definition at line 55 of file qmail-authuser.c.

◆ authfile

stralloc authfile = {0}

Definition at line 59 of file qmail-authuser.c.

◆ ba

buffer ba = BUFFER_INIT(write,FDAUTH,authbuf,sizeof(authbuf))

Definition at line 56 of file qmail-authuser.c.

◆ disabled

stralloc disabled = {0}

Definition at line 60 of file qmail-authuser.c.

◆ homedir

stralloc homedir = {0}

Definition at line 62 of file qmail-authuser.c.

◆ mapauthuser

struct constmap mapauthuser

Definition at line 58 of file qmail-authuser.c.

◆ shell

stralloc shell = {0}

Definition at line 63 of file qmail-authuser.c.

◆ user

stralloc user = {0}

Definition at line 61 of file qmail-authuser.c.