summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2002-11-02 03:47:48 +0000
committerAndrew Bartlett <abartlet@samba.org>2002-11-02 03:47:48 +0000
commit6d7195d1d79c43f5ccc8dc4a9215c02177d5fa89 (patch)
treebd5e6a9c83f8fa55c98750ce555c66f0c109f569 /source3/include
parentaea57af3e38873e808afc3c742ba46527f686f6f (diff)
downloadsamba-6d7195d1d79c43f5ccc8dc4a9215c02177d5fa89.tar.gz
samba-6d7195d1d79c43f5ccc8dc4a9215c02177d5fa89.tar.bz2
samba-6d7195d1d79c43f5ccc8dc4a9215c02177d5fa89.zip
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)
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/mapping.h1
-rw-r--r--source3/include/passdb.h48
-rw-r--r--source3/include/smb.h71
3 files changed, 101 insertions, 19 deletions
diff --git a/source3/include/mapping.h b/source3/include/mapping.h
index 5ef5c19dd2..d2fb89d1de 100644
--- a/source3/include/mapping.h
+++ b/source3/include/mapping.h
@@ -43,6 +43,7 @@
typedef struct _GROUP_MAP {
+ struct pdb_methods *methods;
gid_t gid;
DOM_SID sid;
enum SID_NAME_USE sid_name_use;
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 **);
diff --git a/source3/include/smb.h b/source3/include/smb.h
index 1ef69c5fc9..dfa41eaa3e 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -569,25 +569,59 @@ typedef struct {
/*
* bit flags representing initialized fields in SAM_ACCOUNT
*/
-#define FLAG_SAM_UNINIT 0x00000000
-#define FLAG_SAM_UID 0x00000001
-#define FLAG_SAM_GID 0x00000002
-#define FLAG_SAM_SMBHOME 0x00000004
-#define FLAG_SAM_PROFILE 0x00000008
-#define FLAG_SAM_DRIVE 0x00000010
-#define FLAG_SAM_LOGONSCRIPT 0x00000020
-#define FLAG_SAM_LOGONTIME 0x00000040
-#define FLAG_SAM_LOGOFFTIME 0x00000080
-#define FLAG_SAM_KICKOFFTIME 0x00000100
-#define FLAG_SAM_CANCHANGETIME 0x00000200
-#define FLAG_SAM_MUSTCHANGETIME 0x00000400
-#define FLAG_SAM_PLAINTEXT_PW 0x00000800
+enum pdb_elements {
+ PDB_UNINIT,
+ PDB_UID,
+ PDB_GID,
+ 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_value_state {
+ PDB_DEFAULT=0,
+ PDB_SET,
+ PDB_CHANGED
+};
#define IS_SAM_UNIX_USER(x) \
- ((pdb_get_init_flag(x) & FLAG_SAM_UID) \
- && (pdb_get_init_flag(x) & FLAG_SAM_GID))
+ (( pdb_get_init_flags(x, PDB_UID) != PDB_DEFAULT ) \
+ && ( pdb_get_init_flags(x,PDB_GID) != PDB_DEFAULT ))
-#define IS_SAM_SET(x, flag) ((x)->private.init_flag & (flag))
+#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
{
@@ -599,8 +633,9 @@ typedef struct sam_passwd
struct user_data {
/* initiailization flags */
- uint32 init_flag;
-
+ 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 */