diff options
author | Jeremy Allison <jra@samba.org> | 1998-05-18 23:57:28 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1998-05-18 23:57:28 +0000 |
commit | 118827376f8ccedb455e81b7d2b3bff029cde457 (patch) | |
tree | 2d30e099e7d04926af763ec530cdbd281ce6fafd /source3/include | |
parent | ffab54750f0eec202895670dd9293ee4aa3eb475 (diff) | |
download | samba-118827376f8ccedb455e81b7d2b3bff029cde457.tar.gz samba-118827376f8ccedb455e81b7d2b3bff029cde457.tar.bz2 samba-118827376f8ccedb455e81b7d2b3bff029cde457.zip |
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)
Diffstat (limited to 'source3/include')
-rw-r--r-- | source3/include/proto.h | 34 | ||||
-rw-r--r-- | source3/include/smb.h | 38 |
2 files changed, 45 insertions, 27 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index aea8543271..8207aa8adc 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -225,16 +225,7 @@ void initialize_multibyte_vectors( int client_codepage); /*The following definitions come from ldap.c */ -BOOL add_ldappwd_entry(struct smb_passwd *newpwd); -BOOL mod_ldappwd_entry(struct smb_passwd *pwd, BOOL override); -BOOL add_ldap21pwd_entry(struct sam_passwd *newpwd); -BOOL mod_ldap21pwd_entry(struct sam_passwd *pwd, BOOL override); -void *startldappwent(BOOL update); -struct smb_passwd *getldappwent(void *vp); -struct sam_passwd *getldap21pwent(void *vp); -void endldappwent(void *vp); -unsigned long getldappwpos(void *vp); -BOOL setldappwpos(void *vp, unsigned long tok); +struct passdb_ops *ldap_initialize_password_db(void); /*The following definitions come from lib/rpc/client/cli_login.c */ @@ -1213,15 +1204,7 @@ BOOL resolve_name(char *name, struct in_addr *return_ip); /*The following definitions come from nisppass.c */ -void *startnisppwent(BOOL update); -void endnisppwent(void *vp); -struct sam_passwd *getnisp21pwent(void *vp); -unsigned long getnisppwpos(void *vp); -BOOL setnisppwpos(void *vp, unsigned long tok); -BOOL add_nisp21pwd_entry(struct sam_passwd *newpwd); -BOOL mod_nisp21pwd_entry(struct sam_passwd* pwd, BOOL override); -struct sam_passwd *getnisp21pwnam(char *name); -struct sam_passwd *getnisp21pwuid(int smb_userid); +struct passdb_ops *nisplus_initialize_password_db(void); /*The following definitions come from nmbd.c */ @@ -1572,6 +1555,9 @@ BOOL pm_process( char *FileName, /*The following definitions come from passdb.c */ +struct smb_passwd *iterate_getsmbpwuid(uid_t smb_userid); +struct smb_passwd *iterate_getsmbpwnam(char *name); +BOOL initialize_password_db(void); void *startsmbpwent(BOOL update); void endsmbpwent(void *vp); struct smb_passwd *getsmbpwent(void *vp); @@ -1581,6 +1567,8 @@ BOOL add_smbpwd_entry(struct smb_passwd *newpwd); BOOL mod_smbpwd_entry(struct smb_passwd* pwd, BOOL override); struct smb_passwd *getsmbpwnam(char *name); struct smb_passwd *getsmbpwuid(uid_t smb_userid); +struct sam_passwd *iterate_getsam21pwnam(char *name); +struct sam_passwd *iterate_getsam21pwuid(uint32 uid); struct sam_disp_info *getsamdispent(void *vp); struct sam_passwd *getsam21pwent(void *vp); BOOL add_sam21pwd_entry(struct sam_passwd *newpwd); @@ -1830,16 +1818,10 @@ char *smb_errstr(char *inbuf); /*The following definitions come from smbpass.c */ -void *startsmbfilepwent(BOOL update); -void endsmbfilepwent(void *vp); -struct sam_passwd *getsmbfile21pwent(void *vp); struct smb_passwd *getsmbfilepwent(void *vp); -unsigned long getsmbfilepwpos(void *vp); -BOOL setsmbfilepwpos(void *vp, unsigned long tok); -BOOL add_smbfile21pwd_entry(struct sam_passwd *newpwd); -BOOL add_smbfilepwd_entry(struct smb_passwd *newpwd); BOOL mod_smbfile21pwd_entry(struct sam_passwd* pwd, BOOL override); BOOL mod_smbfilepwd_entry(struct smb_passwd* pwd, BOOL override); +struct passdb_ops *file_initialize_password_db(void); /*The following definitions come from smbpassfile.c */ 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; |