netatalk  4.4.0dev
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
uams_randnum.c File Reference
#include <arpa/inet.h>
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <unistd.h>
#include <gcrypt.h>
#include <atalk/logger.h>
#include <atalk/afp.h>
#include <atalk/uam.h>

Macros

#define DES_KEY_SZ   8
#define PASSWDLEN   8
#define randhash(a)
#define PASSWD_ILLEGAL   '*'
#define unhex(x)

Functions

static int home_passwd (const struct passwd *pwd, const char *path, const int pathlen _U_, unsigned char *passwd, const int len, const int set)
static int afppasswd (const struct passwd *pwd, const char *path, const int pathlen, unsigned char *passwd, int len, const int set)
static int randpass (const struct passwd *pwd, const char *file, unsigned char *passwd, const int len, const int set)
static int rand_login (void *obj, char *username, int ulen, struct passwd **uam_pwd _U_, char *ibuf _U_, size_t ibuflen _U_, char *rbuf, size_t *rbuflen)
static int randnum_logincont (void *obj, struct passwd **uam_pwd, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen)
static int rand2num_logincont (void *obj, struct passwd **uam_pwd, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen)
static int randnum_changepw (void *obj, const char *username _U_, struct passwd *pwd, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen _U_)
static int randnum_login (void *obj, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
static int randnum_login_ext (void *obj, char *uname, struct passwd **uam_pwd, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
static int uam_setup (void *obj, const char *path)
static void uam_cleanup (void)

Variables

static unsigned char seskey [8]
static struct passwd * randpwd
static uint8_t randbuf [8]
UAM_MODULE_EXPORT struct uam_export uams_randnum

Macro Definition Documentation

◆ DES_KEY_SZ

#define DES_KEY_SZ   8

◆ PASSWD_ILLEGAL

#define PASSWD_ILLEGAL   '*'

◆ PASSWDLEN

#define PASSWDLEN   8

◆ randhash

#define randhash ( a)
Value:
(((((unsigned long) a) >> 8) ^ \
((unsigned long)a)) & 0xffff)

◆ unhex

#define unhex ( x)
Value:
(isdigit(x) ? (x) - '0' : toupper(x) + 10 - 'A')

Function Documentation

◆ afppasswd()

int afppasswd ( const struct passwd * pwd,
const char * path,
const int pathlen,
unsigned char * passwd,
int len,
const int set )
static

◆ home_passwd()

int home_passwd ( const struct passwd * pwd,
const char * path,
const int pathlen _U_,
unsigned char * passwd,
const int len,
const int set )
static

◆ rand2num_logincont()

int rand2num_logincont ( void * obj,
struct passwd ** uam_pwd,
char * ibuf,
size_t ibuflen _U_,
char * rbuf,
size_t * rbuflen )
static

◆ rand_login()

int rand_login ( void * obj,
char * username,
int ulen,
struct passwd **uam_pwd _U_,
char *ibuf _U_,
size_t ibuflen _U_,
char * rbuf,
size_t * rbuflen )
static

◆ randnum_changepw()

int randnum_changepw ( void * obj,
const char *username _U_,
struct passwd * pwd,
char * ibuf,
size_t ibuflen _U_,
char *rbuf _U_,
size_t *rbuflen _U_ )
static

◆ randnum_login()

int randnum_login ( void * obj,
struct passwd ** uam_pwd,
char * ibuf,
size_t ibuflen,
char * rbuf,
size_t * rbuflen )
static

◆ randnum_login_ext()

int randnum_login_ext ( void * obj,
char * uname,
struct passwd ** uam_pwd,
char * ibuf,
size_t ibuflen,
char * rbuf,
size_t * rbuflen )
static

◆ randnum_logincont()

int randnum_logincont ( void * obj,
struct passwd ** uam_pwd,
char * ibuf,
size_t ibuflen _U_,
char *rbuf _U_,
size_t * rbuflen )
static

◆ randpass()

int randpass ( const struct passwd * pwd,
const char * file,
unsigned char * passwd,
const int len,
const int set )
static

◆ uam_cleanup()

void uam_cleanup ( void )
static

◆ uam_setup()

int uam_setup ( void * obj,
const char * path )
static

Variable Documentation

◆ randbuf

uint8_t randbuf[8]
static

◆ randpwd

struct passwd* randpwd
static

◆ seskey

unsigned char seskey[8]
static

◆ uams_randnum

UAM_MODULE_EXPORT struct uam_export uams_randnum
Initial value:
= {
}
#define UAM_MODULE_VERSION
Definition uam.h:21
#define UAM_MODULE_SERVER
Definition uam.h:17
static int uam_setup(void *obj _U_, const char *path)
Definition uams_dhx2_pam.c:1028
static void uam_cleanup(void)
Definition uams_dhx2_pam.c:1050