From f8c12f4f4df375bb3fc07247c7f85c15a0557737 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Mon, 9 Apr 2001 22:11:37 +0000 Subject: looking towards abstracting the passdb and uidmapping interfaces. This is more of a note to myself. In not used anywhere yet. (This used to be commit 442605c6bc81dd115f4df5cc20df3f61601c6013) --- source3/include/passdb.h | 66 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 source3/include/passdb.h (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h new file mode 100644 index 0000000000..eb9016aa08 --- /dev/null +++ b/source3/include/passdb.h @@ -0,0 +1,66 @@ +/* + Unix SMB/Netbios implementation. + Version 1.9. + passdb structures and parameters + Copyright (C) Gerald Carter 2001 + Copyright (C) Luke Kenneth Casson Leighton 1998 - 2000 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef _PASSDB_H +#define _PASSDB_H + +/* + * This next constant specifies the version number of the VFS interface + * this smbd will load. Increment this if *ANY* changes are made to the + * vfs_ops below. JRA. + */ + +#define SMB_PASSDB_INTERFACE_VERSION 1 + +/* passdb operations structure */ +struct passdb_ops { + + /* Iteration Functions*/ + BOOL (*setsampwent) (BOOL update); + void (*endsampwent) (void); + SAM_ACCOUNT* (*getsampwent) (void); + + /* Lookup Functions */ + SAM_ACCOUNT* (*getsampwuid) (uid_t uid); + SAM_ACCOUNT* (*getsampwrid) (uint32 rid); + SAM_ACOCUNT* (*getsampwnam) (char* username); + + /* Modify the SAM database */ + BOOL (*update_sam_account) (SAM_ACCOUNT* sampass, BOOL override); + BOOL (*delete_sam_account) (char* username); + BOOL (*add_sam_account) (SAM_ACCOUNT* sampass); +}; + +/* uid mapping structure */ +struct uidmap_ops { + + /* From NT to UNIX */ + uid_t (*user_rid_to_uid) (uint32 rid); + gid_t (*group_rid_to_gid) (uint32 rid); + + /* From UNIX to NT */ + uint32 (*uid_to_user_rid) (uid_t uid); + uint32 (*gid_to_group_rid) (gid_t gid); +}; + + +#endif /* _PASSDB_H */ -- cgit From c032fb5121608dcaaec47244893e6888b21715fe Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 12 Apr 2001 22:14:20 +0000 Subject: still working on it (This used to be commit ff7c5be88a05c0f1858fedb966ccfc038299bbc9) --- source3/include/passdb.h | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index eb9016aa08..89cb35bd14 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -26,10 +26,11 @@ /* * This next constant specifies the version number of the VFS interface * this smbd will load. Increment this if *ANY* changes are made to the - * vfs_ops below. JRA. + * passdb_ops below. */ -#define SMB_PASSDB_INTERFACE_VERSION 1 +#define SMB_PASSDB_MAJOR_VERSION 1 +#define SMB_PASSDB_MINOR_VERSION 0 /* passdb operations structure */ struct passdb_ops { @@ -50,16 +51,22 @@ struct passdb_ops { BOOL (*add_sam_account) (SAM_ACCOUNT* sampass); }; + + +#define SMB_UIDMAP_MAJOR_VERSION 1 +#define SMB_UIDMAP_MINOR_VERSION 0 + +typedef enum sid_type {SID_USER_TYPE, SID_GROUP_TYPE} SMB_SID_T + /* uid mapping structure */ struct uidmap_ops { /* From NT to UNIX */ - uid_t (*user_rid_to_uid) (uint32 rid); - gid_t (*group_rid_to_gid) (uint32 rid); + int (*sid_to_id) (DOM_SID* sid, SMB_SID_T type); /* From UNIX to NT */ - uint32 (*uid_to_user_rid) (uid_t uid); - uint32 (*gid_to_group_rid) (gid_t gid); + DOM_SID* (*id_to_sid) (int id); + }; -- cgit From d85924a028f35e4789c70c068f903d677caf7ca0 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 12 Apr 2001 22:15:57 +0000 Subject: forgot one thing (This used to be commit a17f2471571596e97b212ff9de1c8b45dac12eb6) --- source3/include/passdb.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 89cb35bd14..302e69105f 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -49,6 +49,10 @@ struct passdb_ops { BOOL (*update_sam_account) (SAM_ACCOUNT* sampass, BOOL override); BOOL (*delete_sam_account) (char* username); BOOL (*add_sam_account) (SAM_ACCOUNT* sampass); + + /* authenticate a user */ + SAM_ACCOUNT* (*logon_user) (char* username, char* domain, char* lm_pw, + int lm_pw_len, char* nt_pw, int nt_pw_len, char* clear_pass); }; -- cgit From e40449fa720d0934abd06cd0b0b05d0ca0f4e257 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Sat, 28 Apr 2001 00:32:56 +0000 Subject: rpcclient merge from 2.2 (including Jeremy's non-void return fix) (This used to be commit 0a6ceed279cc8111008b21f75c6791efbd993f4b) --- source3/include/passdb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 302e69105f..8836bad3e2 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -69,7 +69,7 @@ struct uidmap_ops { int (*sid_to_id) (DOM_SID* sid, SMB_SID_T type); /* From UNIX to NT */ - DOM_SID* (*id_to_sid) (int id); + DOM_SID* (*id_to_sid) (int id, SMB_SID_T type); }; -- cgit From bb70b7811f91290f8c23e745681951a543c15ed4 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 2 Jan 2002 23:11:24 +0000 Subject: removed stuff I wasn't using (This used to be commit 27ffce157a655e267f225126f586847e5a0b8614) --- source3/include/passdb.h | 49 ------------------------------------------------ 1 file changed, 49 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 8836bad3e2..4e50ff7da5 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -23,55 +23,6 @@ #ifndef _PASSDB_H #define _PASSDB_H -/* - * This next constant specifies the version number of the VFS interface - * this smbd will load. Increment this if *ANY* changes are made to the - * passdb_ops below. - */ - -#define SMB_PASSDB_MAJOR_VERSION 1 -#define SMB_PASSDB_MINOR_VERSION 0 - -/* passdb operations structure */ -struct passdb_ops { - - /* Iteration Functions*/ - BOOL (*setsampwent) (BOOL update); - void (*endsampwent) (void); - SAM_ACCOUNT* (*getsampwent) (void); - - /* Lookup Functions */ - SAM_ACCOUNT* (*getsampwuid) (uid_t uid); - SAM_ACCOUNT* (*getsampwrid) (uint32 rid); - SAM_ACOCUNT* (*getsampwnam) (char* username); - - /* Modify the SAM database */ - BOOL (*update_sam_account) (SAM_ACCOUNT* sampass, BOOL override); - BOOL (*delete_sam_account) (char* username); - BOOL (*add_sam_account) (SAM_ACCOUNT* sampass); - - /* authenticate a user */ - SAM_ACCOUNT* (*logon_user) (char* username, char* domain, char* lm_pw, - int lm_pw_len, char* nt_pw, int nt_pw_len, char* clear_pass); -}; - - - -#define SMB_UIDMAP_MAJOR_VERSION 1 -#define SMB_UIDMAP_MINOR_VERSION 0 - -typedef enum sid_type {SID_USER_TYPE, SID_GROUP_TYPE} SMB_SID_T - -/* uid mapping structure */ -struct uidmap_ops { - - /* From NT to UNIX */ - int (*sid_to_id) (DOM_SID* sid, SMB_SID_T type); - - /* From UNIX to NT */ - DOM_SID* (*id_to_sid) (int id, SMB_SID_T type); - -}; #endif /* _PASSDB_H */ -- cgit From 1a74d8d1f0758d15c5c35d20e33d9868565812cf Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sun, 20 Jan 2002 14:30:58 +0000 Subject: This is another *BIG* change... Samba now features a pluggable passdb interface, along the same lines as the one in use in the auth subsystem. In this case, only one backend may be active at a time by the 'normal' interface, and only one backend per passdb_context is permitted outside that. This pluggable interface is designed to allow any number of passdb backends to be compiled in, with the selection at runtime. The 'passdb backend' paramater has been created (and documented!) to support this. As such, configure has been modfied to allow (for example) --with-ldap and the old smbpasswd to be selected at the same time. This patch also introduces two new backends: smbpasswd_nua and tdbsam_nua. These two backends accept 'non unix accounts', where the user does *not* exist in /etc/passwd. These accounts' don't have UIDs in the unix sense, but to avoid conflicts in the algroitmic mapping of RIDs, they use the values specified in the 'non unix account range' paramter - in the same way as the winbind ranges are specifed. While I was at it, I cleaned up some of the code in pdb_tdb (code copied directly from smbpasswd and not really considered properly). Most of this was to do with % macro expansion on stored data. It isn't easy to get the macros into the tdb, and the first password change will 'expand' them. tdbsam needs to use a similar system to pdb_ldap in this regard. This patch only makes minor adjustments to pdb_nisplus and pdb_ldap, becouse I don't have the test facilities for these. I plan to incoroprate at least pdb_ldap into this scheme after consultation with Jerry. Each (converted) passdb module now no longer has any 'static' variables, and only exports 1 init function outside its .c file. The non-unix-account support in this patch has been proven! It is now possible to join a win2k machine to a Samba PDC without an account in /etc/passwd! Other changes: Minor interface adjustments: pdb_delete_sam_account() now takes a SAM_ACCOUNT, not a char*. pdb_update_sam_account() no longer takes the 'override' argument that was being ignored so often (every other passdb backend). Extra checks have been added in some places. Minor code changes: smbpasswd no longer attempts to initialise the passdb at startup, this is now done on first use. pdbedit has lost some of its 'machine account' logic, as this behaviour is now controlled by the passdb subsystem directly. The samr subsystem no longer calls 'local password change', but does the pdb interactions directly. This allow the ACB_ flags specifed to be transferred direct to the backend, without interference. Doco: I've updated the doco to reflect some of the changes, and removed some paramters no longer applicable to HEAD. (This used to be commit ff354c99c585068af6dc1ff35a1f109a806b326b) --- source3/include/passdb.h | 67 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 4e50ff7da5..178b3a4359 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -24,5 +24,72 @@ #define _PASSDB_H +/***************************************************************** + Functions to be implemented by the new (v2) passdb API +****************************************************************/ + +typedef struct pdb_context +{ + struct pdb_methods *pdb_selected; + + /* These functions are wrappers for the functions listed above. + They may do extra things like re-reading a SAM_ACCOUNT on update */ + + BOOL (*pdb_setsampwent)(struct pdb_context *, BOOL update); + + void (*pdb_endsampwent)(struct pdb_context *); + + BOOL (*pdb_getsampwent)(struct pdb_context *, SAM_ACCOUNT *user); + + BOOL (*pdb_getsampwnam)(struct pdb_context *, SAM_ACCOUNT *sam_acct, const char *username); + + BOOL (*pdb_getsampwrid)(struct pdb_context *, SAM_ACCOUNT *sam_acct, uint32 rid); + + BOOL (*pdb_add_sam_account)(struct pdb_context *, SAM_ACCOUNT *sampass); + + BOOL (*pdb_update_sam_account)(struct pdb_context *, SAM_ACCOUNT *sampass); + + BOOL (*pdb_delete_sam_account)(struct pdb_context *, SAM_ACCOUNT *username); + + void (*free_fn)(struct pdb_context **); + + TALLOC_CTX *mem_ctx; + +} PDB_CONTEXT; + +typedef struct pdb_methods +{ + char *name; /* What name got this module */ + + BOOL (*setsampwent)(struct pdb_context *, BOOL update); + + void (*endsampwent)(struct pdb_context *); + + BOOL (*getsampwent)(struct pdb_context *, SAM_ACCOUNT *user); + + BOOL (*getsampwnam)(struct pdb_context *, SAM_ACCOUNT *sam_acct, const char *username); + + BOOL (*getsampwrid)(struct pdb_context *, SAM_ACCOUNT *sam_acct, uint32 rid); + + BOOL (*add_sam_account)(struct pdb_context *, const SAM_ACCOUNT *sampass); + + BOOL (*update_sam_account)(struct pdb_context *, const SAM_ACCOUNT *sampass); + + BOOL (*delete_sam_account)(struct pdb_context *, const SAM_ACCOUNT *username); + + void *private_data; /* Private data of some kind */ + + void (*free_private_data)(void **); + +} PDB_METHODS; + + +struct pdb_init_function { + char *name; + /* Function to create a member of the authmethods list */ + NTSTATUS (*init)(struct pdb_context *pdb_context, + struct pdb_methods **pdb_method, + const char *location); +}; #endif /* _PASSDB_H */ -- cgit From 7547398c97f1e5f67287a8e319eed146de2ecf05 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 26 Jan 2002 06:28:50 +0000 Subject: This always points at a string literal, so it probably should be 'const'. (This used to be commit e72e511935ce7f2b658a133bd536833864bc6a92) --- source3/include/passdb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 178b3a4359..071ebdbfe5 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -59,7 +59,7 @@ typedef struct pdb_context typedef struct pdb_methods { - char *name; /* What name got this module */ + const char *name; /* What name got this module */ BOOL (*setsampwent)(struct pdb_context *, BOOL update); -- cgit From cd68afe31256ad60748b34f7318a180cfc2127cc Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Wed, 30 Jan 2002 06:08:46 +0000 Subject: Removed version number from file header. Changed "SMB/Netbios" to "SMB/CIFS" in file header. (This used to be commit 6a58c9bd06d0d7502a24bf5ce5a2faf0a146edfa) --- source3/include/passdb.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 071ebdbfe5..dfcbd46ecf 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -1,6 +1,5 @@ /* - Unix SMB/Netbios implementation. - Version 1.9. + Unix SMB/CIFS implementation. passdb structures and parameters Copyright (C) Gerald Carter 2001 Copyright (C) Luke Kenneth Casson Leighton 1998 - 2000 -- cgit From 527aaf6def6b53c0e01fc5d8369b06be4237fca0 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 22 Feb 2002 02:47:53 +0000 Subject: Add the pdb_plugin module from Jelmer Vernooij . This allow the user to select 'passdb backend = plugin : /path/to/plugin.so : pluging args' And load any arbitary plugin. Apparently Jelmer has a mysql plugin in the works - hence this patch. We probably need to rework the interface a bit before 3.0 (add versioning of some kind) but this is a good start. Andrew Bartlett (This used to be commit d6d18b70f0c377344b0b3d9df5a11d209793bfe0) --- source3/include/passdb.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index dfcbd46ecf..f17b043fb2 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -82,8 +82,11 @@ typedef struct pdb_methods } PDB_METHODS; +typedef NTSTATUS (*pdb_init_function)(struct pdb_context *, + struct pdb_methods **, + const char *); -struct pdb_init_function { +struct pdb_init_function_entry { char *name; /* Function to create a member of the authmethods list */ NTSTATUS (*init)(struct pdb_context *pdb_context, -- cgit From cdc9931bb2f53272159b04ef7b1b057ce837ed4b Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 19 Mar 2002 00:06:24 +0000 Subject: ops forgot this :-) (This used to be commit fdb88eb06af09171af2027a90ef6f3ac872beaee) --- source3/include/passdb.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index f17b043fb2..df44dce80c 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -50,6 +50,10 @@ typedef struct pdb_context BOOL (*pdb_delete_sam_account)(struct pdb_context *, SAM_ACCOUNT *username); + uid_t (*pdb_user_rid_to_uid)(struct pdb_context *, uint32 user_rid); + + uint32 (*pdb_uid_to_user_rid)(struct pdb_context *, uid_t uid); + void (*free_fn)(struct pdb_context **); TALLOC_CTX *mem_ctx; @@ -75,6 +79,10 @@ typedef struct pdb_methods BOOL (*update_sam_account)(struct pdb_context *, const SAM_ACCOUNT *sampass); BOOL (*delete_sam_account)(struct pdb_context *, const SAM_ACCOUNT *username); + + uid_t (*user_rid_to_uid)(struct pdb_context *, uint32 user_rid); + + uint32 (*uid_to_user_rid)(struct pdb_context *, uid_t uid); void *private_data; /* Private data of some kind */ -- cgit From 050b80356edea52f1bbb0a27599186ad84c18b73 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 19 Mar 2002 13:57:53 +0000 Subject: second step to gain free uid<->rid mapping we still need to free gid<->rid mapping and few other stuff (This used to be commit aa4b6f8181f34196a28951264dd8b631a5deef7f) --- source3/include/passdb.h | 8 -------- 1 file changed, 8 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index df44dce80c..f17b043fb2 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -50,10 +50,6 @@ typedef struct pdb_context BOOL (*pdb_delete_sam_account)(struct pdb_context *, SAM_ACCOUNT *username); - uid_t (*pdb_user_rid_to_uid)(struct pdb_context *, uint32 user_rid); - - uint32 (*pdb_uid_to_user_rid)(struct pdb_context *, uid_t uid); - void (*free_fn)(struct pdb_context **); TALLOC_CTX *mem_ctx; @@ -79,10 +75,6 @@ typedef struct pdb_methods BOOL (*update_sam_account)(struct pdb_context *, const SAM_ACCOUNT *sampass); BOOL (*delete_sam_account)(struct pdb_context *, const SAM_ACCOUNT *username); - - uid_t (*user_rid_to_uid)(struct pdb_context *, uint32 user_rid); - - uint32 (*uid_to_user_rid)(struct pdb_context *, uid_t uid); void *private_data; /* Private data of some kind */ -- cgit From e90b65284812aaa5ff9e9935ce9bbad7791cbbcd Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 15 Jul 2002 10:35:28 +0000 Subject: updated the 3.0 branch from the head branch - ready for alpha18 (This used to be commit 03ac082dcb375b6f3ca3d810a6a6367542bc23ce) --- source3/include/passdb.h | 46 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 14 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index f17b043fb2..a79c8a0289 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -27,9 +27,24 @@ Functions to be implemented by the new (v2) passdb API ****************************************************************/ +/* + * This next constant specifies the version number of the PASSDB interface + * this SAMBA will load. Increment this if *ANY* changes are made to the interface. + */ + +#define PASSDB_INTERFACE_VERSION 2 + +/* use this inside a passdb module */ +#define PDB_MODULE_VERSIONING_MAGIC \ +int pdb_version(void)\ +{\ + return PASSDB_INTERFACE_VERSION;\ +} + 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 */ @@ -42,7 +57,7 @@ typedef struct pdb_context BOOL (*pdb_getsampwnam)(struct pdb_context *, SAM_ACCOUNT *sam_acct, const char *username); - BOOL (*pdb_getsampwrid)(struct pdb_context *, SAM_ACCOUNT *sam_acct, uint32 rid); + BOOL (*pdb_getsampwsid)(struct pdb_context *, SAM_ACCOUNT *sam_acct, DOM_SID *sid); BOOL (*pdb_add_sam_account)(struct pdb_context *, SAM_ACCOUNT *sampass); @@ -59,22 +74,27 @@ typedef struct pdb_context typedef struct pdb_methods { const char *name; /* What name got this module */ + struct pdb_context *parent; + + /* Use macros from dlinklist.h on these two */ + struct pdb_methods *next; + struct pdb_methods *prev; - BOOL (*setsampwent)(struct pdb_context *, BOOL update); + 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 (*getsampwsid)(struct pdb_methods *, SAM_ACCOUNT *sam_acct, DOM_SID *Sid); - BOOL (*add_sam_account)(struct pdb_context *, const SAM_ACCOUNT *sampass); + BOOL (*add_sam_account)(struct pdb_methods *, SAM_ACCOUNT *sampass); - BOOL (*update_sam_account)(struct pdb_context *, const SAM_ACCOUNT *sampass); + BOOL (*update_sam_account)(struct pdb_methods *, SAM_ACCOUNT *sampass); - BOOL (*delete_sam_account)(struct pdb_context *, const SAM_ACCOUNT *username); + BOOL (*delete_sam_account)(struct pdb_methods *, SAM_ACCOUNT *username); void *private_data; /* Private data of some kind */ @@ -88,10 +108,8 @@ typedef NTSTATUS (*pdb_init_function)(struct pdb_context *, struct pdb_init_function_entry { char *name; - /* Function to create a member of the authmethods list */ - NTSTATUS (*init)(struct pdb_context *pdb_context, - struct pdb_methods **pdb_method, - const char *location); + /* Function to create a member of the pdb_methods list */ + pdb_init_function init; }; #endif /* _PASSDB_H */ -- cgit From b2edf254eda92f775e7d3d9b6793b4d77f9000b6 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 17 Aug 2002 17:00:51 +0000 Subject: sync 3.0 branch with head (This used to be commit 3928578b52cfc949be5e0ef444fce1558d75f290) --- source3/include/passdb.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index a79c8a0289..7a791ddac4 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -57,7 +57,7 @@ typedef struct pdb_context BOOL (*pdb_getsampwnam)(struct pdb_context *, SAM_ACCOUNT *sam_acct, const char *username); - BOOL (*pdb_getsampwsid)(struct pdb_context *, SAM_ACCOUNT *sam_acct, DOM_SID *sid); + BOOL (*pdb_getsampwsid)(struct pdb_context *, SAM_ACCOUNT *sam_acct, const DOM_SID *sid); BOOL (*pdb_add_sam_account)(struct pdb_context *, SAM_ACCOUNT *sampass); @@ -88,7 +88,7 @@ typedef struct pdb_methods BOOL (*getsampwnam)(struct pdb_methods *, SAM_ACCOUNT *sam_acct, const char *username); - BOOL (*getsampwsid)(struct pdb_methods *, SAM_ACCOUNT *sam_acct, DOM_SID *Sid); + BOOL (*getsampwsid)(struct pdb_methods *, SAM_ACCOUNT *sam_acct, const DOM_SID *Sid); BOOL (*add_sam_account)(struct pdb_methods *, SAM_ACCOUNT *sampass); -- cgit From d9729d81a993234db850fa733fd4591e1a5ae56e Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 26 Sep 2002 18:37:55 +0000 Subject: syncing up with HEAD again.... (This used to be commit e026b84815ad1a5fa981c24fff197fefa73b4928) --- source3/include/passdb.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 7a791ddac4..0c694987fe 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -49,21 +49,21 @@ typedef struct pdb_context /* These functions are wrappers for the functions listed above. They may do extra things like re-reading a SAM_ACCOUNT on update */ - BOOL (*pdb_setsampwent)(struct pdb_context *, BOOL update); + NTSTATUS (*pdb_setsampwent)(struct pdb_context *, BOOL update); void (*pdb_endsampwent)(struct pdb_context *); - BOOL (*pdb_getsampwent)(struct pdb_context *, SAM_ACCOUNT *user); + NTSTATUS (*pdb_getsampwent)(struct pdb_context *, SAM_ACCOUNT *user); - BOOL (*pdb_getsampwnam)(struct pdb_context *, SAM_ACCOUNT *sam_acct, const char *username); + NTSTATUS (*pdb_getsampwnam)(struct pdb_context *, SAM_ACCOUNT *sam_acct, const char *username); - BOOL (*pdb_getsampwsid)(struct pdb_context *, SAM_ACCOUNT *sam_acct, const DOM_SID *sid); + NTSTATUS (*pdb_getsampwsid)(struct pdb_context *, SAM_ACCOUNT *sam_acct, const DOM_SID *sid); - BOOL (*pdb_add_sam_account)(struct pdb_context *, SAM_ACCOUNT *sampass); + NTSTATUS (*pdb_add_sam_account)(struct pdb_context *, SAM_ACCOUNT *sampass); - BOOL (*pdb_update_sam_account)(struct pdb_context *, SAM_ACCOUNT *sampass); + NTSTATUS (*pdb_update_sam_account)(struct pdb_context *, SAM_ACCOUNT *sampass); - BOOL (*pdb_delete_sam_account)(struct pdb_context *, SAM_ACCOUNT *username); + NTSTATUS (*pdb_delete_sam_account)(struct pdb_context *, SAM_ACCOUNT *username); void (*free_fn)(struct pdb_context **); @@ -80,21 +80,21 @@ typedef struct pdb_methods struct pdb_methods *next; struct pdb_methods *prev; - BOOL (*setsampwent)(struct pdb_methods *, BOOL update); + NTSTATUS (*setsampwent)(struct pdb_methods *, BOOL update); void (*endsampwent)(struct pdb_methods *); - BOOL (*getsampwent)(struct pdb_methods *, SAM_ACCOUNT *user); + NTSTATUS (*getsampwent)(struct pdb_methods *, SAM_ACCOUNT *user); - BOOL (*getsampwnam)(struct pdb_methods *, SAM_ACCOUNT *sam_acct, const char *username); + NTSTATUS (*getsampwnam)(struct pdb_methods *, SAM_ACCOUNT *sam_acct, const char *username); - BOOL (*getsampwsid)(struct pdb_methods *, SAM_ACCOUNT *sam_acct, const DOM_SID *Sid); + NTSTATUS (*getsampwsid)(struct pdb_methods *, SAM_ACCOUNT *sam_acct, const DOM_SID *Sid); - BOOL (*add_sam_account)(struct pdb_methods *, SAM_ACCOUNT *sampass); + NTSTATUS (*add_sam_account)(struct pdb_methods *, SAM_ACCOUNT *sampass); - BOOL (*update_sam_account)(struct pdb_methods *, SAM_ACCOUNT *sampass); + NTSTATUS (*update_sam_account)(struct pdb_methods *, SAM_ACCOUNT *sampass); - BOOL (*delete_sam_account)(struct pdb_methods *, SAM_ACCOUNT *username); + NTSTATUS (*delete_sam_account)(struct pdb_methods *, SAM_ACCOUNT *username); void *private_data; /* Private data of some kind */ -- cgit From 6d7195d1d79c43f5ccc8dc4a9215c02177d5fa89 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 2 Nov 2002 03:47:48 +0000 Subject: Merge passdb from HEAD -> 3.0 The work here includes: - metze' set/changed patch, which avoids making changes to ldap on unmodified attributes. - volker's group mapping in passdb patch - volker's samsync stuff - volkers SAMR changes. - mezte's connection caching patch - my recent changes (fix magic root check, ldap ssl) Andrew Bartlett (This used to be commit 2044d60bbe0043cdbb9aba931115672bde975d2f) --- source3/include/passdb.h | 48 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 0c694987fe..f63fd52e84 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -32,7 +32,7 @@ * this SAMBA will load. Increment this if *ANY* changes are made to the interface. */ -#define PASSDB_INTERFACE_VERSION 2 +#define PASSDB_INTERFACE_VERSION 4 /* use this inside a passdb module */ #define PDB_MODULE_VERSIONING_MAGIC \ @@ -64,7 +64,30 @@ typedef struct pdb_context NTSTATUS (*pdb_update_sam_account)(struct pdb_context *, SAM_ACCOUNT *sampass); NTSTATUS (*pdb_delete_sam_account)(struct pdb_context *, SAM_ACCOUNT *username); + + NTSTATUS (*pdb_getgrsid)(struct pdb_context *context, GROUP_MAP *map, + DOM_SID sid, BOOL with_priv); + + NTSTATUS (*pdb_getgrgid)(struct pdb_context *context, GROUP_MAP *map, + gid_t gid, BOOL with_priv); + + NTSTATUS (*pdb_getgrnam)(struct pdb_context *context, GROUP_MAP *map, + char *name, BOOL with_priv); + + NTSTATUS (*pdb_add_group_mapping_entry)(struct pdb_context *context, + GROUP_MAP *map); + NTSTATUS (*pdb_update_group_mapping_entry)(struct pdb_context *context, + GROUP_MAP *map); + + NTSTATUS (*pdb_delete_group_mapping_entry)(struct pdb_context *context, + DOM_SID sid); + + NTSTATUS (*pdb_enum_group_mapping)(struct pdb_context *context, + enum SID_NAME_USE sid_name_use, + GROUP_MAP **rmap, int *num_entries, + BOOL unix_only, BOOL with_priv); + void (*free_fn)(struct pdb_context **); TALLOC_CTX *mem_ctx; @@ -96,6 +119,29 @@ typedef struct pdb_methods NTSTATUS (*delete_sam_account)(struct pdb_methods *, SAM_ACCOUNT *username); + NTSTATUS (*getgrsid)(struct pdb_methods *methods, GROUP_MAP *map, + DOM_SID sid, BOOL with_priv); + + NTSTATUS (*getgrgid)(struct pdb_methods *methods, GROUP_MAP *map, + gid_t gid, BOOL with_priv); + + NTSTATUS (*getgrnam)(struct pdb_methods *methods, GROUP_MAP *map, + char *name, BOOL with_priv); + + NTSTATUS (*add_group_mapping_entry)(struct pdb_methods *methods, + GROUP_MAP *map); + + NTSTATUS (*update_group_mapping_entry)(struct pdb_methods *methods, + GROUP_MAP *map); + + NTSTATUS (*delete_group_mapping_entry)(struct pdb_methods *methods, + DOM_SID sid); + + NTSTATUS (*enum_group_mapping)(struct pdb_methods *methods, + enum SID_NAME_USE sid_name_use, + GROUP_MAP **rmap, int *num_entries, + BOOL unix_only, BOOL with_priv); + void *private_data; /* Private data of some kind */ void (*free_private_data)(void **); -- cgit From 634c54310c92c48dd4eceec602e230a021bdcfc5 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 3 Jan 2003 08:28:12 +0000 Subject: Merge from HEAD - make Samba compile with -Wwrite-strings without additional warnings. (Adds a lot of const). Andrew Bartlett (This used to be commit 3a7458f9472432ef12c43008414925fd1ce8ea0c) --- source3/include/passdb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index f63fd52e84..fa80b263ff 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -153,7 +153,7 @@ typedef NTSTATUS (*pdb_init_function)(struct pdb_context *, const char *); struct pdb_init_function_entry { - char *name; + const char *name; /* Function to create a member of the pdb_methods list */ pdb_init_function init; }; -- cgit From 9c3cecbdac2ea888f95db2194bf9f5d2457aef09 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 15 Apr 2003 16:01:14 +0000 Subject: Use the new modules system for passdb (merge from HEAD) (This used to be commit 1755d5f66221a910863cfc8a197f8d792e6b6e3d) --- source3/include/passdb.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index fa80b263ff..06409aa34e 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -34,13 +34,6 @@ #define PASSDB_INTERFACE_VERSION 4 -/* use this inside a passdb module */ -#define PDB_MODULE_VERSIONING_MAGIC \ -int pdb_version(void)\ -{\ - return PASSDB_INTERFACE_VERSION;\ -} - typedef struct pdb_context { struct pdb_methods *pdb_methods; @@ -156,6 +149,7 @@ struct pdb_init_function_entry { const char *name; /* Function to create a member of the pdb_methods list */ pdb_init_function init; + struct pdb_init_function_entry *prev, *next; }; #endif /* _PASSDB_H */ -- cgit From c823b191ab476fc2583d6d6aaa1e2edb09cbb88e Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 12 May 2003 18:12:31 +0000 Subject: And finally IDMAP in 3_0 We really need idmap_ldap to have a good solution with ldapsam, porting it from the prvious code is beeing made, the code is really simple to do so I am confident it is not a problem to commit this code in. Not committing it would have been worst. I really would have been able to finish also the group code, maybe we can put it into a followin release after 3.0.0 even if it may be an upgrade problem. The code has been tested and seem to work right, more testing is needed for corner cases. Currently winbind pdc (working only for users and not for groups) is disabled as I was not able to make a complete group code replacement that works somewhat in a week (I have a complete patch, but there are bugs) Simo. (This used to be commit 0e58085978f984436815114a2ec347cf7899a89d) --- source3/include/passdb.h | 149 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 147 insertions(+), 2 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 06409aa34e..e14e250d34 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -3,6 +3,8 @@ passdb structures and parameters Copyright (C) Gerald Carter 2001 Copyright (C) Luke Kenneth Casson Leighton 1998 - 2000 + Copyright (C) Andrew Bartlett 2002 + Copyright (C) Simo Sorce 2003 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,6 +25,149 @@ #define _PASSDB_H +/* + * bit flags representing initialized fields in SAM_ACCOUNT + */ +enum pdb_elements { + PDB_UNINIT, + PDB_SMBHOME, + PDB_PROFILE, + PDB_DRIVE, + PDB_LOGONSCRIPT, + PDB_LOGONTIME, + PDB_LOGOFFTIME, + PDB_KICKOFFTIME, + PDB_CANCHANGETIME, + PDB_MUSTCHANGETIME, + PDB_PLAINTEXT_PW, + PDB_USERNAME, + PDB_FULLNAME, + PDB_DOMAIN, + PDB_NTUSERNAME, + PDB_HOURSLEN, + PDB_LOGONDIVS, + PDB_USERSID, + PDB_GROUPSID, + PDB_ACCTCTRL, + PDB_PASSLASTSET, + PDB_UNIXHOMEDIR, + PDB_ACCTDESC, + PDB_WORKSTATIONS, + PDB_UNKNOWNSTR, + PDB_MUNGEDDIAL, + PDB_HOURS, + PDB_UNKNOWN3, + PDB_UNKNOWN5, + PDB_UNKNOWN6, + PDB_LMPASSWD, + PDB_NTPASSWD, + + /* this must be the last element */ + PDB_COUNT +}; + +enum pdb_group_elements { + PDB_GROUP_NAME, + PDB_GROUP_SID, + PDB_GROUP_SID_NAME_USE, + PDB_GROUP_MEMBERS, + + /* this must be the last element */ + PDB_GROUP_COUNT +}; + + +enum pdb_value_state { + PDB_DEFAULT=0, + PDB_SET, + PDB_CHANGED +}; + +#define IS_SAM_SET(x, flag) (pdb_get_init_flags(x, flag) == PDB_SET) +#define IS_SAM_CHANGED(x, flag) (pdb_get_init_flags(x, flag) == PDB_CHANGED) +#define IS_SAM_DEFAULT(x, flag) (pdb_get_init_flags(x, flag) == PDB_DEFAULT) + +typedef struct sam_passwd +{ + TALLOC_CTX *mem_ctx; + + void (*free_fn)(struct sam_passwd **); + + struct pdb_methods *methods; + + struct user_data { + /* initiailization flags */ + struct bitmap *change_flags; + struct bitmap *set_flags; + + time_t logon_time; /* logon time */ + time_t logoff_time; /* logoff time */ + time_t kickoff_time; /* kickoff time */ + time_t pass_last_set_time; /* password last set time */ + time_t pass_can_change_time; /* password can change time */ + time_t pass_must_change_time; /* password must change time */ + + const char * username; /* UNIX username string */ + const char * domain; /* Windows Domain name */ + const char * nt_username; /* Windows username string */ + const char * full_name; /* user's full name string */ + const char * unix_home_dir; /* UNIX home directory string */ + const char * home_dir; /* home directory string */ + const char * dir_drive; /* home directory drive string */ + const char * logon_script; /* logon script string */ + const char * profile_path; /* profile path string */ + const char * acct_desc ; /* user description string */ + const char * workstations; /* login from workstations string */ + const char * unknown_str ; /* don't know what this is, yet. */ + const char * munged_dial ; /* munged path name and dial-back tel number */ + + DOM_SID user_sid; /* Primary User SID */ + DOM_SID group_sid; /* Primary Group SID */ + + DATA_BLOB lm_pw; /* .data is Null if no password */ + DATA_BLOB nt_pw; /* .data is Null if no password */ + char* plaintext_pw; /* is Null if not available */ + + uint16 acct_ctrl; /* account info (ACB_xxxx bit-mask) */ + uint32 unknown_3; /* 0x00ff ffff */ + + uint16 logon_divs; /* 168 - number of hours in a week */ + uint32 hours_len; /* normally 21 bytes */ + uint8 hours[MAX_HOURS_LEN]; + + uint32 unknown_5; /* 0x0002 0000 */ + uint32 unknown_6; /* 0x0000 04ec */ + } private; + + /* Lets see if the remaining code can get the hint that you + are meant to use the pdb_...() functions. */ + +} SAM_ACCOUNT; + +typedef struct sam_group { + TALLOC_CTX *mem_ctx; + + void (*free_fn)(struct sam_group **); + + struct pdb_methods *methods; + + struct group_data { + /* initiailization flags */ + struct bitmap *change_flags; + struct bitmap *set_flags; + + const char *name; /* Windows group name string */ + + DOM_SID sid; /* Group SID */ + enum SID_NAME_USE sid_name_use; /* Group type */ + + uint32 mem_num; /* Number of member SIDs */ + DOM_SID *members; /* SID array */ + } private; + +} SAM_GROUP; + + /***************************************************************** Functions to be implemented by the new (v2) passdb API ****************************************************************/ @@ -51,7 +196,7 @@ typedef struct pdb_context NTSTATUS (*pdb_getsampwnam)(struct pdb_context *, SAM_ACCOUNT *sam_acct, const char *username); NTSTATUS (*pdb_getsampwsid)(struct pdb_context *, SAM_ACCOUNT *sam_acct, const DOM_SID *sid); - + NTSTATUS (*pdb_add_sam_account)(struct pdb_context *, SAM_ACCOUNT *sampass); NTSTATUS (*pdb_update_sam_account)(struct pdb_context *, SAM_ACCOUNT *sampass); @@ -104,7 +249,7 @@ typedef struct pdb_methods NTSTATUS (*getsampwnam)(struct pdb_methods *, SAM_ACCOUNT *sam_acct, const char *username); - NTSTATUS (*getsampwsid)(struct pdb_methods *, SAM_ACCOUNT *sam_acct, const DOM_SID *Sid); + NTSTATUS (*getsampwsid)(struct pdb_methods *, SAM_ACCOUNT *sam_acct, const DOM_SID *sid); NTSTATUS (*add_sam_account)(struct pdb_methods *, SAM_ACCOUNT *sampass); -- cgit From 75a5c0b307a79536316b651273d3f6983323f5ce Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Wed, 18 Jun 2003 15:24:10 +0000 Subject: Ok, this patch removes the privilege stuff we had in, unused, for some time. The code was nice, but put in the wrong place (group mapping) and not supported by most of the code, thus useless. We will put back most of the code when our infrastructure will be changed so that privileges actually really make sense to be set. This is a first patch of a set to enhance all our mapping code cleaness and stability towards a sane next beta for 3.0 code base Simo. (This used to be commit e341e7c49f8c17a9ee30ca3fab3aa0397c1f0c7e) --- source3/include/passdb.h | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index e14e250d34..aeddcbcb3a 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -203,14 +203,11 @@ typedef struct pdb_context NTSTATUS (*pdb_delete_sam_account)(struct pdb_context *, SAM_ACCOUNT *username); - NTSTATUS (*pdb_getgrsid)(struct pdb_context *context, GROUP_MAP *map, - DOM_SID sid, BOOL with_priv); + NTSTATUS (*pdb_getgrsid)(struct pdb_context *context, GROUP_MAP *map, DOM_SID sid); - NTSTATUS (*pdb_getgrgid)(struct pdb_context *context, GROUP_MAP *map, - gid_t gid, BOOL with_priv); + NTSTATUS (*pdb_getgrgid)(struct pdb_context *context, GROUP_MAP *map, gid_t gid); - NTSTATUS (*pdb_getgrnam)(struct pdb_context *context, GROUP_MAP *map, - char *name, BOOL with_priv); + NTSTATUS (*pdb_getgrnam)(struct pdb_context *context, GROUP_MAP *map, const char *name); NTSTATUS (*pdb_add_group_mapping_entry)(struct pdb_context *context, GROUP_MAP *map); @@ -224,7 +221,7 @@ typedef struct pdb_context NTSTATUS (*pdb_enum_group_mapping)(struct pdb_context *context, enum SID_NAME_USE sid_name_use, GROUP_MAP **rmap, int *num_entries, - BOOL unix_only, BOOL with_priv); + BOOL unix_only); void (*free_fn)(struct pdb_context **); @@ -257,14 +254,11 @@ typedef struct pdb_methods NTSTATUS (*delete_sam_account)(struct pdb_methods *, SAM_ACCOUNT *username); - NTSTATUS (*getgrsid)(struct pdb_methods *methods, GROUP_MAP *map, - DOM_SID sid, BOOL with_priv); + NTSTATUS (*getgrsid)(struct pdb_methods *methods, GROUP_MAP *map, DOM_SID sid); - NTSTATUS (*getgrgid)(struct pdb_methods *methods, GROUP_MAP *map, - gid_t gid, BOOL with_priv); + NTSTATUS (*getgrgid)(struct pdb_methods *methods, GROUP_MAP *map, gid_t gid); - NTSTATUS (*getgrnam)(struct pdb_methods *methods, GROUP_MAP *map, - char *name, BOOL with_priv); + NTSTATUS (*getgrnam)(struct pdb_methods *methods, GROUP_MAP *map, const char *name); NTSTATUS (*add_group_mapping_entry)(struct pdb_methods *methods, GROUP_MAP *map); @@ -278,7 +272,7 @@ typedef struct pdb_methods NTSTATUS (*enum_group_mapping)(struct pdb_methods *methods, enum SID_NAME_USE sid_name_use, GROUP_MAP **rmap, int *num_entries, - BOOL unix_only, BOOL with_priv); + BOOL unix_only); void *private_data; /* Private data of some kind */ -- cgit From a3ddfa5069c9df07626135aa5fd2ec411c41943f Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 5 Jul 2003 09:46:12 +0000 Subject: Fixes to our LDAP/vampire codepaths: - Try better to add the appropriate mapping between UID and SIDs, based on Get_Pwnam() - Look for previous users (lookup by SID) and correctly modify the existing entry in that case - Map the root user to the Admin SID as a 'well known user' - Save the LDAPMessage result on the SAM_ACCOUNT for use in the next 'update' call on that user. This means that VL's very nice work on atomic LDAP updates now really gets used properly! - This also means that we know the right DN to update, without the extra round-trips to the server. Andrew Bartlett (This used to be commit c7118cb31dac24db3b762fe68ce655b17ea102e0) --- source3/include/passdb.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index aeddcbcb3a..bf2fd6f6ce 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -61,6 +61,7 @@ enum pdb_elements { PDB_UNKNOWN6, PDB_LMPASSWD, PDB_NTPASSWD, + PDB_BACKEND_PRIVATE_DATA, /* this must be the last element */ PDB_COUNT @@ -137,6 +138,8 @@ typedef struct sam_passwd uint32 unknown_5; /* 0x0002 0000 */ uint32 unknown_6; /* 0x0000 04ec */ + void *backend_private_data; + void (*backend_private_data_free_fn)(void **); } private; /* Lets see if the remaining code can get the hint that you -- cgit From 85921dbd6fa417aa451ab9b6e88ecb7900333549 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 5 Jul 2003 10:39:41 +0000 Subject: Add some debug statments to our vampire code - try to make it easier to track down failures. Add a 'auto-add on modify' feature to guestsam Fix some segfault bugs on no-op idmap modifications, and on new idmappings that do not have a DN to tack onto. Make the 'private data' a bit more robust. Andrew Bartlett (This used to be commit 6c48309cda9538da5a32f3d88a7bb9c413ae9e8e) --- source3/include/passdb.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index bf2fd6f6ce..e3077eee70 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -138,6 +138,8 @@ typedef struct sam_passwd uint32 unknown_5; /* 0x0002 0000 */ uint32 unknown_6; /* 0x0000 04ec */ + /* a tag for who added the private methods */ + const struct pdb_methods *backend_private_methods; void *backend_private_data; void (*backend_private_data_free_fn)(void **); } private; -- cgit From 3a48e4b2875a6cb1c143377d7f6fb0be50ea80d2 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 18 Sep 2003 23:53:48 +0000 Subject: The "unknown_5" 32 bit field in the user structs is actually 2 16-bit fields, bad_password_count and logon_count. Ensure this is stored/fetched in the various SAMs. As it replaces the unknown_5 field this fits exactly into the tdb SAM without any binary problems. It also is added to the LDAP SAM as two extra attributes. It breaks compatibility with the experimental SAMs xml and mysql. The maintainers of these SAMs must fix them so upgrades like this can be done transparently. I will insist on the "experimental" status until this is solved. Jeremy. (This used to be commit cd7bd8c2daff3293d48f3376a7c5a708a140fd94) --- source3/include/passdb.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index e3077eee70..a4b2bcff3f 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -57,7 +57,8 @@ enum pdb_elements { PDB_MUNGEDDIAL, PDB_HOURS, PDB_UNKNOWN3, - PDB_UNKNOWN5, + PDB_BAD_PASSWORD_COUNT, + PDB_LOGON_COUNT, PDB_UNKNOWN6, PDB_LMPASSWD, PDB_NTPASSWD, @@ -136,7 +137,10 @@ typedef struct sam_passwd uint32 hours_len; /* normally 21 bytes */ uint8 hours[MAX_HOURS_LEN]; - uint32 unknown_5; /* 0x0002 0000 */ + /* Was unknown_5. */ + uint16 bad_password_count; + uint16 logon_count; + uint32 unknown_6; /* 0x0000 04ec */ /* a tag for who added the private methods */ const struct pdb_methods *backend_private_methods; -- cgit From 382e96a6142ef0e7455f235235059daeaf268d1e Mon Sep 17 00:00:00 2001 From: Rafal Szczesniak Date: Thu, 20 Nov 2003 23:56:42 +0000 Subject: Typo fix. (This used to be commit 5054a1731e3bf3bec0687304af63fed475d5f864) --- source3/include/passdb.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index a4b2bcff3f..3e9036aef7 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -98,7 +98,7 @@ typedef struct sam_passwd struct pdb_methods *methods; struct user_data { - /* initiailization flags */ + /* initialization flags */ struct bitmap *change_flags; struct bitmap *set_flags; @@ -161,7 +161,7 @@ typedef struct sam_group { struct pdb_methods *methods; struct group_data { - /* initiailization flags */ + /* initialization flags */ struct bitmap *change_flags; struct bitmap *set_flags; -- cgit From 430f9abd5f1d2537eab17c7c51a9e9b09f415989 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 4 Jan 2004 21:09:42 +0000 Subject: - Put functions for generating SQL queries in pdb_sql.c - Add pgSQL backend (based on patch by Hamish Friedlander) - Use query generate functions from pdb_mysql and pdb_pgsql - Only pdb_pgsql.c needs to be changed whenever the fields in SAM_ACCOUNT change (This used to be commit 65ad2c02fd2bf36d535c279ad290ab81e39f6816) --- source3/include/passdb.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 3e9036aef7..355d1286fd 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -300,4 +300,6 @@ struct pdb_init_function_entry { struct pdb_init_function_entry *prev, *next; }; +enum sql_search_field { SQL_SEARCH_NONE = 0, SQL_SEARCH_USER_SID = 1, SQL_SEARCH_USER_NAME = 2}; + #endif /* _PASSDB_H */ -- cgit From 1fa1e931a3ab031675f4e4e08119a531a1b98ab5 Mon Sep 17 00:00:00 2001 From: Jim McDonough Date: Thu, 12 Feb 2004 16:16:53 +0000 Subject: More sync between passdb on 3.0 and HEAD. Replace unknown_3 with fields_present. Also causes rpc_samr structure field changes. (This used to be commit 1976843345efb6ca4f9cebd964a61acd8ae11d41) --- source3/include/passdb.h | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 355d1286fd..f13cfbe162 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -25,6 +25,42 @@ #define _PASSDB_H +/* + * fields_present flags meanings + * same names as found in samba4 idl files + */ + +#define ACCT_USERNAME 0x00000001 +#define ACCT_FULL_NAME 0x00000002 +#define ACCT_RID 0x00000004 +#define ACCT_PRIMARY_GID 0x00000008 +#define ACCT_ADMIN_DESC 0x00000010 +#define ACCT_DESCRIPTION 0x00000020 +#define ACCT_HOME_DIR 0x00000040 +#define ACCT_HOME_DRIVE 0x00000080 +#define ACCT_LOGON_SCRIPT 0x00000100 +#define ACCT_PROFILE 0x00000200 +#define ACCT_WORKSTATIONS 0x00000400 +#define ACCT_LAST_LOGON 0x00000800 +#define ACCT_LAST_LOGOFF 0x00001000 +#define ACCT_LOGON_HOURS 0x00002000 +#define ACCT_BAD_PWD_COUNT 0x00004000 +#define ACCT_NUM_LOGONS 0x00008000 +#define ACCT_ALLOW_PWD_CHANGE 0x00010000 +#define ACCT_FORCE_PWD_CHANGE 0x00020000 +#define ACCT_LAST_PWD_CHANGE 0x00040000 +#define ACCT_EXPIRY 0x00080000 +#define ACCT_FLAGS 0x00100000 +#define ACCT_CALLBACK 0x00200001 +#define ACCT_COUNTRY_CODE 0x00400000 +#define ACCT_CODE_PAGE 0x00800000 +#define ACCT_NT_PWD_SET 0x01000000 +#define ACCT_LM_PWD_SET 0x02000000 +#define ACCT_PRIVATEDATA 0x04000000 +#define ACCT_EXPIRED_FLAG 0x08000000 +#define ACCT_SEC_DESC 0x10000000 +#define ACCT_OWF_PWD 0x20000000 + /* * bit flags representing initialized fields in SAM_ACCOUNT */ @@ -56,7 +92,7 @@ enum pdb_elements { PDB_UNKNOWNSTR, PDB_MUNGEDDIAL, PDB_HOURS, - PDB_UNKNOWN3, + PDB_FIELDS_PRESENT, PDB_BAD_PASSWORD_COUNT, PDB_LOGON_COUNT, PDB_UNKNOWN6, @@ -131,7 +167,7 @@ typedef struct sam_passwd char* plaintext_pw; /* is Null if not available */ uint16 acct_ctrl; /* account info (ACB_xxxx bit-mask) */ - uint32 unknown_3; /* 0x00ff ffff */ + uint32 fields_present; /* 0x00ff ffff */ uint16 logon_divs; /* 168 - number of hours in a week */ uint32 hours_len; /* normally 21 bytes */ -- cgit From 955ec7c6e237775f1835f22288b1295f1b04ba8f Mon Sep 17 00:00:00 2001 From: Jim McDonough Date: Thu, 19 Feb 2004 15:57:53 +0000 Subject: Add bad password time fields (This used to be commit 59e7c3ababd0bb8bc91cbc421b7a842cca38101f) --- source3/include/passdb.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index f13cfbe162..a3474196e1 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -73,6 +73,7 @@ enum pdb_elements { PDB_LOGONTIME, PDB_LOGOFFTIME, PDB_KICKOFFTIME, + PDB_BAD_PASSWORD_TIME, PDB_CANCHANGETIME, PDB_MUSTCHANGETIME, PDB_PLAINTEXT_PW, @@ -141,6 +142,7 @@ typedef struct sam_passwd time_t logon_time; /* logon time */ time_t logoff_time; /* logoff time */ time_t kickoff_time; /* kickoff time */ + time_t bad_password_time; /* last bad password entered */ time_t pass_last_set_time; /* password last set time */ time_t pass_can_change_time; /* password can change time */ time_t pass_must_change_time; /* password must change time */ -- cgit From db616730198452cb0d8ae72ee5ad1b176a7e55e1 Mon Sep 17 00:00:00 2001 From: Jim McDonough Date: Tue, 2 Mar 2004 18:04:16 +0000 Subject: fix typo for callback bit (This used to be commit 31a15164ffb3f551a5f7006e637036dc3b59bd22) --- source3/include/passdb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index a3474196e1..9eab46bbff 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -51,7 +51,7 @@ #define ACCT_LAST_PWD_CHANGE 0x00040000 #define ACCT_EXPIRY 0x00080000 #define ACCT_FLAGS 0x00100000 -#define ACCT_CALLBACK 0x00200001 +#define ACCT_CALLBACK 0x00200000 #define ACCT_COUNTRY_CODE 0x00400000 #define ACCT_CODE_PAGE 0x00800000 #define ACCT_NT_PWD_SET 0x01000000 -- cgit From 357998ddbdeb2fae0a30c578e747154fec22c180 Mon Sep 17 00:00:00 2001 From: Jim McDonough Date: Thu, 18 Mar 2004 19:22:51 +0000 Subject: Password lockout for LDAP backend. Caches autolock flag, bad count, and bad time locally, updating the directory only for hitting the policy limit or resetting. This needed to be done at the passdb level rather than auth, because some of the functions need to be supported from tools such as pdbedit. It was done at the LDAP backend level instead of generically after discussion, because of the complexity of inserting it at a higher level. The login cache read/write/delete is outside of the ldap backend, so it could easily be called by other backends. tdbsam won't call it for obvious reasons, and authors of other backends need to decide if they want to implement it. (This used to be commit 2a679cbc87a2a9111e9e6cdebbb62dec0ab3a0c0) --- source3/include/passdb.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 9eab46bbff..75c4fd215b 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -125,6 +125,15 @@ enum pdb_value_state { #define IS_SAM_SET(x, flag) (pdb_get_init_flags(x, flag) == PDB_SET) #define IS_SAM_CHANGED(x, flag) (pdb_get_init_flags(x, flag) == PDB_CHANGED) #define IS_SAM_DEFAULT(x, flag) (pdb_get_init_flags(x, flag) == PDB_DEFAULT) + +/* cache for bad password lockout data, to be used on replicated SAMs */ +typedef struct logon_cache_struct +{ + time_t entry_timestamp; + uint16 acct_ctrl; + uint16 bad_password_count; + time_t bad_password_time; +} LOGIN_CACHE; typedef struct sam_passwd { -- cgit From 7af3777ab32ee220700ed3367d07ca18b2bbdd47 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 7 Apr 2004 12:43:44 +0000 Subject: r116: volker's patch for local group and group nesting (This used to be commit b393469d9581f20e4d4c52633b952ee984cca36f) --- source3/include/passdb.h | 81 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 80 insertions(+), 1 deletion(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 75c4fd215b..d08fd13a72 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -223,6 +223,12 @@ typedef struct sam_group { } SAM_GROUP; +struct acct_info +{ + fstring acct_name; /* account name */ + fstring acct_desc; /* account name */ + uint32 rid; /* domain-relative RID */ +}; /***************************************************************** Functions to be implemented by the new (v2) passdb API @@ -233,7 +239,7 @@ typedef struct sam_group { * this SAMBA will load. Increment this if *ANY* changes are made to the interface. */ -#define PASSDB_INTERFACE_VERSION 4 +#define PASSDB_INTERFACE_VERSION 5 typedef struct pdb_context { @@ -279,6 +285,46 @@ typedef struct pdb_context GROUP_MAP **rmap, int *num_entries, BOOL unix_only); + NTSTATUS (*pdb_find_alias)(struct pdb_context *context, + const char *name, DOM_SID *sid); + + NTSTATUS (*pdb_create_alias)(struct pdb_context *context, + const char *name, uint32 *rid); + + NTSTATUS (*pdb_delete_alias)(struct pdb_context *context, + const DOM_SID *sid); + + NTSTATUS (*pdb_enum_aliases)(struct pdb_context *context, + const DOM_SID *domain_sid, + uint32 start_idx, uint32 num_entries, + uint32 *num_aliases, + struct acct_info **aliases); + + NTSTATUS (*pdb_get_aliasinfo)(struct pdb_context *context, + const DOM_SID *sid, + struct acct_info *info); + + NTSTATUS (*pdb_set_aliasinfo)(struct pdb_context *context, + const DOM_SID *sid, + struct acct_info *info); + + NTSTATUS (*pdb_add_aliasmem)(struct pdb_context *context, + const DOM_SID *alias, + const DOM_SID *member); + + NTSTATUS (*pdb_del_aliasmem)(struct pdb_context *context, + const DOM_SID *alias, + const DOM_SID *member); + + NTSTATUS (*pdb_enum_aliasmem)(struct pdb_context *context, + const DOM_SID *alias, + DOM_SID **members, int *num_members); + + NTSTATUS (*pdb_enum_alias_memberships)(struct pdb_context *context, + const DOM_SID *alias, + DOM_SID **aliases, + int *num); + void (*free_fn)(struct pdb_context **); TALLOC_CTX *mem_ctx; @@ -330,6 +376,39 @@ typedef struct pdb_methods GROUP_MAP **rmap, int *num_entries, BOOL unix_only); + NTSTATUS (*find_alias)(struct pdb_methods *methods, + const char *name, DOM_SID *sid); + + NTSTATUS (*create_alias)(struct pdb_methods *methods, + const char *name, uint32 *rid); + + NTSTATUS (*delete_alias)(struct pdb_methods *methods, + const DOM_SID *sid); + + NTSTATUS (*enum_aliases)(struct pdb_methods *methods, + const DOM_SID *domain_sid, + uint32 start_idx, uint32 max_entries, + uint32 *num_aliases, struct acct_info **info); + + NTSTATUS (*get_aliasinfo)(struct pdb_methods *methods, + const DOM_SID *sid, + struct acct_info *info); + + NTSTATUS (*set_aliasinfo)(struct pdb_methods *methods, + const DOM_SID *sid, + struct acct_info *info); + + NTSTATUS (*add_aliasmem)(struct pdb_methods *methods, + const DOM_SID *alias, const DOM_SID *member); + NTSTATUS (*del_aliasmem)(struct pdb_methods *methods, + const DOM_SID *alias, const DOM_SID *member); + NTSTATUS (*enum_aliasmem)(struct pdb_methods *methods, + const DOM_SID *alias, DOM_SID **members, + int *num_members); + NTSTATUS (*enum_alias_memberships)(struct pdb_methods *methods, + const DOM_SID *sid, + DOM_SID **aliases, int *num); + void *private_data; /* Private data of some kind */ void (*free_private_data)(void **); -- cgit From 1c5867502a47371e24519ffeb4165c69cab63482 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 7 Jul 2004 22:46:51 +0000 Subject: r1388: Adding password history code for ldap backend, based on a patch from "Jianliang Lu" . Multi-string attribute changed to linearised pstring due to ordering issues. A few other changes to fix race conditions. I will add the tdb backend code next. This code compiles but has not yet been tested with password history policy set to greater than zero. Targeted for 3.0.6. Jeremy. (This used to be commit dd54b2a3c45e202e504ad69d170eb798da4e6fc9) --- source3/include/passdb.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index d08fd13a72..7d3e0014b6 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -99,6 +99,7 @@ enum pdb_elements { PDB_UNKNOWN6, PDB_LMPASSWD, PDB_NTPASSWD, + PDB_PWHISTORY, PDB_BACKEND_PRIVATE_DATA, /* this must be the last element */ @@ -165,16 +166,17 @@ typedef struct sam_passwd const char * dir_drive; /* home directory drive string */ const char * logon_script; /* logon script string */ const char * profile_path; /* profile path string */ - const char * acct_desc ; /* user description string */ + const char * acct_desc; /* user description string */ const char * workstations; /* login from workstations string */ - const char * unknown_str ; /* don't know what this is, yet. */ - const char * munged_dial ; /* munged path name and dial-back tel number */ + const char * unknown_str; /* don't know what this is, yet. */ + const char * munged_dial; /* munged path name and dial-back tel number */ DOM_SID user_sid; /* Primary User SID */ DOM_SID group_sid; /* Primary Group SID */ DATA_BLOB lm_pw; /* .data is Null if no password */ DATA_BLOB nt_pw; /* .data is Null if no password */ + DATA_BLOB nt_pw_his; /* nt hashed password history .data is Null if not available */ char* plaintext_pw; /* is Null if not available */ uint16 acct_ctrl; /* account info (ACB_xxxx bit-mask) */ -- cgit From 154d5f913b4ce60f731227eb1bb3650c45fcde93 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 5 Nov 2004 23:34:00 +0000 Subject: r3566: Completely replace the queryuseraliases call. The previous implementation does not exactly match what you would expect. XP workstations during login actually do this, so we should better become a bit more correct. The LDAP query issued is not really fully optimal, but it is a lot faster and more correct than what was there before. The change in passdb.h makes it possible that queryuseraliases is done with a single ldap query. Volker (This used to be commit 2508d4ed1e16c268fc9f3676b0c6a122e070f93d) --- source3/include/passdb.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 7d3e0014b6..8219e90f2b 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -323,9 +323,10 @@ typedef struct pdb_context DOM_SID **members, int *num_members); NTSTATUS (*pdb_enum_alias_memberships)(struct pdb_context *context, - const DOM_SID *alias, + const DOM_SID *members, + int num_members, DOM_SID **aliases, - int *num); + int *num_aliases); void (*free_fn)(struct pdb_context **); @@ -408,7 +409,8 @@ typedef struct pdb_methods const DOM_SID *alias, DOM_SID **members, int *num_members); NTSTATUS (*enum_alias_memberships)(struct pdb_methods *methods, - const DOM_SID *sid, + const DOM_SID *members, + int num_members, DOM_SID **aliases, int *num); void *private_data; /* Private data of some kind */ -- cgit From f9e87b9ba65f37bafa45eacb1a6c9b8c5483d46b Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 12 Nov 2004 15:49:47 +0000 Subject: r3705: Nobody has commented, so I'll take this as an ack... abartlet, I'd like to ask you to take a severe look at this! We have solved the problem to find the global groups a user is in twice: Once in auth_util.c and another time for the corresponding samr call. The attached patch unifies these and sends them through the passdb backend (new function pdb_enum_group_memberships). Thus it gives pdb_ldap.c the chance to further optimize the corresponding call if the samba and posix accounts are unified by issuing a specialized ldap query. The parameter to activate this ldapsam behaviour is ldapsam:trusted = yes Volker (This used to be commit b94838aff1a009f8d8c2c3efd48756a5b8f3f989) --- source3/include/passdb.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 8219e90f2b..db6bc2ac75 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -287,6 +287,12 @@ typedef struct pdb_context GROUP_MAP **rmap, int *num_entries, BOOL unix_only); + NTSTATUS (*pdb_enum_group_memberships)(struct pdb_context *context, + const char *username, + gid_t primary_gid, + DOM_SID **sids, gid_t **gids, + int *num_groups); + NTSTATUS (*pdb_find_alias)(struct pdb_context *context, const char *name, DOM_SID *sid); @@ -379,6 +385,12 @@ typedef struct pdb_methods GROUP_MAP **rmap, int *num_entries, BOOL unix_only); + NTSTATUS (*enum_group_memberships)(struct pdb_methods *methods, + const char *username, + gid_t primary_gid, + DOM_SID **sids, gid_t **gids, + int *num_groups); + NTSTATUS (*find_alias)(struct pdb_methods *methods, const char *name, DOM_SID *sid); -- cgit From 1ed62fde09f382342a396a047975fdeeea7113bb Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 19 Jan 2005 16:13:26 +0000 Subject: r4847: Hand over a acb_mask to pdb_setsampwent in load_sampwd_entries(). This allows the ldap-backend to search much more effeciently. Machines will be searched in the ldap_machine_suffix and users in the ldap_users_suffix. (Note that we already use the ldap_group_suffix in ldapsam_setsamgrent for quite some time). Using the specific ldap-bases becomes notably important in large domains: On my testmachine "net rpc trustdom list" has to search through 40k accounts just to list 3 interdomain-trust-accounts, similiar effects show up the non-user query_dispinfo-calls, etc. Also renamed all_machines to only_machines in load_sampwd_entries() since that reflects better what is really meant. Guenther (This used to be commit 6394257cc721ca739bda0e320375f04506913533) --- source3/include/passdb.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index db6bc2ac75..1b9ccc50ee 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -241,7 +241,7 @@ struct acct_info * this SAMBA will load. Increment this if *ANY* changes are made to the interface. */ -#define PASSDB_INTERFACE_VERSION 5 +#define PASSDB_INTERFACE_VERSION 6 typedef struct pdb_context { @@ -251,7 +251,7 @@ typedef struct pdb_context /* These functions are wrappers for the functions listed above. They may do extra things like re-reading a SAM_ACCOUNT on update */ - NTSTATUS (*pdb_setsampwent)(struct pdb_context *, BOOL update); + NTSTATUS (*pdb_setsampwent)(struct pdb_context *, BOOL update, uint16 acb_mask); void (*pdb_endsampwent)(struct pdb_context *); @@ -349,7 +349,7 @@ typedef struct pdb_methods struct pdb_methods *next; struct pdb_methods *prev; - NTSTATUS (*setsampwent)(struct pdb_methods *, BOOL update); + NTSTATUS (*setsampwent)(struct pdb_methods *, BOOL update, uint16 acb_mask); void (*endsampwent)(struct pdb_methods *); -- cgit From b4afdc08d5336e4a337e453443d7af1d8655a31a Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Sat, 22 Jan 2005 03:37:09 +0000 Subject: r4925: Migrate Account Policies to passdb (esp. replicating ldapsam). Does automated migration from account_policy.tdb v1 and v2 and offers a pdbedit-Migration interface. Jerry, please feel free to revert that if you have other plans. Guenther (This used to be commit 75af83dfcd8ef365b4b1180453060ae5176389f5) --- source3/include/passdb.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 1b9ccc50ee..f37a278255 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -334,6 +334,12 @@ typedef struct pdb_context DOM_SID **aliases, int *num_aliases); + NTSTATUS (*pdb_get_account_policy)(struct pdb_context *context, + int policy_index, int *value); + + NTSTATUS (*pdb_set_account_policy)(struct pdb_context *context, + int policy_index, int value); + void (*free_fn)(struct pdb_context **); TALLOC_CTX *mem_ctx; @@ -425,6 +431,12 @@ typedef struct pdb_methods int num_members, DOM_SID **aliases, int *num); + NTSTATUS (*get_account_policy)(struct pdb_methods *methods, + int policy_index, int *value); + + NTSTATUS (*set_account_policy)(struct pdb_methods *methods, + int policy_index, int value); + void *private_data; /* Private data of some kind */ void (*free_private_data)(void **); -- cgit From a851dcd09a5aff51707a49ace567a272a58837b7 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Sat, 22 Jan 2005 12:02:13 +0000 Subject: r4932: Forgot to increase version with the account-policy-commit. Guenther (This used to be commit 42e380303ddce890f313c221a766dc1e1ee972fb) --- source3/include/passdb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index f37a278255..eed3be1ff9 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -241,7 +241,7 @@ struct acct_info * this SAMBA will load. Increment this if *ANY* changes are made to the interface. */ -#define PASSDB_INTERFACE_VERSION 6 +#define PASSDB_INTERFACE_VERSION 7 typedef struct pdb_context { -- cgit From 6c84ecb55657ae28eb739a72164f6d7251dc627f Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Sat, 12 Feb 2005 00:51:31 +0000 Subject: r5349: After talking with Jerry, reverted the addition of account policies to passdb in 3_0 (they are still in trunk). Guenther (This used to be commit fdf9bdbbac1d8d4f3b3e1fc7e49c1e659b9301b1) --- source3/include/passdb.h | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index eed3be1ff9..42f38e5b6a 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -334,12 +334,6 @@ typedef struct pdb_context DOM_SID **aliases, int *num_aliases); - NTSTATUS (*pdb_get_account_policy)(struct pdb_context *context, - int policy_index, int *value); - - NTSTATUS (*pdb_set_account_policy)(struct pdb_context *context, - int policy_index, int value); - void (*free_fn)(struct pdb_context **); TALLOC_CTX *mem_ctx; @@ -431,12 +425,6 @@ typedef struct pdb_methods int num_members, DOM_SID **aliases, int *num); - NTSTATUS (*get_account_policy)(struct pdb_methods *methods, - int policy_index, int *value); - - NTSTATUS (*set_account_policy)(struct pdb_methods *methods, - int policy_index, int value); - void *private_data; /* Private data of some kind */ void (*free_private_data)(void **); -- cgit From a90a58ff221a4469d6e87df655cb2201d68e237b Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 20 Feb 2005 13:47:16 +0000 Subject: r5467: Optimize _samr_query_groupmem with LDAP backend for large domains. Could someone else please look at this patch, verifying that I did not break the ldapsam:trusted = False fallback to the old behaviour? It works fine for me, but you never know. You're certainly free to review the new code as well :-) Thanks, Volker (This used to be commit e1c3ca182b299dc65da1fa39aadb69876b5e16b8) --- source3/include/passdb.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 42f38e5b6a..3c244e7625 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -287,6 +287,12 @@ typedef struct pdb_context GROUP_MAP **rmap, int *num_entries, BOOL unix_only); + NTSTATUS (*pdb_enum_group_members)(struct pdb_context *context, + TALLOC_CTX *mem_ctx, + const DOM_SID *group, + uint32 **member_rids, + int *num_members); + NTSTATUS (*pdb_enum_group_memberships)(struct pdb_context *context, const char *username, gid_t primary_gid, @@ -385,6 +391,12 @@ typedef struct pdb_methods GROUP_MAP **rmap, int *num_entries, BOOL unix_only); + NTSTATUS (*enum_group_members)(struct pdb_methods *methods, + TALLOC_CTX *mem_ctx, + const DOM_SID *group, + uint32 **member_rids, + int *num_members); + NTSTATUS (*enum_group_memberships)(struct pdb_methods *methods, const char *username, gid_t primary_gid, -- cgit From a5f84481e38ffc79043bfbac5f0353856b77b141 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 5 Mar 2005 01:22:53 +0000 Subject: r5655: Added support for Novell NDS universal password. Code donated by Vince Brimhall - slight tidyup by me to use Samba conventions. Vince - thanks a *lot* for this code - please test to make sure I haven't messed anything up. Jeremy. (This used to be commit 6f5ea963abe8e19d17a1803d4bedd9d87a317e58) --- source3/include/passdb.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 3c244e7625..5a70bb45a8 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -241,7 +241,7 @@ struct acct_info * this SAMBA will load. Increment this if *ANY* changes are made to the interface. */ -#define PASSDB_INTERFACE_VERSION 7 +#define PASSDB_INTERFACE_VERSION 8 typedef struct pdb_context { @@ -267,6 +267,8 @@ typedef struct pdb_context NTSTATUS (*pdb_delete_sam_account)(struct pdb_context *, SAM_ACCOUNT *username); + NTSTATUS (*pdb_update_login_attempts)(struct pdb_context *context, SAM_ACCOUNT *sam_acct, BOOL success); + NTSTATUS (*pdb_getgrsid)(struct pdb_context *context, GROUP_MAP *map, DOM_SID sid); NTSTATUS (*pdb_getgrgid)(struct pdb_context *context, GROUP_MAP *map, gid_t gid); @@ -371,6 +373,8 @@ typedef struct pdb_methods NTSTATUS (*delete_sam_account)(struct pdb_methods *, SAM_ACCOUNT *username); + NTSTATUS (*update_login_attempts)(struct pdb_methods *methods, SAM_ACCOUNT *sam_acct, BOOL success); + NTSTATUS (*getgrsid)(struct pdb_methods *methods, GROUP_MAP *map, DOM_SID sid); NTSTATUS (*getgrgid)(struct pdb_methods *methods, GROUP_MAP *map, gid_t gid); -- cgit From cf7d098b2c1032b51b8f5d439b29c8d20d0991ee Mon Sep 17 00:00:00 2001 From: Jim McDonough Date: Tue, 22 Mar 2005 20:50:29 +0000 Subject: r5965: Apply Volker's patch for "ldapsam trusted = yes" for samr_lookup_rids. Gives us again up to ~6x improvement on group membership lookups. (This used to be commit e2117bcb09cbd21df3b6621c2794a006418c1d9e) --- source3/include/passdb.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 5a70bb45a8..ca65a4e5e8 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -342,6 +342,14 @@ typedef struct pdb_context DOM_SID **aliases, int *num_aliases); + NTSTATUS (*pdb_lookup_rids)(struct pdb_context *context, + TALLOC_CTX *mem_ctx, + const DOM_SID *domain_sid, + int num_rids, + uint32 *rids, + const char ***names, + uint32 **attrs); + void (*free_fn)(struct pdb_context **); TALLOC_CTX *mem_ctx; @@ -440,6 +448,13 @@ typedef struct pdb_methods const DOM_SID *members, int num_members, DOM_SID **aliases, int *num); + NTSTATUS (*lookup_rids)(struct pdb_methods *methods, + TALLOC_CTX *mem_ctx, + const DOM_SID *domain_sid, + int num_rids, + uint32 *rids, + const char ***names, + uint32 **attrs); void *private_data; /* Private data of some kind */ -- cgit From e84ead0cfdc5e45a577387cc54dceb4c3f32948a Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 27 Mar 2005 16:33:04 +0000 Subject: r6080: Port some of the non-critical changes from HEAD to 3_0. The main one is the change in pdb_enum_alias_memberships to match samr.idl a bit closer. Volker (This used to be commit 3a6786516957d9f67af6d53a3167c88aa272972f) --- source3/include/passdb.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index ca65a4e5e8..f711eaf578 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -337,10 +337,12 @@ typedef struct pdb_context DOM_SID **members, int *num_members); NTSTATUS (*pdb_enum_alias_memberships)(struct pdb_context *context, - const DOM_SID *members, + TALLOC_CTX *mem_ctx, + const DOM_SID *domain_sid, + const DOM_SID const *members, int num_members, - DOM_SID **aliases, - int *num_aliases); + uint32 **alias_rids, + int *num_alias_rids); NTSTATUS (*pdb_lookup_rids)(struct pdb_context *context, TALLOC_CTX *mem_ctx, @@ -445,9 +447,12 @@ typedef struct pdb_methods const DOM_SID *alias, DOM_SID **members, int *num_members); NTSTATUS (*enum_alias_memberships)(struct pdb_methods *methods, - const DOM_SID *members, + TALLOC_CTX *mem_ctx, + const DOM_SID *domain_sid, + const DOM_SID const *members, int num_members, - DOM_SID **aliases, int *num); + uint32 **alias_rids, + int *num_alias_rids); NTSTATUS (*lookup_rids)(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, const DOM_SID *domain_sid, -- cgit From 202c7b4571824406c5751018aa1896a31f73c24e Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 28 Mar 2005 03:27:44 +0000 Subject: r6092: This much const causes the compiler on Fedora Core 2 to throw up. Jeremy. (This used to be commit 051f0ed8075a3616484888ab22d68ca11aa1dd36) --- source3/include/passdb.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index f711eaf578..2c63271492 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -339,7 +339,7 @@ typedef struct pdb_context NTSTATUS (*pdb_enum_alias_memberships)(struct pdb_context *context, TALLOC_CTX *mem_ctx, const DOM_SID *domain_sid, - const DOM_SID const *members, + const DOM_SID *members, int num_members, uint32 **alias_rids, int *num_alias_rids); @@ -449,7 +449,7 @@ typedef struct pdb_methods NTSTATUS (*enum_alias_memberships)(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, const DOM_SID *domain_sid, - const DOM_SID const *members, + const DOM_SID *members, int num_members, uint32 **alias_rids, int *num_alias_rids); -- cgit From 9f4c0afa0a3e359dfe9ac5dd8df0849b450a3fe1 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 10 Apr 2005 15:26:37 +0000 Subject: r6277: This implements a new caching API for enumerating the pdb elements. It is modeled after query_displayinfo and should hide the differences between users, groups and aliases while allowing a cache analog load_sampw_entries: struct pdb_search *pdb_search_users(uint16 acct_flags); struct pdb_search *pdb_search_groups(void); struct pdb_search *pdb_search_aliases(const DOM_SID *sid); uint32 pdb_search_entries(struct pdb_search *search, uint32 start_idx, uint32 max_entries, struct samr_displayentry **result); void pdb_search_destroy(struct pdb_search *search); Why this API? Eventually we will need to apply the work gd has started on enumerating users with paged ldap searches to groups and aliases. Before doing that I want to clean up the search routines we have. The sample application (more to follow) is 'net maxrid'. Volker (This used to be commit 8b4f67a1e9d459145cde10b1064781d58d62b805) --- source3/include/passdb.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 2c63271492..624f0c5fea 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -480,4 +480,27 @@ struct pdb_init_function_entry { enum sql_search_field { SQL_SEARCH_NONE = 0, SQL_SEARCH_USER_SID = 1, SQL_SEARCH_USER_NAME = 2}; +struct samr_displayentry { + uint32 rid; + uint16 acct_flags; + const char *account_name; + const char *fullname; + const char *description; +}; + +enum pdb_search_type { + PDB_USER_SEARCH, + PDB_GROUP_SEARCH, + PDB_ALIAS_SEARCH +}; + +struct pdb_search { + TALLOC_CTX *mem_ctx; + enum pdb_search_type type; + struct samr_displayentry *cache; + uint32 cache_size; + BOOL search_ended; + void *private; +}; + #endif /* _PASSDB_H */ -- cgit From d3d6126d94d55a69c45b2f7a63a7fa9b561baf48 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 15 Apr 2005 13:41:49 +0000 Subject: r6351: This is quite a large and intrusive patch, but there are not many pieces that can be taken out of it, so I decided to commit this in one lump. It changes the passdb enumerating functions to use ldap paged results where possible. In particular the samr calls querydispinfo, enumdomusers and friends have undergone significant internal changes. I have tested this extensively with rpcclient and a bit with usrmgr.exe. More tests and the merge to trunk will follow later. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The code is based on a first implementation by Günther Deschner, but has evolved quite a bit since then. Volker (This used to be commit f0bb44ac58e190e19eb4e92928979b0446e611c9) --- source3/include/passdb.h | 86 +++++++++++++++++++++++++++++------------------- 1 file changed, 52 insertions(+), 34 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 624f0c5fea..0c816271b0 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -232,6 +232,30 @@ struct acct_info uint32 rid; /* domain-relative RID */ }; +struct samr_displayentry { + uint32 rid; + uint16 acct_flags; + const char *account_name; + const char *fullname; + const char *description; +}; + +enum pdb_search_type { + PDB_USER_SEARCH, + PDB_GROUP_SEARCH, + PDB_ALIAS_SEARCH +}; + +struct pdb_search { + TALLOC_CTX *mem_ctx; + enum pdb_search_type type; + struct samr_displayentry *cache; + uint32 num_entries; + ssize_t cache_size; + BOOL search_ended; + void *private; +}; + /***************************************************************** Functions to be implemented by the new (v2) passdb API ****************************************************************/ @@ -310,12 +334,6 @@ typedef struct pdb_context NTSTATUS (*pdb_delete_alias)(struct pdb_context *context, const DOM_SID *sid); - NTSTATUS (*pdb_enum_aliases)(struct pdb_context *context, - const DOM_SID *domain_sid, - uint32 start_idx, uint32 num_entries, - uint32 *num_aliases, - struct acct_info **aliases); - NTSTATUS (*pdb_get_aliasinfo)(struct pdb_context *context, const DOM_SID *sid, struct acct_info *info); @@ -352,6 +370,20 @@ typedef struct pdb_context const char ***names, uint32 **attrs); + BOOL (*pdb_search_users)(struct pdb_context *context, + struct pdb_search *search, + uint16 acct_flags); + BOOL (*pdb_search_groups)(struct pdb_context *context, + struct pdb_search *search); + BOOL (*pdb_search_aliases)(struct pdb_context *context, + struct pdb_search *search, + const DOM_SID *sid); + BOOL (*pdb_search_next_entry)(struct pdb_context *context, + struct pdb_search *search, + struct samr_displayentry *entry); + void (*pdb_search_end)(struct pdb_context *context, + struct pdb_search *search); + void (*free_fn)(struct pdb_context **); TALLOC_CTX *mem_ctx; @@ -426,11 +458,6 @@ typedef struct pdb_methods NTSTATUS (*delete_alias)(struct pdb_methods *methods, const DOM_SID *sid); - NTSTATUS (*enum_aliases)(struct pdb_methods *methods, - const DOM_SID *domain_sid, - uint32 start_idx, uint32 max_entries, - uint32 *num_aliases, struct acct_info **info); - NTSTATUS (*get_aliasinfo)(struct pdb_methods *methods, const DOM_SID *sid, struct acct_info *info); @@ -461,6 +488,20 @@ typedef struct pdb_methods const char ***names, uint32 **attrs); + BOOL (*search_users)(struct pdb_methods *methods, + struct pdb_search *search, + uint16 acct_flags); + BOOL (*search_groups)(struct pdb_methods *methods, + struct pdb_search *search); + BOOL (*search_aliases)(struct pdb_methods *methods, + struct pdb_search *search, + const DOM_SID *sid); + BOOL (*search_next_entry)(struct pdb_methods *methods, + struct pdb_search *search, + struct samr_displayentry *entry); + void (*search_end)(struct pdb_methods *methods, + struct pdb_search *search); + void *private_data; /* Private data of some kind */ void (*free_private_data)(void **); @@ -480,27 +521,4 @@ struct pdb_init_function_entry { enum sql_search_field { SQL_SEARCH_NONE = 0, SQL_SEARCH_USER_SID = 1, SQL_SEARCH_USER_NAME = 2}; -struct samr_displayentry { - uint32 rid; - uint16 acct_flags; - const char *account_name; - const char *fullname; - const char *description; -}; - -enum pdb_search_type { - PDB_USER_SEARCH, - PDB_GROUP_SEARCH, - PDB_ALIAS_SEARCH -}; - -struct pdb_search { - TALLOC_CTX *mem_ctx; - enum pdb_search_type type; - struct samr_displayentry *cache; - uint32 cache_size; - BOOL search_ended; - void *private; -}; - #endif /* _PASSDB_H */ -- cgit From f74f7c933db6c981661ce5fc8666b87ad7ef41cc Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 18 Apr 2005 16:07:49 +0000 Subject: r6367: Slim down pdb_interface.c a bit. next_entry and search_end are function pointers now. Yes, Jeremy, this is about re-inventing C++... :-) Volker (This used to be commit a831e54738c7854e68c696e9cbb132c012ff223c) --- source3/include/passdb.h | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 0c816271b0..9a3dd9c8d3 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -254,6 +254,9 @@ struct pdb_search { ssize_t cache_size; BOOL search_ended; void *private; + BOOL (*next_entry)(struct pdb_search *search, + struct samr_displayentry *entry); + void (*search_end)(struct pdb_search *search); }; /***************************************************************** @@ -378,11 +381,6 @@ typedef struct pdb_context BOOL (*pdb_search_aliases)(struct pdb_context *context, struct pdb_search *search, const DOM_SID *sid); - BOOL (*pdb_search_next_entry)(struct pdb_context *context, - struct pdb_search *search, - struct samr_displayentry *entry); - void (*pdb_search_end)(struct pdb_context *context, - struct pdb_search *search); void (*free_fn)(struct pdb_context **); @@ -496,11 +494,6 @@ typedef struct pdb_methods BOOL (*search_aliases)(struct pdb_methods *methods, struct pdb_search *search, const DOM_SID *sid); - BOOL (*search_next_entry)(struct pdb_methods *methods, - struct pdb_search *search, - struct samr_displayentry *entry); - void (*search_end)(struct pdb_methods *methods, - struct pdb_search *search); void *private_data; /* Private data of some kind */ -- cgit From 19ca97a70f6b7b41d251eaa76e4d3c980c6eedff Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 24 Jun 2005 20:25:18 +0000 Subject: r7882: Looks like a large patch - but what it actually does is make Samba safe for using our headers and linking with C++ modules. Stops us from using C++ reserved keywords in our code. Jeremy (This used to be commit 9506b8e145982b1160a2f0aee5c9b7a54980940a) --- source3/include/passdb.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 9a3dd9c8d3..114585346e 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -195,7 +195,7 @@ typedef struct sam_passwd const struct pdb_methods *backend_private_methods; void *backend_private_data; void (*backend_private_data_free_fn)(void **); - } private; + } private_u; /* Lets see if the remaining code can get the hint that you are meant to use the pdb_...() functions. */ @@ -221,7 +221,7 @@ typedef struct sam_group { uint32 mem_num; /* Number of member SIDs */ DOM_SID *members; /* SID array */ - } private; + } private_g; } SAM_GROUP; @@ -253,7 +253,7 @@ struct pdb_search { uint32 num_entries; ssize_t cache_size; BOOL search_ended; - void *private; + void *private_data; BOOL (*next_entry)(struct pdb_search *search, struct samr_displayentry *entry); void (*search_end)(struct pdb_search *search); -- cgit From 54abd2aa66069e6baf7769c496f46d9dba18db39 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 30 Sep 2005 17:13:37 +0000 Subject: r10656: BIG merge from trunk. Features not copied over * \PIPE\unixinfo * winbindd's {group,alias}membership new functions * winbindd's lookupsids() functionality * swat (trunk changes to be reverted as per discussion with Deryck) (This used to be commit 939c3cb5d78e3a2236209b296aa8aba8bdce32d3) --- source3/include/passdb.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 114585346e..e985ab582d 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -233,6 +233,7 @@ struct acct_info }; struct samr_displayentry { + uint32 idx; uint32 rid; uint16 acct_flags; const char *account_name; @@ -268,7 +269,7 @@ struct pdb_search { * this SAMBA will load. Increment this if *ANY* changes are made to the interface. */ -#define PASSDB_INTERFACE_VERSION 8 +#define PASSDB_INTERFACE_VERSION 9 typedef struct pdb_context { @@ -373,6 +374,14 @@ typedef struct pdb_context const char ***names, uint32 **attrs); + NTSTATUS (*pdb_get_account_policy)(struct pdb_context *context, + int policy_index, uint32 *value); + + NTSTATUS (*pdb_set_account_policy)(struct pdb_context *context, + int policy_index, uint32 value); + + NTSTATUS (*pdb_get_seq_num)(struct pdb_context *context, time_t *seq_num); + BOOL (*pdb_search_users)(struct pdb_context *context, struct pdb_search *search, uint16 acct_flags); @@ -478,6 +487,7 @@ typedef struct pdb_methods int num_members, uint32 **alias_rids, int *num_alias_rids); + NTSTATUS (*lookup_rids)(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, const DOM_SID *domain_sid, @@ -486,6 +496,14 @@ typedef struct pdb_methods const char ***names, uint32 **attrs); + NTSTATUS (*get_account_policy)(struct pdb_methods *methods, + int policy_index, uint32 *value); + + NTSTATUS (*set_account_policy)(struct pdb_methods *methods, + int policy_index, uint32 value); + + NTSTATUS (*get_seq_num)(struct pdb_methods *methods, time_t *seq_num); + BOOL (*search_users)(struct pdb_methods *methods, struct pdb_search *search, uint16 acct_flags); -- cgit From 254938c636b6062630d54a598b2975d7a984f70d Mon Sep 17 00:00:00 2001 From: Jim McDonough Date: Tue, 11 Oct 2005 20:14:04 +0000 Subject: r10911: part of #2861: add rename support for usrmgr.exe when using tdbsam This gets it working before replacing tdb with the samba4 version. (This used to be commit 8210b0503a050e12ee1b4335fa6e50d10ad06577) --- source3/include/passdb.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index e985ab582d..4964ff3759 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -269,7 +269,7 @@ struct pdb_search { * this SAMBA will load. Increment this if *ANY* changes are made to the interface. */ -#define PASSDB_INTERFACE_VERSION 9 +#define PASSDB_INTERFACE_VERSION 10 typedef struct pdb_context { @@ -294,6 +294,8 @@ typedef struct pdb_context NTSTATUS (*pdb_update_sam_account)(struct pdb_context *, SAM_ACCOUNT *sampass); NTSTATUS (*pdb_delete_sam_account)(struct pdb_context *, SAM_ACCOUNT *username); + + NTSTATUS (*pdb_rename_sam_account)(struct pdb_context *, SAM_ACCOUNT *oldname, const char *newname); NTSTATUS (*pdb_update_login_attempts)(struct pdb_context *context, SAM_ACCOUNT *sam_acct, BOOL success); @@ -422,6 +424,8 @@ typedef struct pdb_methods NTSTATUS (*delete_sam_account)(struct pdb_methods *, SAM_ACCOUNT *username); + NTSTATUS (*rename_sam_account)(struct pdb_methods *, SAM_ACCOUNT *oldname, const char *newname); + NTSTATUS (*update_login_attempts)(struct pdb_methods *methods, SAM_ACCOUNT *sam_acct, BOOL success); NTSTATUS (*getgrsid)(struct pdb_methods *methods, GROUP_MAP *map, DOM_SID sid); -- cgit From 8d7c88667190fe286971ac4fffb64ee5bd9eeeb0 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 18 Oct 2005 03:24:00 +0000 Subject: r11137: Compile with only 2 warnings (I'm still working on that code) on a gcc4 x86_64 box. Jeremy. (This used to be commit d720867a788c735e56d53d63265255830ec21208) --- source3/include/passdb.h | 60 +++++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 31 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 4964ff3759..293d18a42a 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -128,16 +128,14 @@ enum pdb_value_state { #define IS_SAM_DEFAULT(x, flag) (pdb_get_init_flags(x, flag) == PDB_DEFAULT) /* cache for bad password lockout data, to be used on replicated SAMs */ -typedef struct logon_cache_struct -{ +typedef struct logon_cache_struct { time_t entry_timestamp; uint16 acct_ctrl; uint16 bad_password_count; time_t bad_password_time; } LOGIN_CACHE; -typedef struct sam_passwd -{ +typedef struct sam_passwd { TALLOC_CTX *mem_ctx; void (*free_fn)(struct sam_passwd **); @@ -225,11 +223,10 @@ typedef struct sam_group { } SAM_GROUP; -struct acct_info -{ - fstring acct_name; /* account name */ - fstring acct_desc; /* account name */ - uint32 rid; /* domain-relative RID */ +struct acct_info { + fstring acct_name; /* account name */ + fstring acct_desc; /* account name */ + uint32 rid; /* domain-relative RID */ }; struct samr_displayentry { @@ -267,9 +264,10 @@ struct pdb_search { /* * This next constant specifies the version number of the PASSDB interface * this SAMBA will load. Increment this if *ANY* changes are made to the interface. + * Changed interface to fix int -> size_t problems. JRA. */ -#define PASSDB_INTERFACE_VERSION 10 +#define PASSDB_INTERFACE_VERSION 11 typedef struct pdb_context { @@ -316,20 +314,20 @@ typedef struct pdb_context NTSTATUS (*pdb_enum_group_mapping)(struct pdb_context *context, enum SID_NAME_USE sid_name_use, - GROUP_MAP **rmap, int *num_entries, + GROUP_MAP **pp_rmap, size_t *p_num_entries, BOOL unix_only); NTSTATUS (*pdb_enum_group_members)(struct pdb_context *context, TALLOC_CTX *mem_ctx, const DOM_SID *group, - uint32 **member_rids, - int *num_members); + uint32 **pp_member_rids, + size_t *p_num_members); NTSTATUS (*pdb_enum_group_memberships)(struct pdb_context *context, const char *username, gid_t primary_gid, - DOM_SID **sids, gid_t **gids, - int *num_groups); + DOM_SID **pp_sids, gid_t **pp_gids, + size_t *p_num_groups); NTSTATUS (*pdb_find_alias)(struct pdb_context *context, const char *name, DOM_SID *sid); @@ -358,22 +356,22 @@ typedef struct pdb_context NTSTATUS (*pdb_enum_aliasmem)(struct pdb_context *context, const DOM_SID *alias, - DOM_SID **members, int *num_members); + DOM_SID **pp_members, size_t *p_num_members); NTSTATUS (*pdb_enum_alias_memberships)(struct pdb_context *context, TALLOC_CTX *mem_ctx, const DOM_SID *domain_sid, const DOM_SID *members, - int num_members, - uint32 **alias_rids, - int *num_alias_rids); + size_t num_members, + uint32 **pp_alias_rids, + size_t *p_num_alias_rids); NTSTATUS (*pdb_lookup_rids)(struct pdb_context *context, TALLOC_CTX *mem_ctx, const DOM_SID *domain_sid, - int num_rids, + size_t num_rids, uint32 *rids, - const char ***names, + const char ***pp_names, uint32 **attrs); NTSTATUS (*pdb_get_account_policy)(struct pdb_context *context, @@ -445,20 +443,20 @@ typedef struct pdb_methods NTSTATUS (*enum_group_mapping)(struct pdb_methods *methods, enum SID_NAME_USE sid_name_use, - GROUP_MAP **rmap, int *num_entries, + GROUP_MAP **pp_rmap, size_t *p_num_entries, BOOL unix_only); NTSTATUS (*enum_group_members)(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, const DOM_SID *group, - uint32 **member_rids, - int *num_members); + uint32 **pp_member_rids, + size_t *p_num_members); NTSTATUS (*enum_group_memberships)(struct pdb_methods *methods, const char *username, gid_t primary_gid, - DOM_SID **sids, gid_t **gids, - int *num_groups); + DOM_SID **pp_sids, gid_t **pp_gids, + size_t *p_num_groups); NTSTATUS (*find_alias)(struct pdb_methods *methods, const char *name, DOM_SID *sid); @@ -483,21 +481,21 @@ typedef struct pdb_methods const DOM_SID *alias, const DOM_SID *member); NTSTATUS (*enum_aliasmem)(struct pdb_methods *methods, const DOM_SID *alias, DOM_SID **members, - int *num_members); + size_t *p_num_members); NTSTATUS (*enum_alias_memberships)(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, const DOM_SID *domain_sid, const DOM_SID *members, - int num_members, - uint32 **alias_rids, - int *num_alias_rids); + size_t num_members, + uint32 **pp_alias_rids, + size_t *p_num_alias_rids); NTSTATUS (*lookup_rids)(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, const DOM_SID *domain_sid, int num_rids, uint32 *rids, - const char ***names, + const char ***pp_names, uint32 **attrs); NTSTATUS (*get_account_policy)(struct pdb_methods *methods, -- cgit From 046a8873b9001662eff7bbdf549d2a511216c092 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 26 Nov 2005 22:04:28 +0000 Subject: r11922: Looks bigger than it is: There's no point in allocating arrays in samr_lookup_rids twice. It was done in the srv_samr_nt.c code as well as in the pdb module. Remove the latter, this might happen more often. Volker (This used to be commit 57f0cf8cdd6928f4759036e5dd53d41736aa910d) --- source3/include/passdb.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 293d18a42a..15f0701e9b 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -367,12 +367,11 @@ typedef struct pdb_context size_t *p_num_alias_rids); NTSTATUS (*pdb_lookup_rids)(struct pdb_context *context, - TALLOC_CTX *mem_ctx, const DOM_SID *domain_sid, size_t num_rids, uint32 *rids, - const char ***pp_names, - uint32 **attrs); + const char **pp_names, + uint32 *attrs); NTSTATUS (*pdb_get_account_policy)(struct pdb_context *context, int policy_index, uint32 *value); @@ -491,12 +490,11 @@ typedef struct pdb_methods size_t *p_num_alias_rids); NTSTATUS (*lookup_rids)(struct pdb_methods *methods, - TALLOC_CTX *mem_ctx, const DOM_SID *domain_sid, int num_rids, uint32 *rids, - const char ***pp_names, - uint32 **attrs); + const char **pp_names, + uint32 *attrs); NTSTATUS (*get_account_policy)(struct pdb_methods *methods, int policy_index, uint32 *value); -- cgit From 48c2f9fc72afaf5d7817bfb12f0acef9ab26faf0 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sun, 27 Nov 2005 01:17:24 +0000 Subject: r11924: Added Volkers's (C) to srv_samr_nt.c, removed separate "builtin" search enumeration, fixed count of groups and users to return zero if we're getting domain info on the builtin domain (need to fix the enumgroup and enumuser calls also). Added count_sam_aliases to return the correct alias count. Need to push the SID arg down into the group mapping interface so we only return the correct aliases. Upped passdb version numer for Volkers changes. SAM-MYSQL guys - you will need to fix your backend now. More tests needed. Jeremy. (This used to be commit b53d5cd565b05b0595979efba6176d0cafc8cb03) --- source3/include/passdb.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 15f0701e9b..0589b9a7cd 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -265,9 +265,12 @@ struct pdb_search { * This next constant specifies the version number of the PASSDB interface * this SAMBA will load. Increment this if *ANY* changes are made to the interface. * Changed interface to fix int -> size_t problems. JRA. + * There's no point in allocating arrays in + * samr_lookup_rids twice. It was done in the srv_samr_nt.c code as well as in + * the pdb module. Remove the latter, this might happen more often. VL. */ -#define PASSDB_INTERFACE_VERSION 11 +#define PASSDB_INTERFACE_VERSION 12 typedef struct pdb_context { -- cgit From 05ac2de0df78d22ad5afb42ea5c72ba17bef8395 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 3 Dec 2005 18:34:13 +0000 Subject: r12051: Merge across the lookup_name and lookup_sid work. Lets see how the build farm reacts :-) Volker (This used to be commit 9f99d04a54588cd9d1a1ab163ebb304437f932f7) --- source3/include/passdb.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 0589b9a7cd..20ea7021d0 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -376,6 +376,13 @@ typedef struct pdb_context const char **pp_names, uint32 *attrs); + NTSTATUS (*pdb_lookup_names)(struct pdb_context *context, + const DOM_SID *domain_sid, + size_t num_names, + const char **names, + uint32 *rids, + uint32 *attrs); + NTSTATUS (*pdb_get_account_policy)(struct pdb_context *context, int policy_index, uint32 *value); @@ -499,6 +506,13 @@ typedef struct pdb_methods const char **pp_names, uint32 *attrs); + NTSTATUS (*lookup_names)(struct pdb_methods *methods, + const DOM_SID *domain_sid, + int num_names, + const char **pp_names, + uint32 *rids, + uint32 *attrs); + NTSTATUS (*get_account_policy)(struct pdb_methods *methods, int policy_index, uint32 *value); -- cgit From efbbd89000604e8f75521954b94ebc4dd008cd52 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 3 Dec 2005 20:28:18 +0000 Subject: r12055: More cruft (This used to be commit 4d91f9501cd041ee42410eeace6a9acd9cc57d1c) --- source3/include/passdb.h | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 20ea7021d0..f1896710dc 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -200,29 +200,6 @@ typedef struct sam_passwd { } SAM_ACCOUNT; -typedef struct sam_group { - TALLOC_CTX *mem_ctx; - - void (*free_fn)(struct sam_group **); - - struct pdb_methods *methods; - - struct group_data { - /* initialization flags */ - struct bitmap *change_flags; - struct bitmap *set_flags; - - const char *name; /* Windows group name string */ - - DOM_SID sid; /* Group SID */ - enum SID_NAME_USE sid_name_use; /* Group type */ - - uint32 mem_num; /* Number of member SIDs */ - DOM_SID *members; /* SID array */ - } private_g; - -} SAM_GROUP; - struct acct_info { fstring acct_name; /* account name */ fstring acct_desc; /* account name */ -- cgit From 0af1500fc0bafe61019f1b2ab1d9e1d369221240 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 3 Feb 2006 22:19:41 +0000 Subject: r13316: Let the carnage begin.... Sync with trunk as off r13315 (This used to be commit 17e63ac4ed8325c0d44fe62b2442449f3298559f) --- source3/include/passdb.h | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index f1896710dc..0035fc5b05 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -304,9 +304,10 @@ typedef struct pdb_context size_t *p_num_members); NTSTATUS (*pdb_enum_group_memberships)(struct pdb_context *context, - const char *username, - gid_t primary_gid, - DOM_SID **pp_sids, gid_t **pp_gids, + TALLOC_CTX *mem_ctx, + SAM_ACCOUNT *user, + DOM_SID **pp_sids, + gid_t **pp_gids, size_t *p_num_groups); NTSTATUS (*pdb_find_alias)(struct pdb_context *context, @@ -376,6 +377,15 @@ typedef struct pdb_context BOOL (*pdb_search_aliases)(struct pdb_context *context, struct pdb_search *search, const DOM_SID *sid); + BOOL (*pdb_uid_to_rid)(struct pdb_context *context, + uid_t uid, uint32 *rid); + BOOL (*pdb_gid_to_sid)(struct pdb_context *context, + uid_t gid, DOM_SID *sid); + BOOL (*pdb_sid_to_id)(struct pdb_context *context, const DOM_SID *sid, + union unid_t *id, enum SID_NAME_USE *type); + + BOOL (*pdb_rid_algorithm)(struct pdb_context *context); + BOOL (*pdb_new_rid)(struct pdb_context *context, uint32 *rid); void (*free_fn)(struct pdb_context **); @@ -439,8 +449,8 @@ typedef struct pdb_methods size_t *p_num_members); NTSTATUS (*enum_group_memberships)(struct pdb_methods *methods, - const char *username, - gid_t primary_gid, + TALLOC_CTX *mem_ctx, + SAM_ACCOUNT *user, DOM_SID **pp_sids, gid_t **pp_gids, size_t *p_num_groups); @@ -507,6 +517,16 @@ typedef struct pdb_methods struct pdb_search *search, const DOM_SID *sid); + BOOL (*uid_to_rid)(struct pdb_methods *methods, uid_t uid, + uint32 *rid); + BOOL (*gid_to_sid)(struct pdb_methods *methods, gid_t gid, + DOM_SID *sid); + BOOL (*sid_to_id)(struct pdb_methods *methods, const DOM_SID *sid, + union unid_t *id, enum SID_NAME_USE *type); + + BOOL (*rid_algorithm)(struct pdb_methods *methods); + BOOL (*new_rid)(struct pdb_methods *methods, uint32 *rid); + void *private_data; /* Private data of some kind */ void (*free_private_data)(void **); -- cgit From 75ef18fa7510d894ccc4540d82616110c3166db3 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Sat, 11 Feb 2006 21:27:08 +0000 Subject: r13460: by popular demand.... * remove pdb_context data structure * set default group for DOMAIN_RID_GUEST user as RID 513 (just like Windows) * Allow RID 513 to resolve to always resolve to a name * Remove auto mapping of guest account primary group given the previous 2 changes (This used to be commit 7a2da5f0cc05c1920c664c9a690a23bdf854e285) --- source3/include/passdb.h | 160 ++--------------------------------------------- 1 file changed, 5 insertions(+), 155 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 0035fc5b05..35f377ad86 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -249,158 +249,9 @@ struct pdb_search { #define PASSDB_INTERFACE_VERSION 12 -typedef struct pdb_context -{ - 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 */ - - NTSTATUS (*pdb_setsampwent)(struct pdb_context *, BOOL update, uint16 acb_mask); - - void (*pdb_endsampwent)(struct pdb_context *); - - NTSTATUS (*pdb_getsampwent)(struct pdb_context *, SAM_ACCOUNT *user); - - NTSTATUS (*pdb_getsampwnam)(struct pdb_context *, SAM_ACCOUNT *sam_acct, const char *username); - - NTSTATUS (*pdb_getsampwsid)(struct pdb_context *, SAM_ACCOUNT *sam_acct, const DOM_SID *sid); - - NTSTATUS (*pdb_add_sam_account)(struct pdb_context *, SAM_ACCOUNT *sampass); - - NTSTATUS (*pdb_update_sam_account)(struct pdb_context *, SAM_ACCOUNT *sampass); - - NTSTATUS (*pdb_delete_sam_account)(struct pdb_context *, SAM_ACCOUNT *username); - - NTSTATUS (*pdb_rename_sam_account)(struct pdb_context *, SAM_ACCOUNT *oldname, const char *newname); - - NTSTATUS (*pdb_update_login_attempts)(struct pdb_context *context, SAM_ACCOUNT *sam_acct, BOOL success); - - NTSTATUS (*pdb_getgrsid)(struct pdb_context *context, GROUP_MAP *map, DOM_SID sid); - - NTSTATUS (*pdb_getgrgid)(struct pdb_context *context, GROUP_MAP *map, gid_t gid); - - NTSTATUS (*pdb_getgrnam)(struct pdb_context *context, GROUP_MAP *map, const char *name); - - NTSTATUS (*pdb_add_group_mapping_entry)(struct pdb_context *context, - GROUP_MAP *map); - - NTSTATUS (*pdb_update_group_mapping_entry)(struct pdb_context *context, - GROUP_MAP *map); - - NTSTATUS (*pdb_delete_group_mapping_entry)(struct pdb_context *context, - DOM_SID sid); - - NTSTATUS (*pdb_enum_group_mapping)(struct pdb_context *context, - enum SID_NAME_USE sid_name_use, - GROUP_MAP **pp_rmap, size_t *p_num_entries, - BOOL unix_only); - - NTSTATUS (*pdb_enum_group_members)(struct pdb_context *context, - TALLOC_CTX *mem_ctx, - const DOM_SID *group, - uint32 **pp_member_rids, - size_t *p_num_members); - - NTSTATUS (*pdb_enum_group_memberships)(struct pdb_context *context, - TALLOC_CTX *mem_ctx, - SAM_ACCOUNT *user, - DOM_SID **pp_sids, - gid_t **pp_gids, - size_t *p_num_groups); - - NTSTATUS (*pdb_find_alias)(struct pdb_context *context, - const char *name, DOM_SID *sid); - - NTSTATUS (*pdb_create_alias)(struct pdb_context *context, - const char *name, uint32 *rid); - - NTSTATUS (*pdb_delete_alias)(struct pdb_context *context, - const DOM_SID *sid); - - NTSTATUS (*pdb_get_aliasinfo)(struct pdb_context *context, - const DOM_SID *sid, - struct acct_info *info); - - NTSTATUS (*pdb_set_aliasinfo)(struct pdb_context *context, - const DOM_SID *sid, - struct acct_info *info); - - NTSTATUS (*pdb_add_aliasmem)(struct pdb_context *context, - const DOM_SID *alias, - const DOM_SID *member); - - NTSTATUS (*pdb_del_aliasmem)(struct pdb_context *context, - const DOM_SID *alias, - const DOM_SID *member); - - NTSTATUS (*pdb_enum_aliasmem)(struct pdb_context *context, - const DOM_SID *alias, - DOM_SID **pp_members, size_t *p_num_members); - - NTSTATUS (*pdb_enum_alias_memberships)(struct pdb_context *context, - TALLOC_CTX *mem_ctx, - const DOM_SID *domain_sid, - const DOM_SID *members, - size_t num_members, - uint32 **pp_alias_rids, - size_t *p_num_alias_rids); - - NTSTATUS (*pdb_lookup_rids)(struct pdb_context *context, - const DOM_SID *domain_sid, - size_t num_rids, - uint32 *rids, - const char **pp_names, - uint32 *attrs); - - NTSTATUS (*pdb_lookup_names)(struct pdb_context *context, - const DOM_SID *domain_sid, - size_t num_names, - const char **names, - uint32 *rids, - uint32 *attrs); - - NTSTATUS (*pdb_get_account_policy)(struct pdb_context *context, - int policy_index, uint32 *value); - - NTSTATUS (*pdb_set_account_policy)(struct pdb_context *context, - int policy_index, uint32 value); - - NTSTATUS (*pdb_get_seq_num)(struct pdb_context *context, time_t *seq_num); - - BOOL (*pdb_search_users)(struct pdb_context *context, - struct pdb_search *search, - uint16 acct_flags); - BOOL (*pdb_search_groups)(struct pdb_context *context, - struct pdb_search *search); - BOOL (*pdb_search_aliases)(struct pdb_context *context, - struct pdb_search *search, - const DOM_SID *sid); - BOOL (*pdb_uid_to_rid)(struct pdb_context *context, - uid_t uid, uint32 *rid); - BOOL (*pdb_gid_to_sid)(struct pdb_context *context, - uid_t gid, DOM_SID *sid); - BOOL (*pdb_sid_to_id)(struct pdb_context *context, const DOM_SID *sid, - union unid_t *id, enum SID_NAME_USE *type); - - BOOL (*pdb_rid_algorithm)(struct pdb_context *context); - BOOL (*pdb_new_rid)(struct pdb_context *context, uint32 *rid); - - void (*free_fn)(struct pdb_context **); - - TALLOC_CTX *mem_ctx; - -} PDB_CONTEXT; - -typedef struct pdb_methods +struct pdb_methods { const char *name; /* What name got this module */ - struct pdb_context *parent; - - /* Use macros from dlinklist.h on these two */ - struct pdb_methods *next; - struct pdb_methods *prev; NTSTATUS (*setsampwent)(struct pdb_methods *, BOOL update, uint16 acb_mask); @@ -530,17 +381,16 @@ typedef struct pdb_methods void *private_data; /* Private data of some kind */ void (*free_private_data)(void **); +}; -} PDB_METHODS; - -typedef NTSTATUS (*pdb_init_function)(struct pdb_context *, - struct pdb_methods **, - const char *); +typedef NTSTATUS (*pdb_init_function)(struct pdb_methods **, const char *); struct pdb_init_function_entry { const char *name; + /* Function to create a member of the pdb_methods list */ pdb_init_function init; + struct pdb_init_function_entry *prev, *next; }; -- cgit From 301d51e13a1aa4e633e2da161b0dd260a8a499cd Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 13 Feb 2006 17:08:25 +0000 Subject: r13494: Merge the stuff I've done in head the last days. Volker (This used to be commit bb40e544de68f01a6e774753f508e69373b39899) --- source3/include/passdb.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 35f377ad86..1f3c8cb28b 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -262,6 +262,13 @@ struct pdb_methods NTSTATUS (*getsampwnam)(struct pdb_methods *, SAM_ACCOUNT *sam_acct, const char *username); NTSTATUS (*getsampwsid)(struct pdb_methods *, SAM_ACCOUNT *sam_acct, const DOM_SID *sid); + + NTSTATUS (*create_user)(struct pdb_methods *, TALLOC_CTX *tmp_ctx, + const char *name, uint32 acct_flags, + uint32 *rid); + + NTSTATUS (*delete_user)(struct pdb_methods *, TALLOC_CTX *tmp_ctx, + SAM_ACCOUNT *sam_acct); NTSTATUS (*add_sam_account)(struct pdb_methods *, SAM_ACCOUNT *sampass); @@ -279,6 +286,13 @@ struct pdb_methods NTSTATUS (*getgrnam)(struct pdb_methods *methods, GROUP_MAP *map, const char *name); + NTSTATUS (*create_dom_group)(struct pdb_methods *methods, + TALLOC_CTX *mem_ctx, const char *name, + uint32 *rid); + + NTSTATUS (*delete_dom_group)(struct pdb_methods *methods, + TALLOC_CTX *mem_ctx, uint32 rid); + NTSTATUS (*add_group_mapping_entry)(struct pdb_methods *methods, GROUP_MAP *map); @@ -305,6 +319,18 @@ struct pdb_methods DOM_SID **pp_sids, gid_t **pp_gids, size_t *p_num_groups); + NTSTATUS (*set_unix_primary_group)(struct pdb_methods *methods, + TALLOC_CTX *mem_ctx, + SAM_ACCOUNT *user); + + NTSTATUS (*add_groupmem)(struct pdb_methods *methods, + TALLOC_CTX *mem_ctx, + uint32 group_rid, uint32 member_rid); + + NTSTATUS (*del_groupmem)(struct pdb_methods *methods, + TALLOC_CTX *mem_ctx, + uint32 group_rid, uint32 member_rid); + NTSTATUS (*find_alias)(struct pdb_methods *methods, const char *name, DOM_SID *sid); -- cgit From 04af2ab06ec40ffb0cf533d862a884813957dcf3 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 15 Feb 2006 18:21:13 +0000 Subject: r13509: remove unnecessary sql flags (This used to be commit c3702e804a74276ee53eb73f2d9b1fa9d3874b48) --- source3/include/passdb.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 1f3c8cb28b..79ba391867 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -420,6 +420,4 @@ struct pdb_init_function_entry { struct pdb_init_function_entry *prev, *next; }; -enum sql_search_field { SQL_SEARCH_NONE = 0, SQL_SEARCH_USER_SID = 1, SQL_SEARCH_USER_NAME = 2}; - #endif /* _PASSDB_H */ -- cgit From 2203bed32c84c63737f402accf73452efb76b483 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Mon, 20 Feb 2006 20:09:36 +0000 Subject: r13576: This is the beginnings of moving the SAM_ACCOUNT data structure to make full use of the new talloc() interface. Discussed with Volker and Jeremy. * remove the internal mem_ctx and simply use the talloc() structure as the context. * replace the internal free_fn() with a talloc_destructor() function * remove the unnecessary private nested structure * rename SAM_ACCOUNT to 'struct samu' to indicate the current an upcoming changes. Groups will most likely be replaced with a 'struct samg' in the future. Note that there are now passbd API changes. And for the most part, the wrapper functions remain the same. While this code has been tested on tdb and ldap based Samba PDC's as well as Samba member servers, there are probably still some bugs. The code also needs more testing under valgrind to ensure it's not leaking memory. But it's a start...... (This used to be commit 19b7593972480540283c5bf02c02e5ecd8d2c3f0) --- source3/include/passdb.h | 128 ++++++++++++++++++++++------------------------- 1 file changed, 60 insertions(+), 68 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 79ba391867..68165ca3d5 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -62,7 +62,7 @@ #define ACCT_OWF_PWD 0x20000000 /* - * bit flags representing initialized fields in SAM_ACCOUNT + * bit flags representing initialized fields in struct samu */ enum pdb_elements { PDB_UNINIT, @@ -135,70 +135,62 @@ typedef struct logon_cache_struct { time_t bad_password_time; } LOGIN_CACHE; -typedef struct sam_passwd { - TALLOC_CTX *mem_ctx; - - void (*free_fn)(struct sam_passwd **); - +struct samu { struct pdb_methods *methods; - struct user_data { - /* initialization flags */ - struct bitmap *change_flags; - struct bitmap *set_flags; - - time_t logon_time; /* logon time */ - time_t logoff_time; /* logoff time */ - time_t kickoff_time; /* kickoff time */ - time_t bad_password_time; /* last bad password entered */ - time_t pass_last_set_time; /* password last set time */ - time_t pass_can_change_time; /* password can change time */ - time_t pass_must_change_time; /* password must change time */ + /* initialization flags */ + struct bitmap *change_flags; + struct bitmap *set_flags; + + time_t logon_time; /* logon time */ + time_t logoff_time; /* logoff time */ + time_t kickoff_time; /* kickoff time */ + time_t bad_password_time; /* last bad password entered */ + time_t pass_last_set_time; /* password last set time */ + time_t pass_can_change_time; /* password can change time */ + time_t pass_must_change_time; /* password must change time */ - const char * username; /* UNIX username string */ - const char * domain; /* Windows Domain name */ - const char * nt_username; /* Windows username string */ - const char * full_name; /* user's full name string */ - const char * unix_home_dir; /* UNIX home directory string */ - const char * home_dir; /* home directory string */ - const char * dir_drive; /* home directory drive string */ - const char * logon_script; /* logon script string */ - const char * profile_path; /* profile path string */ - const char * acct_desc; /* user description string */ - const char * workstations; /* login from workstations string */ - const char * unknown_str; /* don't know what this is, yet. */ - const char * munged_dial; /* munged path name and dial-back tel number */ + const char *username; /* UNIX username string */ + const char *domain; /* Windows Domain name */ + const char *nt_username; /* Windows username string */ + const char *full_name; /* user's full name string */ + const char *unix_home_dir; /* UNIX home directory string */ + const char *home_dir; /* home directory string */ + const char *dir_drive; /* home directory drive string */ + const char *logon_script; /* logon script string */ + const char *profile_path; /* profile path string */ + const char *acct_desc; /* user description string */ + const char *workstations; /* login from workstations string */ + const char *unknown_str; /* don't know what this is, yet. */ + const char *munged_dial; /* munged path name and dial-back tel number */ - DOM_SID user_sid; /* Primary User SID */ - DOM_SID group_sid; /* Primary Group SID */ + DOM_SID user_sid; /* Primary User SID */ + DOM_SID group_sid; /* Primary Group SID */ - DATA_BLOB lm_pw; /* .data is Null if no password */ - DATA_BLOB nt_pw; /* .data is Null if no password */ - DATA_BLOB nt_pw_his; /* nt hashed password history .data is Null if not available */ - char* plaintext_pw; /* is Null if not available */ + DATA_BLOB lm_pw; /* .data is Null if no password */ + DATA_BLOB nt_pw; /* .data is Null if no password */ + DATA_BLOB nt_pw_his; /* nt hashed password history .data is Null if not available */ + char* plaintext_pw; /* is Null if not available */ - uint16 acct_ctrl; /* account info (ACB_xxxx bit-mask) */ - uint32 fields_present; /* 0x00ff ffff */ + uint16 acct_ctrl; /* account info (ACB_xxxx bit-mask) */ + uint32 fields_present; /* 0x00ff ffff */ - uint16 logon_divs; /* 168 - number of hours in a week */ - uint32 hours_len; /* normally 21 bytes */ - uint8 hours[MAX_HOURS_LEN]; - - /* Was unknown_5. */ - uint16 bad_password_count; - uint16 logon_count; - - uint32 unknown_6; /* 0x0000 04ec */ - /* a tag for who added the private methods */ - const struct pdb_methods *backend_private_methods; - void *backend_private_data; - void (*backend_private_data_free_fn)(void **); - } private_u; - - /* Lets see if the remaining code can get the hint that you - are meant to use the pdb_...() functions. */ + uint16 logon_divs; /* 168 - number of hours in a week */ + uint32 hours_len; /* normally 21 bytes */ + uint8 hours[MAX_HOURS_LEN]; -} SAM_ACCOUNT; + /* Was unknown_5. */ + uint16 bad_password_count; + uint16 logon_count; + + uint32 unknown_6; /* 0x0000 04ec */ + + /* a tag for who added the private methods */ + const struct pdb_methods *backend_private_methods; + void *backend_private_data; + void (*backend_private_data_free_fn)(void **); + +}; struct acct_info { fstring acct_name; /* account name */ @@ -257,28 +249,28 @@ struct pdb_methods void (*endsampwent)(struct pdb_methods *); - NTSTATUS (*getsampwent)(struct pdb_methods *, SAM_ACCOUNT *user); + NTSTATUS (*getsampwent)(struct pdb_methods *, struct samu *user); - NTSTATUS (*getsampwnam)(struct pdb_methods *, SAM_ACCOUNT *sam_acct, const char *username); + NTSTATUS (*getsampwnam)(struct pdb_methods *, struct samu *sam_acct, const char *username); - NTSTATUS (*getsampwsid)(struct pdb_methods *, SAM_ACCOUNT *sam_acct, const DOM_SID *sid); + NTSTATUS (*getsampwsid)(struct pdb_methods *, struct samu *sam_acct, const DOM_SID *sid); NTSTATUS (*create_user)(struct pdb_methods *, TALLOC_CTX *tmp_ctx, const char *name, uint32 acct_flags, uint32 *rid); NTSTATUS (*delete_user)(struct pdb_methods *, TALLOC_CTX *tmp_ctx, - SAM_ACCOUNT *sam_acct); + struct samu *sam_acct); - NTSTATUS (*add_sam_account)(struct pdb_methods *, SAM_ACCOUNT *sampass); + NTSTATUS (*add_sam_account)(struct pdb_methods *, struct samu *sampass); - NTSTATUS (*update_sam_account)(struct pdb_methods *, SAM_ACCOUNT *sampass); + NTSTATUS (*update_sam_account)(struct pdb_methods *, struct samu *sampass); - NTSTATUS (*delete_sam_account)(struct pdb_methods *, SAM_ACCOUNT *username); + NTSTATUS (*delete_sam_account)(struct pdb_methods *, struct samu *username); - NTSTATUS (*rename_sam_account)(struct pdb_methods *, SAM_ACCOUNT *oldname, const char *newname); + NTSTATUS (*rename_sam_account)(struct pdb_methods *, struct samu *oldname, const char *newname); - NTSTATUS (*update_login_attempts)(struct pdb_methods *methods, SAM_ACCOUNT *sam_acct, BOOL success); + NTSTATUS (*update_login_attempts)(struct pdb_methods *methods, struct samu *sam_acct, BOOL success); NTSTATUS (*getgrsid)(struct pdb_methods *methods, GROUP_MAP *map, DOM_SID sid); @@ -315,13 +307,13 @@ struct pdb_methods NTSTATUS (*enum_group_memberships)(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, - SAM_ACCOUNT *user, + struct samu *user, DOM_SID **pp_sids, gid_t **pp_gids, size_t *p_num_groups); NTSTATUS (*set_unix_primary_group)(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, - SAM_ACCOUNT *user); + struct samu *user); NTSTATUS (*add_groupmem)(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, -- cgit From 6622ba566ed3cc3ac362c4e257d7c8ed3c437a8a Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 21 Feb 2006 19:22:49 +0000 Subject: r13601: * Remove unused code from pdb_ldap.c * Add a 'struct passwd *' to the struct samu for later reference (I know this may be controversial but its easily reverted which is is why I'm checking this is as a seaparate patch before I get too deep). * Remove unix_homedir from struct samu {} and update the pdb wrapper functions associated with it. (This used to be commit 92c251fdf0f1f566cfeca3c75ba2284b644aef5d) --- source3/include/passdb.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 68165ca3d5..3c1e9bb5b7 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -154,7 +154,6 @@ struct samu { const char *domain; /* Windows Domain name */ const char *nt_username; /* Windows username string */ const char *full_name; /* user's full name string */ - const char *unix_home_dir; /* UNIX home directory string */ const char *home_dir; /* home directory string */ const char *dir_drive; /* home directory drive string */ const char *logon_script; /* logon script string */ @@ -189,7 +188,10 @@ struct samu { const struct pdb_methods *backend_private_methods; void *backend_private_data; void (*backend_private_data_free_fn)(void **); + + /* maintain a copy of the user's struct passwd */ + struct passwd *unix_pw; }; struct acct_info { -- cgit From d95e13e68f3c7ac517a45877b351849ef4a99b93 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 24 Feb 2006 21:36:40 +0000 Subject: r13679: Commiting the rm_primary_group.patch posted on samba-technical * ignore the primary group SID attribute from struct samu* * generate the primary group SID strictlky from the Unix primary group when dealing with passdb users * Fix memory leak in original patch caused by failing to free a talloc * * add wrapper around samu_set_unix() to prevent exposing the create BOOL to callers. Wrappers are samu_set_unix() and samu-allic_rid_unix() (This used to be commit bcf269e2ec6630b78d909010fabd3b69dd6dda84) --- source3/include/passdb.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 3c1e9bb5b7..0e64653fe6 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -163,8 +163,8 @@ struct samu { const char *unknown_str; /* don't know what this is, yet. */ const char *munged_dial; /* munged path name and dial-back tel number */ - DOM_SID user_sid; /* Primary User SID */ - DOM_SID group_sid; /* Primary Group SID */ + DOM_SID user_sid; + DOM_SID *group_sid; DATA_BLOB lm_pw; /* .data is Null if no password */ DATA_BLOB nt_pw; /* .data is Null if no password */ @@ -185,6 +185,7 @@ struct samu { uint32 unknown_6; /* 0x0000 04ec */ /* a tag for who added the private methods */ + const struct pdb_methods *backend_private_methods; void *backend_private_data; void (*backend_private_data_free_fn)(void **); -- cgit From e54786b53543b4667288c64abb55478fddd95061 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 27 Feb 2006 10:32:45 +0000 Subject: r13711: * Correctly handle acb_info/acct_flags as uint32 not as uint16. * Fix a couple of related parsing issues. * in the info3 reply in a samlogon, return the ACB-flags (instead of returning zero) Guenther (This used to be commit 5b89e8bc24f0fdc8b52d5c9e849aba723df34ea7) --- source3/include/passdb.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 0e64653fe6..a9688c6f81 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -130,7 +130,7 @@ enum pdb_value_state { /* cache for bad password lockout data, to be used on replicated SAMs */ typedef struct logon_cache_struct { time_t entry_timestamp; - uint16 acct_ctrl; + uint32 acct_ctrl; uint16 bad_password_count; time_t bad_password_time; } LOGIN_CACHE; @@ -171,7 +171,7 @@ struct samu { DATA_BLOB nt_pw_his; /* nt hashed password history .data is Null if not available */ char* plaintext_pw; /* is Null if not available */ - uint16 acct_ctrl; /* account info (ACB_xxxx bit-mask) */ + uint32 acct_ctrl; /* account info (ACB_xxxx bit-mask) */ uint32 fields_present; /* 0x00ff ffff */ uint16 logon_divs; /* 168 - number of hours in a week */ @@ -204,7 +204,7 @@ struct acct_info { struct samr_displayentry { uint32 idx; uint32 rid; - uint16 acct_flags; + uint32 acct_flags; const char *account_name; const char *fullname; const char *description; @@ -248,7 +248,7 @@ struct pdb_methods { const char *name; /* What name got this module */ - NTSTATUS (*setsampwent)(struct pdb_methods *, BOOL update, uint16 acb_mask); + NTSTATUS (*setsampwent)(struct pdb_methods *, BOOL update, uint32 acb_mask); void (*endsampwent)(struct pdb_methods *); @@ -382,7 +382,7 @@ struct pdb_methods BOOL (*search_users)(struct pdb_methods *methods, struct pdb_search *search, - uint16 acct_flags); + uint32 acct_flags); BOOL (*search_groups)(struct pdb_methods *methods, struct pdb_search *search); BOOL (*search_aliases)(struct pdb_methods *methods, -- cgit From 0ce53f8ba5110381ad6f910abe581a69019135b8 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 15 Mar 2006 00:10:38 +0000 Subject: r14403: * modifies create_local_nt_token() to create a BUILTIN\Administrators group IFF sid_to_gid(S-1-5-32-544) fails and 'winbind nested groups = yes' * Add a SID domain to the group mapping enumeration passdb call to fix the checks for local and builtin groups. The SID can be NULL if you want the old semantics for internal maintenance. I only updated the tdb group mapping code. * remove any group mapping from the tdb that have a gid of -1 for better consistency with pdb_ldap.c. The fixes the problem with calling add_group_map() in the tdb code for unmapped groups which might have had a record present. * Ensure that we distinguish between groups in the BUILTIN and local machine domains via getgrnam() Other wise BUILTIN\Administrators & SERVER\Administrators would resolve to the same gid. * Doesn't strip the global_sam_name() from groups in the local machine's domain (this is required to work with 'winbind default domain' code) Still todo. * Fix fallback Administrators membership for root and domain Admins if nested groups = no or winbindd is not running * issues with "su - user -c 'groups'" command * There are a few outstanding issues with BUILTIN\Users that Windows apparently tends to assume. I worked around this presently with a manual group mapping but I do not think this is a good solution. So I'll probably add some similar as I did for Administrators. (This used to be commit 612979476aef62e8e8eef632fa6be7d30282bb83) --- source3/include/passdb.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index a9688c6f81..432976412d 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -242,7 +242,7 @@ struct pdb_search { * the pdb module. Remove the latter, this might happen more often. VL. */ -#define PASSDB_INTERFACE_VERSION 12 +#define PASSDB_INTERFACE_VERSION 13 struct pdb_methods { @@ -298,7 +298,7 @@ struct pdb_methods DOM_SID sid); NTSTATUS (*enum_group_mapping)(struct pdb_methods *methods, - enum SID_NAME_USE sid_name_use, + const DOM_SID *sid, enum SID_NAME_USE sid_name_use, GROUP_MAP **pp_rmap, size_t *p_num_entries, BOOL unix_only); -- cgit From 6c94466d7b0976925e031f815e72c59612ebab43 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 28 Jun 2006 17:56:10 +0000 Subject: r16628: Fix bug #3880, reported by jason@ncac.gwu.edu by ensuring we return the correct enum for sid type, not a uint32. Jeremy. (This used to be commit 98a5e20ff4ceacda65dcc0ce5498ed4ffde520f8) --- source3/include/passdb.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 432976412d..74063d0fff 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -240,9 +240,11 @@ struct pdb_search { * There's no point in allocating arrays in * samr_lookup_rids twice. It was done in the srv_samr_nt.c code as well as in * the pdb module. Remove the latter, this might happen more often. VL. + * changed to version 14 to move lookup_rids and lookup_names to return + * enum SID_NAME_USE rather than uint32. */ -#define PASSDB_INTERFACE_VERSION 13 +#define PASSDB_INTERFACE_VERSION 14 struct pdb_methods { @@ -363,14 +365,14 @@ struct pdb_methods int num_rids, uint32 *rids, const char **pp_names, - uint32 *attrs); + enum SID_NAME_USE *attrs); NTSTATUS (*lookup_names)(struct pdb_methods *methods, const DOM_SID *domain_sid, int num_names, const char **pp_names, uint32 *rids, - uint32 *attrs); + enum SID_NAME_USE *attrs); NTSTATUS (*get_account_policy)(struct pdb_methods *methods, int policy_index, uint32 *value); -- cgit From fbdcf2663b56007a438ac4f0d8d82436b1bfe688 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 11 Jul 2006 18:01:26 +0000 Subject: r16945: Sync trunk -> 3.0 for 3.0.24 code. Still need to do the upper layer directories but this is what everyone is waiting for.... Jeremy. (This used to be commit 9dafb7f48ca3e7af956b0a7d1720c2546fc4cfb8) --- source3/include/passdb.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 74063d0fff..35bb93aa31 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -34,8 +34,8 @@ #define ACCT_FULL_NAME 0x00000002 #define ACCT_RID 0x00000004 #define ACCT_PRIMARY_GID 0x00000008 -#define ACCT_ADMIN_DESC 0x00000010 -#define ACCT_DESCRIPTION 0x00000020 +#define ACCT_DESCRIPTION 0x00000010 +#define ACCT_COMMENT 0x00000020 #define ACCT_HOME_DIR 0x00000040 #define ACCT_HOME_DRIVE 0x00000080 #define ACCT_LOGON_SCRIPT 0x00000100 @@ -90,7 +90,7 @@ enum pdb_elements { PDB_UNIXHOMEDIR, PDB_ACCTDESC, PDB_WORKSTATIONS, - PDB_UNKNOWNSTR, + PDB_COMMENT, PDB_MUNGEDDIAL, PDB_HOURS, PDB_FIELDS_PRESENT, @@ -160,7 +160,7 @@ struct samu { const char *profile_path; /* profile path string */ const char *acct_desc; /* user description string */ const char *workstations; /* login from workstations string */ - const char *unknown_str; /* don't know what this is, yet. */ + const char *comment; const char *munged_dial; /* munged path name and dial-back tel number */ DOM_SID user_sid; -- cgit From ff7c0a7c357ab8a0ff9de6d18988933e0b398780 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 8 Aug 2006 08:26:40 +0000 Subject: r17451: Change pdb_getgrsid not to take a DOM_SID but a const DOM_SID * as an argument. Volker (This used to be commit 873a5a1211d185fd50e7167d88cbc869f70dfd3f) --- source3/include/passdb.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 35bb93aa31..fa3a3bdb3d 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -244,7 +244,7 @@ struct pdb_search { * enum SID_NAME_USE rather than uint32. */ -#define PASSDB_INTERFACE_VERSION 14 +#define PASSDB_INTERFACE_VERSION 15 struct pdb_methods { @@ -277,7 +277,8 @@ struct pdb_methods NTSTATUS (*update_login_attempts)(struct pdb_methods *methods, struct samu *sam_acct, BOOL success); - NTSTATUS (*getgrsid)(struct pdb_methods *methods, GROUP_MAP *map, DOM_SID sid); + NTSTATUS (*getgrsid)(struct pdb_methods *methods, GROUP_MAP *map, + const DOM_SID *sid); NTSTATUS (*getgrgid)(struct pdb_methods *methods, GROUP_MAP *map, gid_t gid); -- cgit From e1e62d89999629d41cc2b66b12eb37ce190d5db0 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 8 Aug 2006 19:29:34 +0000 Subject: r17463: A bit of cleanup work: Remove some unused code: pdb_find_alias is not used anymore, and nobody I think has ever used the pdb_nop operations for group mapping. smbpasswd and tdb use the default ones and ldap has its own. Make the functions pdb_getgr* return NTSTATUS instead of BOOL. Nobody right now really makes use of it, but it feels wrong to throw away information so early. Volker (This used to be commit f9856f6490fe44fdba97ea86062237d8c74d4bdc) --- source3/include/passdb.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index fa3a3bdb3d..d8d0a54c3c 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -329,9 +329,6 @@ struct pdb_methods TALLOC_CTX *mem_ctx, uint32 group_rid, uint32 member_rid); - NTSTATUS (*find_alias)(struct pdb_methods *methods, - const char *name, DOM_SID *sid); - NTSTATUS (*create_alias)(struct pdb_methods *methods, const char *name, uint32 *rid); -- cgit From 03e3cd1d5a005ad5fd2bc97f9863abf675efd09f Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 15 Aug 2006 14:07:15 +0000 Subject: r17554: Cleanup (This used to be commit 761cbd52f0cff6b864c506ec03c94039b6101ef9) --- source3/include/passdb.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index d8d0a54c3c..35bb93aa31 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -244,7 +244,7 @@ struct pdb_search { * enum SID_NAME_USE rather than uint32. */ -#define PASSDB_INTERFACE_VERSION 15 +#define PASSDB_INTERFACE_VERSION 14 struct pdb_methods { @@ -277,8 +277,7 @@ struct pdb_methods NTSTATUS (*update_login_attempts)(struct pdb_methods *methods, struct samu *sam_acct, BOOL success); - NTSTATUS (*getgrsid)(struct pdb_methods *methods, GROUP_MAP *map, - const DOM_SID *sid); + NTSTATUS (*getgrsid)(struct pdb_methods *methods, GROUP_MAP *map, DOM_SID sid); NTSTATUS (*getgrgid)(struct pdb_methods *methods, GROUP_MAP *map, gid_t gid); @@ -329,6 +328,9 @@ struct pdb_methods TALLOC_CTX *mem_ctx, uint32 group_rid, uint32 member_rid); + NTSTATUS (*find_alias)(struct pdb_methods *methods, + const char *name, DOM_SID *sid); + NTSTATUS (*create_alias)(struct pdb_methods *methods, const char *name, uint32 *rid); -- cgit From 2b27c93a9a8471693d7dcb5fdbe8afe65b22ff66 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 8 Sep 2006 14:28:06 +0000 Subject: r18271: Big change: * autogenerate lsa ndr code * rename 'enum SID_NAME_USE' to 'enum lsa_SidType' * merge a log more security descriptor functions from gen_ndr/ndr_security.c in SAMBA_4_0 The most embarassing thing is the "#define strlen_m strlen" We need a real implementation in SAMBA_3_0 which I'll work on after this code is in. (This used to be commit 3da9f80c28b1e75ef6d46d38fbb81ade6b9fa951) --- source3/include/passdb.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 35bb93aa31..9dc6d60eb0 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -241,7 +241,7 @@ struct pdb_search { * samr_lookup_rids twice. It was done in the srv_samr_nt.c code as well as in * the pdb module. Remove the latter, this might happen more often. VL. * changed to version 14 to move lookup_rids and lookup_names to return - * enum SID_NAME_USE rather than uint32. + * enum lsa_SidType rather than uint32. */ #define PASSDB_INTERFACE_VERSION 14 @@ -300,7 +300,7 @@ struct pdb_methods DOM_SID sid); NTSTATUS (*enum_group_mapping)(struct pdb_methods *methods, - const DOM_SID *sid, enum SID_NAME_USE sid_name_use, + const DOM_SID *sid, enum lsa_SidType sid_name_use, GROUP_MAP **pp_rmap, size_t *p_num_entries, BOOL unix_only); @@ -365,14 +365,14 @@ struct pdb_methods int num_rids, uint32 *rids, const char **pp_names, - enum SID_NAME_USE *attrs); + enum lsa_SidType *attrs); NTSTATUS (*lookup_names)(struct pdb_methods *methods, const DOM_SID *domain_sid, int num_names, const char **pp_names, uint32 *rids, - enum SID_NAME_USE *attrs); + enum lsa_SidType *attrs); NTSTATUS (*get_account_policy)(struct pdb_methods *methods, int policy_index, uint32 *value); @@ -396,7 +396,7 @@ struct pdb_methods BOOL (*gid_to_sid)(struct pdb_methods *methods, gid_t gid, DOM_SID *sid); BOOL (*sid_to_id)(struct pdb_methods *methods, const DOM_SID *sid, - union unid_t *id, enum SID_NAME_USE *type); + union unid_t *id, enum lsa_SidType *type); BOOL (*rid_algorithm)(struct pdb_methods *methods); BOOL (*new_rid)(struct pdb_methods *methods, uint32 *rid); -- cgit From 4225f9a4bd5eece4d57820bbabb7b882610aa7cc Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 12 Dec 2006 14:52:13 +0000 Subject: r20116: Start merging in the work done to create the new idmap subsystem. Simo. (This used to be commit 50cd8bffeeed2cac755f75fc3d76fe41c451976b) --- source3/include/passdb.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 9dc6d60eb0..092904ab60 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -393,6 +393,8 @@ struct pdb_methods BOOL (*uid_to_rid)(struct pdb_methods *methods, uid_t uid, uint32 *rid); + BOOL (*uid_to_sid)(struct pdb_methods *methods, uid_t uid, + DOM_SID *sid); BOOL (*gid_to_sid)(struct pdb_methods *methods, gid_t gid, DOM_SID *sid); BOOL (*sid_to_id)(struct pdb_methods *methods, const DOM_SID *sid, -- cgit From b906886e9e9739877fef4c381c46a9a9d61859ba Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 16 Jan 2007 08:17:26 +0000 Subject: r20824: Send access to the trusted domain passwords through the pdb backend, so that in the next step we can store them in LDAP to be replicated across DCs. Thanks to Michael Adam Volker (This used to be commit 3c879745cfc39be6128b63a88ecdbfa3d9ce6c2d) --- source3/include/passdb.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 092904ab60..d5abb7ad55 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -403,6 +403,19 @@ struct pdb_methods BOOL (*rid_algorithm)(struct pdb_methods *methods); BOOL (*new_rid)(struct pdb_methods *methods, uint32 *rid); + + BOOL (*get_trusteddom_pw)(struct pdb_methods *methods, + const char *domain, char** pwd, + DOM_SID *sid, time_t *pass_last_set_time); + BOOL (*set_trusteddom_pw)(struct pdb_methods *methods, + const char* domain, const char* pwd, + const DOM_SID *sid); + BOOL (*del_trusteddom_pw)(struct pdb_methods *methods, + const char *domain); + NTSTATUS (*enum_trusteddoms)(struct pdb_methods *methods, + TALLOC_CTX *mem_ctx, uint32 *num_domains, + struct trustdom_info ***domains); + void *private_data; /* Private data of some kind */ void (*free_private_data)(void **); -- cgit From 58160aa0eb63f88401ea29f0358684dc104e1506 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 16 Jan 2007 10:59:17 +0000 Subject: r20827: Increment the interface version. Wilco: Existing modules should continue to work, they just must be recompiled. Volker (This used to be commit f5babdce9b79ba6abed5d6f57daecc0ed1e14e15) --- source3/include/passdb.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index d5abb7ad55..05a3a72876 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -242,9 +242,10 @@ struct pdb_search { * the pdb module. Remove the latter, this might happen more often. VL. * changed to version 14 to move lookup_rids and lookup_names to return * enum lsa_SidType rather than uint32. + * Version 15 for the trusted domain password hooks */ -#define PASSDB_INTERFACE_VERSION 14 +#define PASSDB_INTERFACE_VERSION 15 struct pdb_methods { -- cgit From c04068a42b230541559939004f33d72f1e76f075 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 6 Feb 2007 21:00:51 +0000 Subject: r21188: bumping passdb version number to make sure this is different than the 3.0.25 branch (This used to be commit b10f4cdfc0767dbd88f29f42fa5a8d9a9c1959a2) --- source3/include/passdb.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 05a3a72876..cd80cd9fab 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -242,10 +242,9 @@ struct pdb_search { * the pdb module. Remove the latter, this might happen more often. VL. * changed to version 14 to move lookup_rids and lookup_names to return * enum lsa_SidType rather than uint32. - * Version 15 for the trusted domain password hooks */ -#define PASSDB_INTERFACE_VERSION 15 +#define PASSDB_INTERFACE_VERSION 16 struct pdb_methods { -- cgit From 9e30a76c04d0da0bc14f7a0605db7ad51e5cfcd9 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 11 May 2007 08:46:54 +0000 Subject: r22786: Some cleanup by Karolin Seeger: Remove unused pdb_find_alias, and change return values of some alias-releated pdb functions from BOOL to NTSTATUS Thanks :-) (This used to be commit 590d2164b3a33250410338771e160f6ebd1aa89d) --- source3/include/passdb.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index cd80cd9fab..3604458b5a 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -328,9 +328,6 @@ struct pdb_methods TALLOC_CTX *mem_ctx, uint32 group_rid, uint32 member_rid); - NTSTATUS (*find_alias)(struct pdb_methods *methods, - const char *name, DOM_SID *sid); - NTSTATUS (*create_alias)(struct pdb_methods *methods, const char *name, uint32 *rid); -- cgit From feb4e7fe4d2c5517261360f24384ceb712559d01 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 4 Jun 2007 19:03:33 +0000 Subject: r23341: pdb interfaces should be versioned. As SAMBA_3_0 and SAMBA_3_0_26 are now identical, use the same version number (16) for both. Jeremy. (This used to be commit f2ac311ed408e1f17f468945b34289d4c6b915cc) --- source3/include/passdb.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 3604458b5a..c3af0f4f11 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -242,6 +242,7 @@ struct pdb_search { * the pdb module. Remove the latter, this might happen more often. VL. * changed to version 14 to move lookup_rids and lookup_names to return * enum lsa_SidType rather than uint32. + * Changed to 16 for access to the trusted domain passwords (obnox). */ #define PASSDB_INTERFACE_VERSION 16 -- cgit From d824b98f80ba186030cbb70b3a1e5daf80469ecd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 9 Jul 2007 19:25:36 +0000 Subject: r23779: Change from v2 or later to v3 or later. Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3) --- source3/include/passdb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index c3af0f4f11..effbd605ce 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -8,7 +8,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, -- cgit From 5e54558c6dea67b56bbfaba5698f3a434d3dffb6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 00:52:41 +0000 Subject: r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text (This used to be commit b0132e94fc5fef936aa766fb99a306b3628e9f07) --- source3/include/passdb.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index effbd605ce..60e8a63f90 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -17,8 +17,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #ifndef _PASSDB_H -- cgit From 30191d1a5704ad2b158386b511558972d539ce47 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 18 Oct 2007 17:40:25 -0700 Subject: RIP BOOL. Convert BOOL -> bool. I found a few interesting bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f) --- source3/include/passdb.h | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 60e8a63f90..bb8a336b8c 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -221,9 +221,9 @@ struct pdb_search { struct samr_displayentry *cache; uint32 num_entries; ssize_t cache_size; - BOOL search_ended; + bool search_ended; void *private_data; - BOOL (*next_entry)(struct pdb_search *search, + bool (*next_entry)(struct pdb_search *search, struct samr_displayentry *entry); void (*search_end)(struct pdb_search *search); }; @@ -250,7 +250,7 @@ struct pdb_methods { const char *name; /* What name got this module */ - NTSTATUS (*setsampwent)(struct pdb_methods *, BOOL update, uint32 acb_mask); + NTSTATUS (*setsampwent)(struct pdb_methods *, bool update, uint32 acb_mask); void (*endsampwent)(struct pdb_methods *); @@ -275,7 +275,7 @@ struct pdb_methods NTSTATUS (*rename_sam_account)(struct pdb_methods *, struct samu *oldname, const char *newname); - NTSTATUS (*update_login_attempts)(struct pdb_methods *methods, struct samu *sam_acct, BOOL success); + NTSTATUS (*update_login_attempts)(struct pdb_methods *methods, struct samu *sam_acct, bool success); NTSTATUS (*getgrsid)(struct pdb_methods *methods, GROUP_MAP *map, DOM_SID sid); @@ -302,7 +302,7 @@ struct pdb_methods NTSTATUS (*enum_group_mapping)(struct pdb_methods *methods, const DOM_SID *sid, enum lsa_SidType sid_name_use, GROUP_MAP **pp_rmap, size_t *p_num_entries, - BOOL unix_only); + bool unix_only); NTSTATUS (*enum_group_members)(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, @@ -379,35 +379,35 @@ struct pdb_methods NTSTATUS (*get_seq_num)(struct pdb_methods *methods, time_t *seq_num); - BOOL (*search_users)(struct pdb_methods *methods, + bool (*search_users)(struct pdb_methods *methods, struct pdb_search *search, uint32 acct_flags); - BOOL (*search_groups)(struct pdb_methods *methods, + bool (*search_groups)(struct pdb_methods *methods, struct pdb_search *search); - BOOL (*search_aliases)(struct pdb_methods *methods, + bool (*search_aliases)(struct pdb_methods *methods, struct pdb_search *search, const DOM_SID *sid); - BOOL (*uid_to_rid)(struct pdb_methods *methods, uid_t uid, + bool (*uid_to_rid)(struct pdb_methods *methods, uid_t uid, uint32 *rid); - BOOL (*uid_to_sid)(struct pdb_methods *methods, uid_t uid, + bool (*uid_to_sid)(struct pdb_methods *methods, uid_t uid, DOM_SID *sid); - BOOL (*gid_to_sid)(struct pdb_methods *methods, gid_t gid, + bool (*gid_to_sid)(struct pdb_methods *methods, gid_t gid, DOM_SID *sid); - BOOL (*sid_to_id)(struct pdb_methods *methods, const DOM_SID *sid, + bool (*sid_to_id)(struct pdb_methods *methods, const DOM_SID *sid, union unid_t *id, enum lsa_SidType *type); - BOOL (*rid_algorithm)(struct pdb_methods *methods); - BOOL (*new_rid)(struct pdb_methods *methods, uint32 *rid); + bool (*rid_algorithm)(struct pdb_methods *methods); + bool (*new_rid)(struct pdb_methods *methods, uint32 *rid); - BOOL (*get_trusteddom_pw)(struct pdb_methods *methods, + bool (*get_trusteddom_pw)(struct pdb_methods *methods, const char *domain, char** pwd, DOM_SID *sid, time_t *pass_last_set_time); - BOOL (*set_trusteddom_pw)(struct pdb_methods *methods, + bool (*set_trusteddom_pw)(struct pdb_methods *methods, const char* domain, const char* pwd, const DOM_SID *sid); - BOOL (*del_trusteddom_pw)(struct pdb_methods *methods, + bool (*del_trusteddom_pw)(struct pdb_methods *methods, const char *domain); NTSTATUS (*enum_trusteddoms)(struct pdb_methods *methods, TALLOC_CTX *mem_ctx, uint32 *num_domains, -- cgit From e70c97ef85b309d6e005c07e16a003725d21ffc8 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 26 Dec 2007 17:58:55 +0100 Subject: Remove the sampwent interface (This used to be commit 9e80b969fb40766de2c9b1a05d16bf4d4c6e46f7) --- source3/include/passdb.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index bb8a336b8c..b72ec6b0ba 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -242,20 +242,15 @@ struct pdb_search { * changed to version 14 to move lookup_rids and lookup_names to return * enum lsa_SidType rather than uint32. * Changed to 16 for access to the trusted domain passwords (obnox). + * Changed to 17, the sampwent interface is gone. */ -#define PASSDB_INTERFACE_VERSION 16 +#define PASSDB_INTERFACE_VERSION 17 struct pdb_methods { const char *name; /* What name got this module */ - NTSTATUS (*setsampwent)(struct pdb_methods *, bool update, uint32 acb_mask); - - void (*endsampwent)(struct pdb_methods *); - - NTSTATUS (*getsampwent)(struct pdb_methods *, struct samu *user); - NTSTATUS (*getsampwnam)(struct pdb_methods *, struct samu *sam_acct, const char *username); NTSTATUS (*getsampwsid)(struct pdb_methods *, struct samu *sam_acct, const DOM_SID *sid); -- cgit From 90631dd2c27db6480ddfaec5746c84579ec684be Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 12 Feb 2008 00:07:41 +0100 Subject: Removing unused ACCT_-flags. Guenther (This used to be commit d1e5a5a7f9dfb5756398e99cf09a4712d2b42682) --- source3/include/passdb.h | 33 +++------------------------------ 1 file changed, 3 insertions(+), 30 deletions(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index b72ec6b0ba..8d5934df52 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -25,40 +25,13 @@ /* - * fields_present flags meanings - * same names as found in samba4 idl files + * in samba4 idl + * ACCT_NT_PWD_SET == SAMR_FIELD_PASSWORD and + * ACCT_LM_PWD_SET == SAMR_FIELD_PASSWORD2 */ -#define ACCT_USERNAME 0x00000001 -#define ACCT_FULL_NAME 0x00000002 -#define ACCT_RID 0x00000004 -#define ACCT_PRIMARY_GID 0x00000008 -#define ACCT_DESCRIPTION 0x00000010 -#define ACCT_COMMENT 0x00000020 -#define ACCT_HOME_DIR 0x00000040 -#define ACCT_HOME_DRIVE 0x00000080 -#define ACCT_LOGON_SCRIPT 0x00000100 -#define ACCT_PROFILE 0x00000200 -#define ACCT_WORKSTATIONS 0x00000400 -#define ACCT_LAST_LOGON 0x00000800 -#define ACCT_LAST_LOGOFF 0x00001000 -#define ACCT_LOGON_HOURS 0x00002000 -#define ACCT_BAD_PWD_COUNT 0x00004000 -#define ACCT_NUM_LOGONS 0x00008000 -#define ACCT_ALLOW_PWD_CHANGE 0x00010000 -#define ACCT_FORCE_PWD_CHANGE 0x00020000 -#define ACCT_LAST_PWD_CHANGE 0x00040000 -#define ACCT_EXPIRY 0x00080000 -#define ACCT_FLAGS 0x00100000 -#define ACCT_CALLBACK 0x00200000 -#define ACCT_COUNTRY_CODE 0x00400000 -#define ACCT_CODE_PAGE 0x00800000 #define ACCT_NT_PWD_SET 0x01000000 #define ACCT_LM_PWD_SET 0x02000000 -#define ACCT_PRIVATEDATA 0x04000000 -#define ACCT_EXPIRED_FLAG 0x08000000 -#define ACCT_SEC_DESC 0x10000000 -#define ACCT_OWF_PWD 0x20000000 /* * bit flags representing initialized fields in struct samu -- cgit From 2b3d03d6f16e4110d0000cbb10a087cef2ce9e44 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 29 Apr 2008 13:23:47 +0200 Subject: Remove unix_homedir from struct user_struct This makes pdb_get_unix_homedir unused. I wonder if that was ever really used... (This used to be commit 36bfd32f1ff878e827db91e9bf233719ecca5b01) --- source3/include/passdb.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include/passdb.h') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 8d5934df52..360a0d0444 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -59,7 +59,6 @@ enum pdb_elements { PDB_GROUPSID, PDB_ACCTCTRL, PDB_PASSLASTSET, - PDB_UNIXHOMEDIR, PDB_ACCTDESC, PDB_WORKSTATIONS, PDB_COMMENT, -- cgit