From 118827376f8ccedb455e81b7d2b3bff029cde457 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 18 May 1998 23:57:28 +0000 Subject: Abstracted all the crappy password interfaces through an indirect function table, selectable at compile time. This should make the code that implements all the password functions much cleaner, as it's now very clear exactly what a particular password database needs to provide to Samba. Jeremy. (This used to be commit 27ca536ad974242524c12f7100e419d9e7f9647f) --- source3/include/smb.h | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'source3/include/smb.h') diff --git a/source3/include/smb.h b/source3/include/smb.h index c90f77a593..fff44f179d 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -332,7 +332,6 @@ struct sam_disp_info char *full_name; /* user's full name string */ }; - /* DOM_CHAL - challenge info */ typedef struct chal_info { @@ -635,8 +634,45 @@ struct shmem_ops { unsigned (*hash_size)(void); }; +/* + * Each implementation of the password database code needs + * to support the following operations. + */ + +struct passdb_ops { + /* + * Password database ops. + */ + void *(*startsmbpwent)(BOOL); + void (*endsmbpwent)(void *); + unsigned long (*getsmbpwpos)(void *); + BOOL (*setsmbpwpos)(void *, unsigned long); + /* + * smb password database query functions. + */ + struct smb_passwd *(*getsmbpwnam)(char *); + struct smb_passwd *(*getsmbpwuid)(uid_t); + struct smb_passwd *(*getsmbpwent)(void *); + /* + * smb password database modification functions. + */ + BOOL (*add_smbpwd_entry)(struct smb_passwd *); + BOOL (*mod_smbpwd_entry)(struct smb_passwd *, BOOL); + + /* + * Functions that manupulate a struct sam_passwd. + */ + struct sam_passwd *(*getsam21pwent)(void *); + + struct sam_passwd *(*getsam21pwnam)(char *); + struct sam_passwd *(*getsam21pwuid)(uint32); + + BOOL (*add_sam21pwd_entry)(struct sam_passwd *); + BOOL (*mod_sam21pwd_entry)(struct sam_passwd *, BOOL); +}; /* this is used for smbstatus */ + struct connect_record { int magic; -- cgit