netatalk: auth.c File Reference

netatalk 4.5.1
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
auth.c File Reference
`#include <arpa/inet.h>`
`#include <ctype.h>`
`#include <errno.h>`
`#include <grp.h>`
`#include <limits.h>`
`#include <netdb.h>`
`#include <pwd.h>`
`#include <signal.h>`
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include <sys/socket.h>`
`#include <sys/param.h>`
`#include <sys/stat.h>`
`#include <sys/types.h>`
`#include <time.h>`
`#include <unistd.h>`
`#include <atalk/afp.h>`
`#include <atalk/asp.h>`
`#include <atalk/compat.h>`
`#include <atalk/dsi.h>`
`#include <atalk/fce_api.h>`
`#include <atalk/globals.h>`
`#include <atalk/logger.h>`
`#include <atalk/server_ipc.h>`
`#include <atalk/spotlight.h>`
`#include <atalk/unix.h>`
`#include <atalk/util.h>`
`#include <atalk/uuid.h>`
`#include "acls.h"`
`#include "auth.h"`
`#include "extattrs.h"`
`#include "fork.h"`
`#include "status.h"`
`#include "switch.h"`
`#include "uam_auth.h"`

## Macros
#define | UAM_LIST(type)

## Functions
static socklen_t | sockaddr_len (const struct sockaddr *sa)
static const char * | client_address (AFPObj *obj)
void | status_versions (char *data, const ASP asp, const DSI *dsi)
void | status_uams (char *data, const char *authlist)
static int | send_reply (const AFPObj *obj, const int err)
static int | afp_errpwdexpired (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
static int | afp_null_nolog (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
static int | set_auth_switch (const AFPObj *obj, int expired)
static int | login (AFPObj *obj, struct passwd *pwd, void(*logout)(void), int expired)
int | afp_zzz (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
static int | create_session_token (AFPObj *obj)
static int | create_session_key (AFPObj *obj)
int | afp_getsession (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
int | afp_disconnect (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
static int | get_version (AFPObj *obj, char *ibuf, size_t ibuflen, size_t len)
int | afp_login (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
int | afp_login_ext (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
int | afp_logincont (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
int | afp_logout (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
int | afp_changepw (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
int | afp_getuserinfo (AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *rbuflen)
struct uam_obj * | auth_uamfind (const int type, const char *name, const int len)
int | auth_register (const int type, struct uam_obj *uam)
int | auth_load (AFPObj *obj, const char *path, const char *list)
void | auth_unload (void)

## Variables
volatile sig_atomic_t | die_pending
static int | afp_version_index
static struct uam_mod | uam_modules = {NULL, NULL, &uam_modules, &uam_modules}
static struct uam_obj | uam_login
static struct uam_obj | uam_changepw
static struct uam_obj * | afp_uam = NULL

## Macro Definition Documentation

## ◆ UAM_LIST

#define UAM_LIST | ( |  | type | ) |

Value:
(((type) == UAM_SERVER_LOGIN || (type) == UAM_SERVER_LOGIN_EXT) ? &uam_login : \
(((type) == UAM_SERVER_CHANGEPW) ? \
&uam_changepw : NULL))
uam_changepw
static struct uam_obj uam_changepw
Definition afpd/auth.c:66
uam_login
static struct uam_obj uam_login
Definition afpd/auth.c:63
type
static enum op type
Definition nad_cp.c:96
UAM_SERVER_LOGIN_EXT
#define UAM_SERVER_LOGIN_EXT
Definition uam.h:30
UAM_SERVER_CHANGEPW
#define UAM_SERVER_CHANGEPW
Definition uam.h:28
UAM_SERVER_LOGIN
#define UAM_SERVER_LOGIN
Definition uam.h:27
NULL
#define NULL
Definition utf8util.c:47

## Function Documentation

## ◆ afp_changepw()

int afp_changepw | ( | AFPObj * | obj,
|  | char * | ibuf,
|  | size_t | ibuflen,
|  | char * | rbuf,
|  | size_t * | rbuflen )

## ◆ afp_disconnect()

int afp_disconnect | ( | AFPObj * | obj,
|  | char * | ibuf,
|  | size_t | ibuflen,
|  | char * | rbuf,
|  | size_t * | rbuflen )

## ◆ afp_errpwdexpired()

int afp_errpwdexpired | ( | AFPObj * | obj,
|  | char * | ibuf,
|  | size_t | ibuflen,
|  | char * | rbuf,
|  | size_t * | rbuflen )
| static

## ◆ afp_getsession()

int afp_getsession | ( | AFPObj * | obj,
|  | char * | ibuf,
|  | size_t | ibuflen,
|  | char * | rbuf,
|  | size_t * | rbuflen )

## ◆ afp_getuserinfo()

int afp_getuserinfo | ( | AFPObj * | obj,
|  | char * | ibuf,
|  | size_t | ibuflen,
|  | char * | rbuf,
|  | size_t * | rbuflen )

## ◆ afp_login()

int afp_login | ( | AFPObj * | obj,
|  | char * | ibuf,
|  | size_t | ibuflen,
|  | char * | rbuf,
|  | size_t * | rbuflen )

## ◆ afp_login_ext()

int afp_login_ext | ( | AFPObj * | obj,
|  | char * | ibuf,
|  | size_t | ibuflen,
|  | char * | rbuf,
|  | size_t * | rbuflen )

## ◆ afp_logincont()

int afp_logincont | ( | AFPObj * | obj,
|  | char * | ibuf,
|  | size_t | ibuflen,
|  | char * | rbuf,
|  | size_t * | rbuflen )

## ◆ afp_logout()

int afp_logout | ( | AFPObj * | obj,
|  | char * | ibuf,
|  | size_t | ibuflen,
|  | char * | rbuf,
|  | size_t * | rbuflen )

## ◆ afp_null_nolog()

int afp_null_nolog | ( | AFPObj * | obj,
|  | char * | ibuf,
|  | size_t | ibuflen,
|  | char * | rbuf,
|  | size_t * | rbuflen )
| static

## ◆ afp_zzz()

int afp_zzz | ( | AFPObj * | obj,
|  | char * | ibuf,
|  | size_t | ibuflen,
|  | char * | rbuf,
|  | size_t * | rbuflen )

## ◆ auth_load()

int auth_load | ( | AFPObj * | obj,
|  | const char * | path,
|  | const char * | list )

load all of the modules

## ◆ auth_register()

int auth_register | ( | const int | type,
|  | struct uam_obj * | uam )

## ◆ auth_uamfind()

struct uam_obj * auth_uamfind | ( | const int | type,
|  | const char * | name,
|  | const int | len )

## ◆ auth_unload()

void auth_unload | ( | void |  | ) |

get rid of all of the uams

## ◆ client_address()

const char * client_address | ( | AFPObj * | obj | ) |
| static

## ◆ create_session_key()

int create_session_key | ( | AFPObj * | obj | ) |
| static

## ◆ create_session_token()

int create_session_token | ( | AFPObj * | obj | ) |
| static

## ◆ get_version()

int get_version | ( | AFPObj * | obj,
|  | char * | ibuf,
|  | size_t | ibuflen,
|  | size_t | len )
| static

## ◆ login()

int login | ( | AFPObj * | obj,
|  | struct passwd * | pwd,
|  | void(* | logout )(void),
|  | int | expired )
| static

## ◆ send_reply()

int send_reply | ( | const AFPObj * | obj,
|  | const int | err )
| static

## ◆ set_auth_switch()

int set_auth_switch | ( | const AFPObj * | obj,
|  | int | expired )
| static

## ◆ sockaddr_len()

socklen_t sockaddr_len | ( | const struct sockaddr * | sa | ) |
| static

## ◆ status_uams()

void status_uams | ( | char * | data,
|  | const char * | authlist )

## ◆ status_versions()

void status_versions | ( | char * | data,
|  | const ASP | asp,
|  | const DSI * | dsi )

## Variable Documentation

## ◆ afp_uam

struct uam_obj* afp_uam = NULL
| static

## ◆ afp_version_index

int afp_version_index
| static

## ◆ die_pending

volatile sig_atomic_t die_pending
| extern

## ◆ uam_changepw

struct uam_obj uam_changepw
| static

Initial value:
= {"", "", 0, {{NULL, NULL, NULL, NULL}}, &uam_changepw,
&uam_changepw
}

## ◆ uam_login

struct uam_obj uam_login
| static

Initial value:
= {"", "", 0, {{NULL, NULL, NULL, NULL }}, &uam_login,
&uam_login
}

## ◆ uam_modules

struct uam_mod uam_modules = {NULL, NULL, &uam_modules, &uam_modules}
| static