Qsmtp  0.30dev
Macros | Functions | Variables
qsauth_backend_cp.c File Reference

checkpassword AUTH backend More...

#include <qsmtpd/qsauth_backend.h>
#include <log.h>
#include <netio.h>
#include <qsmtpd/qsmtpd.h>
#include <errno.h>
#include <signal.h>
#include <syslog.h>
#include <sys/wait.h>
#include <unistd.h>

Macros

#define WRITE(a, b)
 

Functions

static int err_child (void)
 
static int err_fork (void)
 
static int err_pipe (void)
 
static int err_write (void)
 
int auth_backend_execute (const struct string *user, const struct string *pass, const struct string *resp)
 authenticate a user with the given credentials More...
 
int auth_backend_setup (int argc, const char **argv)
 

Variables

const char * auth_check
 
const char ** auth_sub
 

Detailed Description

checkpassword AUTH backend

Macro Definition Documentation

#define WRITE (   a,
 
)
Value:
do { \
if (write(pi[1], (a), (b)) < 0) { \
return err_write(); \
} \
} while (0)

Function Documentation

int auth_backend_execute ( const struct string user,
const struct string pass,
const struct string resp 
)

authenticate a user with the given credentials

Parameters
useruser id
passpassword
respadditional response (e.g. for CRAM authentication)
Return values
<0processing error (negative error code is returned)
0user successfully authenticated
1authentication error (i.e. invalid user/pass combination)

resp may be passed as NULL if no additional information has been collected

Variable Documentation

const char* auth_check

checkpassword or one of his friends for auth

const char** auth_sub

subprogram to be invoked by auth_check (usually /bin/true)