netatalk  4.4.0dev
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
uam.h
Go to the documentation of this file.
1/* Copyright (c) 1999 Adrian Sun ([email protected])
2 * All Rights Reserved. See COPYRIGHT.
3 */
4
5#ifndef UAM_H
6#define UAM_H 1
7
8#include <pwd.h>
9#include <stdarg.h>
10
11/* just a label for exported bits */
12#ifndef UAM_MODULE_EXPORT
13#define UAM_MODULE_EXPORT
14#endif
15
16/* type of uam */
17#define UAM_MODULE_SERVER 1
18#define UAM_MODULE_CLIENT 2
19
20/* in case something drastic has to change */
21#define UAM_MODULE_VERSION 1
22
23/* define if minimum version of libgcrypt is required */
24#define UAM_NEED_LIBGCRYPT_VERSION NULL
25
26/* things for which we can have uams */
27#define UAM_SERVER_LOGIN (1 << 0)
28#define UAM_SERVER_CHANGEPW (1 << 1)
29#define UAM_SERVER_PRINTAUTH (1 << 2)
30#define UAM_SERVER_LOGIN_EXT (1 << 3)
31
32/* options */
33#define UAM_OPTION_USERNAME (1 << 0) /* get space for username */
34#define UAM_OPTION_GUEST (1 << 1) /* get guest user */
35#define UAM_OPTION_PASSWDOPT (1 << 2) /* get the password file */
36#define UAM_OPTION_SIGNATURE (1 << 3) /* get server signature */
37#define UAM_OPTION_RANDNUM (1 << 4) /* request a random number */
38#define UAM_OPTION_HOSTNAME (1 << 5) /* get host name */
39#define UAM_OPTION_COOKIE (1 << 6) /* cookie handle */
40#define UAM_OPTION_PROTOCOL (1 << 7) /* DSI or ASP */
41#define UAM_OPTION_CLIENTNAME (1 << 8) /* get client IP address */
42#define UAM_OPTION_KRB5SERVICE (1 << 9) /* service name for krb5 principal */
43#define UAM_OPTION_MACCHARSET (1 << 10) /* mac charset handle */
44#define UAM_OPTION_UNIXCHARSET (1 << 11) /* unix charset handle */
45#define UAM_OPTION_SESSIONINFO (1 << 12) /* unix charset handle */
46#define UAM_OPTION_KRB5REALM (1 << 13) /* krb realm */
47#define UAM_OPTION_FQDN (1 << 14) /* fully qualified name */
48
49/* some password options. you pass these in the length parameter and
50 * get back the corresponding option. not all of these are implemented. */
51#define UAM_PASSWD_FILENAME (1 << 0)
52#define UAM_PASSWD_MINLENGTH (1 << 1)
53#define UAM_PASSWD_EXPIRETIME (1 << 3) /* not implemented yet. */
54
55/* max lenght of username */
56#define UAM_USERNAMELEN 255
57
58/* i'm doing things this way because os x server's dynamic linker
59 * support is braindead. it also allows me to do a little versioning. */
60struct uam_export {
62 int (*uam_setup)(void *, const char *);
63 void (*uam_cleanup)(void);
64};
65
66#define SESSIONKEY_LEN 64
67#define SESSIONTOKEN_LEN 8
68
70 /* random session key */
73 /* kerberos/gssapi crypted key */
76 /* session token sent to the client on FPGetSessionToken*/
79 /* whole buffer cotaining e.g. idlen, id and boottime */
80 void *clientid;
82};
83
84/* register and unregister uams with these functions */
85extern UAM_MODULE_EXPORT int uam_register(const int, const char *, const char *,
86 ...);
87extern UAM_MODULE_EXPORT void uam_unregister(const int, const char *);
88
89/* helper functions */
90extern UAM_MODULE_EXPORT struct passwd *uam_getname(void *, char *, const int);
91extern UAM_MODULE_EXPORT int uam_checkuser(void *, const struct passwd *);
92
93/* afp helper functions */
94extern UAM_MODULE_EXPORT int uam_afp_read(void *, char *, size_t *,
95 int (*)(void *, void *, const int));
96extern UAM_MODULE_EXPORT int uam_afpserver_option(void *, const int, void *,
97 size_t *);
98
99#endif
#define UAM_MODULE_EXPORT
Definition logger.h:14
Definition uam.h:69
size_t sessionkey_len
Definition uam.h:72
size_t sessiontoken_len
Definition uam.h:78
size_t clientid_len
Definition uam.h:81
void * clientid
Definition uam.h:80
void * sessiontoken
Definition uam.h:77
void * cryptedkey
Definition uam.h:74
void * sessionkey
Definition uam.h:71
size_t cryptedkey_len
Definition uam.h:75
Definition uam.h:60
int(* uam_setup)(void *, const char *)
Definition uam.h:62
void(* uam_cleanup)(void)
Definition uam.h:63
int uam_version
Definition uam.h:61
int uam_type
Definition uam.h:61
UAM_MODULE_EXPORT int uam_afp_read(void *, char *, size_t *, int(*)(void *, void *, const int))
UAM_MODULE_EXPORT int uam_checkuser(void *, const struct passwd *)
Definition afpd/uam.c:314
UAM_MODULE_EXPORT int uam_afpserver_option(void *, const int, void *, size_t *)
Definition afpd/uam.c:387
UAM_MODULE_EXPORT int uam_register(const int, const char *, const char *,...)
Definition afpd/uam.c:113
UAM_MODULE_EXPORT struct passwd * uam_getname(void *, char *, const int)
Definition afpd/uam.c:217
UAM_MODULE_EXPORT void uam_unregister(const int, const char *)
Definition afpd/uam.c:193