From a5cc68290e018fcdc077ca143ae508191b952ff0 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sun, 4 May 2003 23:41:51 +0000 Subject: move some things around (This used to be commit a4fc9c3b2dfbdbb3f75bf38415741ff66dbe1367) --- source3/include/includes.h | 3 + source3/include/mapping.h | 1 - source3/include/passdb.h | 197 ++++++++++++++++++++++++++++++++++++++------- source3/include/smb.h | 108 +------------------------ 4 files changed, 171 insertions(+), 138 deletions(-) (limited to 'source3') diff --git a/source3/include/includes.h b/source3/include/includes.h index 9f86f08c1e..a54c302738 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -767,8 +767,11 @@ extern int errno; #include "debugparse.h" #include "version.h" + #include "smb.h" + #include "smbw.h" + #include "nameserv.h" #include "secrets.h" diff --git a/source3/include/mapping.h b/source3/include/mapping.h index d4f2d28e6a..0cb31aa040 100644 --- a/source3/include/mapping.h +++ b/source3/include/mapping.h @@ -43,7 +43,6 @@ 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 35399758b2..f27c1e159c 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 ****************************************************************/ @@ -58,28 +203,24 @@ 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_getsamgrnam)(struct pdb_context *context, SAM_GROUP *samgroup, char *name); - NTSTATUS (*pdb_getgrgid)(struct pdb_context *context, GROUP_MAP *map, - gid_t gid, BOOL with_priv); + NTSTATUS (*pdb_getsamgrsid)(struct pdb_context *context, SAM_GROUP *samgroup, DOM_SID *sid); - NTSTATUS (*pdb_getgrnam)(struct pdb_context *context, GROUP_MAP *map, - char *name, BOOL with_priv); + NTSTATUS (*pdb_add_sam_group)(struct pdb_context *context, SAM_GROUP *samgroup); - NTSTATUS (*pdb_add_group_mapping_entry)(struct pdb_context *context, - GROUP_MAP *map); + NTSTATUS (*pdb_update_sam_group)(struct pdb_context *context, SAM_GROUP *samgroup); - NTSTATUS (*pdb_update_group_mapping_entry)(struct pdb_context *context, - GROUP_MAP *map); + NTSTATUS (*pdb_delete_sam_group)(struct pdb_context *context, DOM_SID *sid); + + NTSTATUS (*pdb_add_sam_group_member)(struct pdb_context *context, DOM_SID *group_sid, DOM_SID *new_member_sid); - NTSTATUS (*pdb_delete_group_mapping_entry)(struct pdb_context *context, - DOM_SID sid); + NTSTATUS (*pdb_delete_sam_group_member)(struct pdb_context *context, DOM_SID *group_sid, DOM_SID *member_sid); - NTSTATUS (*pdb_enum_group_mapping)(struct pdb_context *context, + NTSTATUS (*pdb_enum_sam_groups)(struct pdb_context *context, enum SID_NAME_USE sid_name_use, - GROUP_MAP **rmap, int *num_entries, - BOOL unix_only, BOOL with_priv); + SAM_GROUP **groups, int *num_entries, + BOOL unix_only); void (*free_fn)(struct pdb_context **); @@ -112,27 +253,23 @@ 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 (*getsamgrnam)(struct pdb_methods *methods, SAM_GROUP *samgroup, char *name); - NTSTATUS (*getgrnam)(struct pdb_methods *methods, GROUP_MAP *map, - char *name, BOOL with_priv); + NTSTATUS (*getsamgrsid)(struct pdb_methods *methods, SAM_GROUP *samgroup, DOM_SID *sid); - NTSTATUS (*add_group_mapping_entry)(struct pdb_methods *methods, - GROUP_MAP *map); + NTSTATUS (*add_sam_group)(struct pdb_methods *methods, SAM_GROUP *samgroup); - NTSTATUS (*update_group_mapping_entry)(struct pdb_methods *methods, - GROUP_MAP *map); + NTSTATUS (*update_sam_group)(struct pdb_methods *methods, SAM_GROUP *samgroup); - NTSTATUS (*delete_group_mapping_entry)(struct pdb_methods *methods, - DOM_SID sid); + NTSTATUS (*delete_sam_group)(struct pdb_methods *methods, DOM_SID sid); - NTSTATUS (*enum_group_mapping)(struct pdb_methods *methods, + NTSTATUS (*add_sam_group_member)(struct pdb_methods *methods, DOM_SID *group_sid, DOM_SID *new_member_sid); + + NTSTATUS (*delete_sam_group_member)(struct pdb_methods *methods, DOM_SID *group_sid, DOM_SID *member_sid); + + NTSTATUS (*enum_sam_groups)(struct pdb_methods *methods, enum SID_NAME_USE sid_name_use, - GROUP_MAP **rmap, int *num_entries, + SAM_GROUP **groups, int *num_entries, BOOL unix_only, BOOL with_priv); void *private_data; /* Private data of some kind */ diff --git a/source3/include/smb.h b/source3/include/smb.h index a4df0e2697..c7a771b4da 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -585,113 +585,7 @@ typedef struct { #define NT_HASH_LEN 16 #define LM_HASH_LEN 16 -/* - * 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_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; +#include "passdb.h" /* * Flags for account policy. -- cgit From 4b8d28f8320ebf8d9ee1105e36c95ad0e3a4579c Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Mon, 5 May 2003 01:52:08 +0000 Subject: AIX doesn't append $SHLIB_EXT to NSS libraries. Also merged a little bit of abartlet's recent configure.in change of duplicated IRIX stuff. (This used to be commit d15406ad910bc952c741e8d4d574064dbc5e88ef) --- source3/Makefile.in | 4 ++-- source3/configure.in | 15 +++++---------- 2 files changed, 7 insertions(+), 12 deletions(-) (limited to 'source3') diff --git a/source3/Makefile.in b/source3/Makefile.in index 5e28f6eb4f..985bdad08f 100644 --- a/source3/Makefile.in +++ b/source3/Makefile.in @@ -657,7 +657,7 @@ smbfilter : SHOWFLAGS bin/smbfilter@EXEEXT@ talloctort : SHOWFLAGS bin/talloctort@EXEEXT@ -nsswitch : SHOWFLAGS bin/winbindd@EXEEXT@ bin/wbinfo@EXEEXT@ nsswitch/@WINBIND_NSS@.@SHLIBEXT@ nsswitch/pam_winbind.@SHLIBEXT@ +nsswitch : SHOWFLAGS bin/winbindd@EXEEXT@ bin/wbinfo@EXEEXT@ nsswitch/@WINBIND_NSS@ nsswitch/pam_winbind.@SHLIBEXT@ wins : SHOWFLAGS nsswitch/libnss_wins.@SHLIBEXT@ @@ -979,7 +979,7 @@ bin/winbindd@EXEEXT@: $(WINBINDD_OBJ) @BUILD_POPT@ bin/.dummy @$(LINK) -o $@ $(WINBINDD_OBJ) $(DYNEXP) $(LIBS) @POPTLIBS@ $(ADSLIBS) \ @LDAP_LIBS@ -nsswitch/@WINBIND_NSS@.@SHLIBEXT@: $(WINBIND_NSS_PICOBJS) +nsswitch/@WINBIND_NSS@: $(WINBIND_NSS_PICOBJS) @echo "Linking $@" @$(SHLD) $(WINBIND_NSS_LDSHFLAGS) -o $@ $(WINBIND_NSS_PICOBJS) \ @WINBIND_NSS_EXTRA_LIBS@ @SONAMEFLAG@`basename $@` diff --git a/source3/configure.in b/source3/configure.in index cd3b2cedcc..77d160e4cb 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -3212,7 +3212,7 @@ HAVE_WINBIND=yes # Define the winbind shared library name and any specific linker flags # it needs to be built with. -WINBIND_NSS=libnss_winbind +WINBIND_NSS=libnss_winbind.$SHLIBEXT WINBIND_NSS_LDSHFLAGS=$LDSHFLAGS case "$host_os" in @@ -3221,7 +3221,7 @@ case "$host_os" in ;; *irix*) WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_irix.o" - WINBIND_NSS="libns_winbind" + WINBIND_NSS="libns_winbind.$SHLIBEXT" ;; *solaris*) # Solaris winbind client is implemented as a wrapper around @@ -3236,6 +3236,7 @@ case "$host_os" in *aix*) WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_aix.o" WINBIND_NSS_LDSHFLAGS="-Wl,-bexpall,-bM:SRE,-ewb_aix_init" + WINBIND_NSS="WINBIND" ;; *) HAVE_WINBIND=no @@ -3282,14 +3283,8 @@ if test x"$HAVE_WINBIND" = x"yes"; then EXTRA_BIN_PROGS="$EXTRA_BIN_PROGS bin/wbinfo\$(EXEEXT)" EXTRA_SBIN_PROGS="$EXTRA_SBIN_PROGS bin/winbindd\$(EXEEXT)" if test x"$BLDSHARED" = x"true"; then - case "$host_os" in - *irix*) - SHLIB_PROGS="$SHLIB_PROGS nsswitch/libns_winbind.$SHLIBEXT" - ;; - *) - SHLIB_PROGS="$SHLIB_PROGS nsswitch/libnss_winbind.$SHLIBEXT" - ;; - esac + SHLIB_PROGS="$SHLIB_PROGS nsswitch/$WINBIND_NSS" + if test x"$with_pam" = x"yes"; then SHLIB_PROGS="$SHLIB_PROGS nsswitch/pam_winbind.$SHLIBEXT" fi -- cgit From c724747e2d282cc63cbaca355c2e169ef393904e Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Mon, 5 May 2003 03:34:19 +0000 Subject: Fixed typo introduced when reverting patch from revision 1.19 (This used to be commit a102734263a2cbd5b9eafbddf036e173b507a7fd) --- source3/lib/snprintf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3') diff --git a/source3/lib/snprintf.c b/source3/lib/snprintf.c index 588e9cf6cb..02cf782520 100644 --- a/source3/lib/snprintf.c +++ b/source3/lib/snprintf.c @@ -820,7 +820,7 @@ static void dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c) * these should really be smb_snprintf to avoid conflicts with buggy * linkers? -- mbp */ -#if !defined(HAVE_SNPRINTF) || !defined(HAVE_C99_SNPRINTF) +#if !defined(HAVE_SNPRINTF) || !defined(HAVE_C99_VSNPRINTF) int snprintf(char *str,size_t count,const char *fmt,...) { size_t ret; -- cgit From ddb870f36ba6d7c982239ecd663f70853e10a85b Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Mon, 5 May 2003 04:09:56 +0000 Subject: A good reason to use make variables instead of autoconf substitutions directly - fixed problem where the last line of the link command was '\ @LDAP_LIBS@'. If @LDAP_LIBS@ is zero then the backslash incorrectly includes the next line of the Makefile in the current target. This should fix a bucketload of build farm failures. (This used to be commit 895bef1a62f60f4e91dc6b1c244820b024c36a5c) --- source3/Makefile.in | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3') diff --git a/source3/Makefile.in b/source3/Makefile.in index 985bdad08f..7f9c2a8b93 100644 --- a/source3/Makefile.in +++ b/source3/Makefile.in @@ -976,8 +976,7 @@ nsswitch/libnss_wins.@SHLIBEXT@: $(NSS_OBJ) bin/winbindd@EXEEXT@: $(WINBINDD_OBJ) @BUILD_POPT@ bin/.dummy @echo Linking $@ - @$(LINK) -o $@ $(WINBINDD_OBJ) $(DYNEXP) $(LIBS) @POPTLIBS@ $(ADSLIBS) \ - @LDAP_LIBS@ + @$(LINK) -o $@ $(WINBINDD_OBJ) $(DYNEXP) $(LIBS) @POPTLIBS@ $(ADSLIBS) @LDAP_LIBS@ nsswitch/@WINBIND_NSS@: $(WINBIND_NSS_PICOBJS) @echo "Linking $@" -- cgit From 4905d39f4f277418d3795303d4df2dad69015211 Mon Sep 17 00:00:00 2001 From: Rafal Szczesniak Date: Mon, 5 May 2003 08:43:43 +0000 Subject: Turn off using lsa_qos. Rafal (This used to be commit d03124fbf182f194e48c4ef9ae6aedc4db4f13b0) --- source3/utils/net_rpc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'source3') diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c index e3e79b0e6c..3f5a339948 100644 --- a/source3/utils/net_rpc.c +++ b/source3/utils/net_rpc.c @@ -1785,7 +1785,7 @@ static int rpc_trustdom_establish(int argc, const char **argv) return -1; } - nt_status = cli_lsa_open_policy2(cli, mem_ctx, True, SEC_RIGHTS_QUERY_VALUE, + nt_status = cli_lsa_open_policy2(cli, mem_ctx, False, SEC_RIGHTS_QUERY_VALUE, &connect_hnd); if (NT_STATUS_IS_ERR(nt_status)) { DEBUG(0, ("Couldn't open policy handle. Error was %s\n", @@ -1804,9 +1804,6 @@ static int rpc_trustdom_establish(int argc, const char **argv) return -1; } - - - /* There should be actually query info level 3 (following nt serv behaviour), but I still don't know if it's _really_ necessary */ @@ -1955,7 +1952,7 @@ static int rpc_trustdom_list(int argc, const char **argv) return -1; }; - nt_status = cli_lsa_open_policy2(cli, mem_ctx, True, SEC_RIGHTS_QUERY_VALUE, + nt_status = cli_lsa_open_policy2(cli, mem_ctx, False, SEC_RIGHTS_QUERY_VALUE, &connect_hnd); if (NT_STATUS_IS_ERR(nt_status)) { DEBUG(0, ("Couldn't open policy handle. Error was %s\n", -- cgit From 7835af32ec2f7a4a5db25db5c000d7c73540e41d Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 6 May 2003 09:36:51 +0000 Subject: restore structures from previous erroneous commit (This used to be commit 58d284bd06f5893a752c1f22828715f8bd130c82) --- source3/include/passdb.h | 52 ++++++++++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 22 deletions(-) (limited to 'source3') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index f27c1e159c..e14e250d34 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -203,24 +203,28 @@ typedef struct pdb_context NTSTATUS (*pdb_delete_sam_account)(struct pdb_context *, SAM_ACCOUNT *username); - NTSTATUS (*pdb_getsamgrnam)(struct pdb_context *context, SAM_GROUP *samgroup, char *name); + NTSTATUS (*pdb_getgrsid)(struct pdb_context *context, GROUP_MAP *map, + DOM_SID sid, BOOL with_priv); - NTSTATUS (*pdb_getsamgrsid)(struct pdb_context *context, SAM_GROUP *samgroup, DOM_SID *sid); + NTSTATUS (*pdb_getgrgid)(struct pdb_context *context, GROUP_MAP *map, + gid_t gid, BOOL with_priv); - NTSTATUS (*pdb_add_sam_group)(struct pdb_context *context, SAM_GROUP *samgroup); + NTSTATUS (*pdb_getgrnam)(struct pdb_context *context, GROUP_MAP *map, + char *name, BOOL with_priv); - NTSTATUS (*pdb_update_sam_group)(struct pdb_context *context, SAM_GROUP *samgroup); + NTSTATUS (*pdb_add_group_mapping_entry)(struct pdb_context *context, + GROUP_MAP *map); - NTSTATUS (*pdb_delete_sam_group)(struct pdb_context *context, DOM_SID *sid); - - NTSTATUS (*pdb_add_sam_group_member)(struct pdb_context *context, DOM_SID *group_sid, DOM_SID *new_member_sid); + NTSTATUS (*pdb_update_group_mapping_entry)(struct pdb_context *context, + GROUP_MAP *map); - NTSTATUS (*pdb_delete_sam_group_member)(struct pdb_context *context, DOM_SID *group_sid, DOM_SID *member_sid); + NTSTATUS (*pdb_delete_group_mapping_entry)(struct pdb_context *context, + DOM_SID sid); - NTSTATUS (*pdb_enum_sam_groups)(struct pdb_context *context, + NTSTATUS (*pdb_enum_group_mapping)(struct pdb_context *context, enum SID_NAME_USE sid_name_use, - SAM_GROUP **groups, int *num_entries, - BOOL unix_only); + GROUP_MAP **rmap, int *num_entries, + BOOL unix_only, BOOL with_priv); void (*free_fn)(struct pdb_context **); @@ -253,23 +257,27 @@ typedef struct pdb_methods NTSTATUS (*delete_sam_account)(struct pdb_methods *, SAM_ACCOUNT *username); - NTSTATUS (*getsamgrnam)(struct pdb_methods *methods, SAM_GROUP *samgroup, char *name); + NTSTATUS (*getgrsid)(struct pdb_methods *methods, GROUP_MAP *map, + DOM_SID sid, BOOL with_priv); - NTSTATUS (*getsamgrsid)(struct pdb_methods *methods, SAM_GROUP *samgroup, DOM_SID *sid); + NTSTATUS (*getgrgid)(struct pdb_methods *methods, GROUP_MAP *map, + gid_t gid, BOOL with_priv); - NTSTATUS (*add_sam_group)(struct pdb_methods *methods, SAM_GROUP *samgroup); + NTSTATUS (*getgrnam)(struct pdb_methods *methods, GROUP_MAP *map, + char *name, BOOL with_priv); - NTSTATUS (*update_sam_group)(struct pdb_methods *methods, SAM_GROUP *samgroup); + NTSTATUS (*add_group_mapping_entry)(struct pdb_methods *methods, + GROUP_MAP *map); - NTSTATUS (*delete_sam_group)(struct pdb_methods *methods, DOM_SID sid); + NTSTATUS (*update_group_mapping_entry)(struct pdb_methods *methods, + GROUP_MAP *map); - NTSTATUS (*add_sam_group_member)(struct pdb_methods *methods, DOM_SID *group_sid, DOM_SID *new_member_sid); - - NTSTATUS (*delete_sam_group_member)(struct pdb_methods *methods, DOM_SID *group_sid, DOM_SID *member_sid); - - NTSTATUS (*enum_sam_groups)(struct pdb_methods *methods, + 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, - SAM_GROUP **groups, int *num_entries, + GROUP_MAP **rmap, int *num_entries, BOOL unix_only, BOOL with_priv); void *private_data; /* Private data of some kind */ -- cgit From 0c6cdfadfda8e2fcb9b7766068670b7468db4c62 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 6 May 2003 10:00:02 +0000 Subject: add mapping.h here (This used to be commit fb03fafed14a2816808e98fd95850db3e655d5d9) --- source3/include/smb.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3') diff --git a/source3/include/smb.h b/source3/include/smb.h index c7a771b4da..92457bd647 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -585,6 +585,7 @@ typedef struct { #define NT_HASH_LEN 16 #define LM_HASH_LEN 16 +#include "mapping.h" #include "passdb.h" /* -- cgit From 9cd45eeaf96b67dd772a6b8e5ef6df7ea10dfd31 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 6 May 2003 13:10:10 +0000 Subject: sort out some include dependencies split out privileges from rpc_lsa.h (This used to be commit 37d7cc8162d02a664095dbe0fc8d7250d1ed51c9) --- source3/include/includes.h | 23 +++++++++++++++++----- source3/include/privileges.h | 45 ++++++++++++++++++++++++++++++++++++++++++++ source3/include/rpc_lsa.h | 20 -------------------- source3/include/smb.h | 10 ++-------- 4 files changed, 65 insertions(+), 33 deletions(-) create mode 100644 source3/include/privileges.h (limited to 'source3') diff --git a/source3/include/includes.h b/source3/include/includes.h index a54c302738..8fc09c2cae 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -769,8 +769,9 @@ extern int errno; #include "version.h" #include "smb.h" - +/* #include "smbw.h" +*/ #include "nameserv.h" @@ -778,14 +779,26 @@ extern int errno; #include "byteorder.h" +#include "privileges.h" + +#include "rpc_creds.h" + +#include "mapping.h" + +#include "passdb.h" + #include "ntdomain.h" +#include "rpc_misc.h" + +#include "rpc_secdes.h" + +#include "nt_printing.h" + #include "msdfs.h" #include "smbprofile.h" -#include "mapping.h" - #include "rap.h" #include "md5.h" @@ -795,14 +808,14 @@ extern int errno; #include "auth.h" -#include "passdb.h" - #include "sam.h" #include "gums.h" #include "idmap.h" +#include "client.h" +#include "smbw.h" #include "session.h" #include "asn_1.h" diff --git a/source3/include/privileges.h b/source3/include/privileges.h new file mode 100644 index 0000000000..404c5d246b --- /dev/null +++ b/source3/include/privileges.h @@ -0,0 +1,45 @@ +/* + Unix SMB/CIFS implementation. + SMB parameters and setup + Copyright (C) Andrew Tridgell 1992-1997 + Copyright (C) Luke Kenneth Casson Leighton 1996-1997 + Copyright (C) Paul Ashton 1997 + + 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 PRIVILEGES_H +#define PRIVILEGES_H + +typedef struct LUID +{ + uint32 low; + uint32 high; +} LUID; + +typedef struct LUID_ATTR +{ + LUID luid; + uint32 attr; +} LUID_ATTR ; + +typedef struct privilege_set +{ + uint32 count; + uint32 control; + LUID_ATTR *set; +} PRIVILEGE_SET; + +#endif /* _RPC_LSA_H */ diff --git a/source3/include/rpc_lsa.h b/source3/include/rpc_lsa.h index 8e1368810f..d4136a9fde 100644 --- a/source3/include/rpc_lsa.h +++ b/source3/include/rpc_lsa.h @@ -661,26 +661,6 @@ typedef struct lsa_q_enumprivsaccount POLICY_HND pol; /* policy handle */ } LSA_Q_ENUMPRIVSACCOUNT; - -typedef struct LUID -{ - uint32 low; - uint32 high; -} LUID; - -typedef struct LUID_ATTR -{ - LUID luid; - uint32 attr; -} LUID_ATTR ; - -typedef struct privilege_set -{ - uint32 count; - uint32 control; - LUID_ATTR *set; -} PRIVILEGE_SET; - typedef struct lsa_r_enumprivsaccount { uint32 ptr; diff --git a/source3/include/smb.h b/source3/include/smb.h index 92457bd647..2ca65ec275 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -585,9 +585,6 @@ typedef struct { #define NT_HASH_LEN 16 #define LM_HASH_LEN 16 -#include "mapping.h" -#include "passdb.h" - /* * Flags for account policy. */ @@ -1519,11 +1516,6 @@ struct pwd_info uchar sess_key[16]; }; -#include "rpc_creds.h" -#include "rpc_misc.h" -#include "rpc_secdes.h" -#include "nt_printing.h" - typedef struct user_struct { struct user_struct *next, *prev; @@ -1563,9 +1555,11 @@ struct unix_error_map { NTSTATUS nt_error; }; +/* #include "ntdomain.h" #include "client.h" +*/ /* * Size of new password account encoding string. This is enough space to -- cgit