2 Unix SMB/CIFS implementation.
3 passdb structures and parameters
4 Copyright (C) Gerald Carter 2001
5 Copyright (C) Luke Kenneth Casson Leighton 1998 - 2000
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 /*****************************************************************
27 Functions to be implemented by the new (v2) passdb API
28 ****************************************************************/
30 typedef struct pdb_context
32 struct pdb_methods *pdb_methods;
33 struct pdb_methods *pwent_methods;
35 /* These functions are wrappers for the functions listed above.
36 They may do extra things like re-reading a SAM_ACCOUNT on update */
38 BOOL (*pdb_setsampwent)(struct pdb_context *, BOOL update);
40 void (*pdb_endsampwent)(struct pdb_context *);
42 BOOL (*pdb_getsampwent)(struct pdb_context *, SAM_ACCOUNT *user);
44 BOOL (*pdb_getsampwnam)(struct pdb_context *, SAM_ACCOUNT *sam_acct, const char *username);
46 BOOL (*pdb_getsampwrid)(struct pdb_context *, SAM_ACCOUNT *sam_acct, uint32 rid);
48 BOOL (*pdb_add_sam_account)(struct pdb_context *, SAM_ACCOUNT *sampass);
50 BOOL (*pdb_update_sam_account)(struct pdb_context *, SAM_ACCOUNT *sampass);
52 BOOL (*pdb_delete_sam_account)(struct pdb_context *, SAM_ACCOUNT *username);
54 void (*free_fn)(struct pdb_context **);
60 typedef struct pdb_methods
62 const char *name; /* What name got this module */
63 struct pdb_context *parent;
65 /* Use macros from dlinklist.h on these two */
66 struct pdb_methods *next;
67 struct pdb_methods *prev;
69 BOOL (*setsampwent)(struct pdb_methods *, BOOL update);
71 void (*endsampwent)(struct pdb_methods *);
73 BOOL (*getsampwent)(struct pdb_methods *, SAM_ACCOUNT *user);
75 BOOL (*getsampwnam)(struct pdb_methods *, SAM_ACCOUNT *sam_acct, const char *username);
77 BOOL (*getsampwrid)(struct pdb_methods *, SAM_ACCOUNT *sam_acct, uint32 rid);
79 BOOL (*add_sam_account)(struct pdb_methods *, const SAM_ACCOUNT *sampass);
81 BOOL (*update_sam_account)(struct pdb_methods *, const SAM_ACCOUNT *sampass);
83 BOOL (*delete_sam_account)(struct pdb_methods *, const SAM_ACCOUNT *username);
85 void *private_data; /* Private data of some kind */
87 void (*free_private_data)(void **);
91 typedef NTSTATUS (*pdb_init_function)(struct pdb_context *,
92 struct pdb_methods **,
95 struct pdb_init_function_entry {
97 /* Function to create a member of the authmethods list */
98 NTSTATUS (*init)(struct pdb_context *pdb_context,
99 struct pdb_methods **pdb_method,
100 const char *location);
103 #endif /* _PASSDB_H */