This is the 'multiple pdb backends' patch from ctrlsoft, aka Jelmer Vernooij
[kai/samba.git] / source3 / include / passdb.h
index f17b043fb27490666dcd63cde1d05b96cac43419..9e147189941791f7d650bcffb07a420fa127e6c3 100644 (file)
@@ -29,7 +29,8 @@
 
 typedef struct pdb_context 
 {
-       struct pdb_methods *pdb_selected;
+    struct pdb_methods *pdb_methods;
+       struct pdb_methods *pwent_methods;
        
        /* These functions are wrappers for the functions listed above.
           They may do extra things like re-reading a SAM_ACCOUNT on update */
@@ -59,22 +60,27 @@ typedef struct pdb_context
 typedef struct pdb_methods 
 {
        const char *name; /* What name got this module */
+    struct pdb_context *parent;
 
-       BOOL (*setsampwent)(struct pdb_context *, BOOL update);
+       /* Use macros from dlinklist.h on these two */
+       struct pdb_methods *next;
+       struct pdb_methods *prev;
+
+       BOOL (*setsampwent)(struct pdb_methods *, BOOL update);
        
-       void (*endsampwent)(struct pdb_context *);
+       void (*endsampwent)(struct pdb_methods *);
        
-       BOOL (*getsampwent)(struct pdb_context *, SAM_ACCOUNT *user);
+       BOOL (*getsampwent)(struct pdb_methods *, SAM_ACCOUNT *user);
        
-       BOOL (*getsampwnam)(struct pdb_context *, SAM_ACCOUNT *sam_acct, const char *username);
+       BOOL (*getsampwnam)(struct pdb_methods *, SAM_ACCOUNT *sam_acct, const char *username);
        
-       BOOL (*getsampwrid)(struct pdb_context *, SAM_ACCOUNT *sam_acct, uint32 rid);
+       BOOL (*getsampwrid)(struct pdb_methods *, SAM_ACCOUNT *sam_acct, uint32 rid);
        
-       BOOL (*add_sam_account)(struct pdb_context *, const SAM_ACCOUNT *sampass);
+       BOOL (*add_sam_account)(struct pdb_methods *, const SAM_ACCOUNT *sampass);
        
-       BOOL (*update_sam_account)(struct pdb_context *, const SAM_ACCOUNT *sampass);
+       BOOL (*update_sam_account)(struct pdb_methods *, const SAM_ACCOUNT *sampass);
        
-       BOOL (*delete_sam_account)(struct pdb_context *, const SAM_ACCOUNT *username);
+       BOOL (*delete_sam_account)(struct pdb_methods *, const SAM_ACCOUNT *username);
        
        void *private_data;  /* Private data of some kind */