The branch, master has been updated via 0ca8e22... s3-lanman: Fix api_RNetUserGetInfo level 2 marshalling offset calculation. via c5eeb0d... s3-auth: fix c++ buildwarnings. via 38d69ca... s3-build: remove duplicate ndr_krb5pac.h inclusion. via 6d19475... s3-build: use ndr_misc.h where needed. via 66adb84... s3-build: only use ndr_samr.h where needed. via 60079f5... s3-idl: fix some missing dependencies to other IDL files. via 30eeb1e... s3-rpc_client: move protos to init_netlogon.h from f888c82... s3:auth Add comment to clarify usage of session keys.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 0ca8e2252b14811b9221acc95a510ab6a84f580f Author: Günther Deschner <g...@samba.org> Date: Fri May 28 00:02:15 2010 +0200 s3-lanman: Fix api_RNetUserGetInfo level 2 marshalling offset calculation. 54 + 4 = 58 (and not 60). Found by torture test. Guenther commit c5eeb0d155bc49fe7ead2a601bdd1bffaa5b119c Author: Günther Deschner <g...@samba.org> Date: Fri May 28 02:47:12 2010 +0200 s3-auth: fix c++ buildwarnings. Guenther commit 38d69ca547d6eaead316d990dc140a8250cf64d2 Author: Günther Deschner <g...@samba.org> Date: Fri May 28 02:20:21 2010 +0200 s3-build: remove duplicate ndr_krb5pac.h inclusion. Guenther commit 6d194756e00c73672bbd43c9a5eb9efc93a84567 Author: Günther Deschner <g...@samba.org> Date: Fri May 28 02:20:02 2010 +0200 s3-build: use ndr_misc.h where needed. Guenther commit 66adb84e46489a94ea49fc70d93dfe90a601617c Author: Günther Deschner <g...@samba.org> Date: Fri May 28 02:18:21 2010 +0200 s3-build: only use ndr_samr.h where needed. Guenther commit 60079f59b09d5f05ac1f09b015ec9bd765269035 Author: Günther Deschner <g...@samba.org> Date: Fri May 28 02:16:38 2010 +0200 s3-idl: fix some missing dependencies to other IDL files. Guenther commit 30eeb1e3d90e93a52d81503d022218b7b6521071 Author: Günther Deschner <g...@samba.org> Date: Fri May 28 01:19:25 2010 +0200 s3-rpc_client: move protos to init_netlogon.h Guenther ----------------------------------------------------------------------- Summary of changes: source3/auth/server_info.c | 4 ++-- source3/include/proto.h | 32 ++++++++++++-------------------- source3/libads/kerberos.c | 1 + source3/librpc/idl/libnet_join.idl | 2 +- source3/librpc/idl/libnetapi.idl | 2 ++ source3/librpc/idl/secrets.idl | 2 ++ source3/librpc/idl/wbint.idl | 2 +- source3/libsmb/passchange.c | 1 + source3/rpc_client/cli_netlogon.c | 1 + source3/rpc_client/init_netlogon.c | 1 + source3/rpc_client/init_netlogon.h | 5 +++++ source3/rpc_server/srv_lsa_hnd.c | 1 + source3/rpcclient/cmd_test.c | 1 + source3/smbd/lanman.c | 32 ++++++++++++++++---------------- source3/utils/net_rpc_shell.c | 1 + 15 files changed, 48 insertions(+), 40 deletions(-) create mode 100644 source3/rpc_client/init_netlogon.h Changeset truncated at 500 lines: diff --git a/source3/auth/server_info.c b/source3/auth/server_info.c index 27f0487..2545e7d 100644 --- a/source3/auth/server_info.c +++ b/source3/auth/server_info.c @@ -431,7 +431,7 @@ struct netr_SamInfo3 *copy_netr_SamInfo3(TALLOC_CTX *mem_ctx, } if (orig->base.groups.count) { - info3->base.groups.rids = + info3->base.groups.rids = (struct samr_RidWithAttribute *) talloc_memdup(info3, orig->base.groups.rids, (sizeof(struct samr_RidWithAttribute) * orig->base.groups.count)); @@ -455,7 +455,7 @@ struct netr_SamInfo3 *copy_netr_SamInfo3(TALLOC_CTX *mem_ctx, } if (orig->sidcount) { - info3->sids = talloc_memdup(info3, orig->sids, + info3->sids = (struct netr_SidAttr *)talloc_memdup(info3, orig->sids, (sizeof(struct netr_SidAttr) * orig->sidcount)); RET_NOMEM(info3->sids); diff --git a/source3/include/proto.h b/source3/include/proto.h index 8c3f05e..cc14658 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -177,7 +177,18 @@ NTSTATUS auth_winbind_init(void); /* The following definitions come from auth/server_info.c */ struct auth_serversupplied_info *make_server_info(TALLOC_CTX *mem_ctx); - +NTSTATUS serverinfo_to_SamInfo2(struct auth_serversupplied_info *server_info, + uint8_t *pipe_session_key, + size_t pipe_session_key_len, + struct netr_SamInfo2 *sam2); +NTSTATUS serverinfo_to_SamInfo3(struct auth_serversupplied_info *server_info, + uint8_t *pipe_session_key, + size_t pipe_session_key_len, + struct netr_SamInfo3 *sam3); +NTSTATUS serverinfo_to_SamInfo6(struct auth_serversupplied_info *server_info, + uint8_t *pipe_session_key, + size_t pipe_session_key_len, + struct netr_SamInfo6 *sam6); NTSTATUS samu_to_SamInfo3(TALLOC_CTX *mem_ctx, struct samu *samu, const char *login_server, @@ -2014,7 +2025,6 @@ ADS_STATUS ads_change_trust_account_password(ADS_STRUCT *ads, char *host_princip ADS_STATUS ads_guess_service_principal(ADS_STRUCT *ads, char **returned_principal); -#include "librpc/gen_ndr/ndr_krb5pac.h" #include "librpc/gen_ndr/ndr_spoolss.h" /* The following definitions come from librpc/ndr/util.c */ @@ -5030,24 +5040,6 @@ void init_lsa_StringLarge(struct lsa_StringLarge *name, const char *s); void init_lsa_AsciiString(struct lsa_AsciiString *name, const char *s); void init_lsa_AsciiStringLarge(struct lsa_AsciiStringLarge *name, const char *s); -/* The following definitions come from rpc_client/init_netlogon.c */ - -NTSTATUS serverinfo_to_SamInfo2(struct auth_serversupplied_info *server_info, - uint8_t *pipe_session_key, - size_t pipe_session_key_len, - struct netr_SamInfo2 *sam2); -NTSTATUS serverinfo_to_SamInfo3(struct auth_serversupplied_info *server_info, - uint8_t *pipe_session_key, - size_t pipe_session_key_len, - struct netr_SamInfo3 *sam3); -NTSTATUS serverinfo_to_SamInfo6(struct auth_serversupplied_info *server_info, - uint8_t *pipe_session_key, - size_t pipe_session_key_len, - struct netr_SamInfo6 *sam6); -void init_netr_CryptPassword(const char *pwd, - unsigned char session_key[16], - struct netr_CryptPassword *pwd_buf); - /* The following definitions come from rpc_client/ndr.c */ struct tevent_req *cli_do_rpc_ndr_send(TALLOC_CTX *mem_ctx, diff --git a/source3/libads/kerberos.c b/source3/libads/kerberos.c index 9f58ee9..f34b9ca 100644 --- a/source3/libads/kerberos.c +++ b/source3/libads/kerberos.c @@ -23,6 +23,7 @@ #include "includes.h" #include "smb_krb5.h" +#include "../librpc/gen_ndr/ndr_misc.h" #ifdef HAVE_KRB5 diff --git a/source3/librpc/idl/libnet_join.idl b/source3/librpc/idl/libnet_join.idl index cb79393..9984e9e 100644 --- a/source3/librpc/idl/libnet_join.idl +++ b/source3/librpc/idl/libnet_join.idl @@ -1,6 +1,6 @@ #include "idl_types.h" -import "wkssvc.idl", "security.idl"; +import "wkssvc.idl", "security.idl", "misc.idl"; /* libnetjoin interface definition diff --git a/source3/librpc/idl/libnetapi.idl b/source3/librpc/idl/libnetapi.idl index 593ee1c..c57048d 100644 --- a/source3/librpc/idl/libnetapi.idl +++ b/source3/librpc/idl/libnetapi.idl @@ -7,6 +7,8 @@ cpp_quote("#ifndef MAXSUBAUTHS") cpp_quote("#define MAXSUBAUTHS 15 /* max sub authorities in a SID */") cpp_quote("#endif") +import "misc.idl"; + [ pointer_default(unique) ] diff --git a/source3/librpc/idl/secrets.idl b/source3/librpc/idl/secrets.idl index 929c9bc..b73f88b 100644 --- a/source3/librpc/idl/secrets.idl +++ b/source3/librpc/idl/secrets.idl @@ -1,5 +1,7 @@ #include "idl_types.h" +import "security.idl"; + /* IDL structures for secrets code */ diff --git a/source3/librpc/idl/wbint.idl b/source3/librpc/idl/wbint.idl index 2fd3e88..b2c8ff6 100644 --- a/source3/librpc/idl/wbint.idl +++ b/source3/librpc/idl/wbint.idl @@ -1,5 +1,5 @@ #include "idl_types.h" -import "lsa.idl", "netlogon.idl"; +import "lsa.idl", "netlogon.idl", "misc.idl", "security.idl"; [ uuid("bf09192c-ed60-4928-9dff-d0d7bcb03ed8"), diff --git a/source3/libsmb/passchange.c b/source3/libsmb/passchange.c index 4a81a21..88f1ca8 100644 --- a/source3/libsmb/passchange.c +++ b/source3/libsmb/passchange.c @@ -19,6 +19,7 @@ #include "includes.h" #include "rpc_client/cli_samr.h" +#include "../librpc/gen_ndr/ndr_samr.h" /************************************************************* Change a password on a remote machine using IPC calls. diff --git a/source3/rpc_client/cli_netlogon.c b/source3/rpc_client/cli_netlogon.c index 781fa05..28972c9 100644 --- a/source3/rpc_client/cli_netlogon.c +++ b/source3/rpc_client/cli_netlogon.c @@ -24,6 +24,7 @@ #include "../libcli/auth/libcli_auth.h" #include "../librpc/gen_ndr/cli_netlogon.h" #include "rpc_client/cli_netlogon.h" +#include "rpc_client/init_netlogon.h" /**************************************************************************** Wrapper function that uses the auth and auth2 calls to set up a NETLOGON diff --git a/source3/rpc_client/init_netlogon.c b/source3/rpc_client/init_netlogon.c index a172883..445108a 100644 --- a/source3/rpc_client/init_netlogon.c +++ b/source3/rpc_client/init_netlogon.c @@ -20,6 +20,7 @@ #include "includes.h" #include "../libcli/auth/libcli_auth.h" #include "../lib/crypto/arcfour.h" +#include "rpc_client/init_netlogon.h" /************************************************************************* inits a netr_CryptPassword structure diff --git a/source3/rpc_client/init_netlogon.h b/source3/rpc_client/init_netlogon.h new file mode 100644 index 0000000..d87a9ea --- /dev/null +++ b/source3/rpc_client/init_netlogon.h @@ -0,0 +1,5 @@ +/* The following definitions come from rpc_client/init_netlogon.c */ + +void init_netr_CryptPassword(const char *pwd, + unsigned char session_key[16], + struct netr_CryptPassword *pwd_buf); diff --git a/source3/rpc_server/srv_lsa_hnd.c b/source3/rpc_server/srv_lsa_hnd.c index f1ab774..7cc1b43 100644 --- a/source3/rpc_server/srv_lsa_hnd.c +++ b/source3/rpc_server/srv_lsa_hnd.c @@ -21,6 +21,7 @@ #include "includes.h" #include "../librpc/gen_ndr/ndr_lsa.h" +#include "../librpc/gen_ndr/ndr_samr.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_RPC_SRV diff --git a/source3/rpcclient/cmd_test.c b/source3/rpcclient/cmd_test.c index 263c45e..e854df9 100644 --- a/source3/rpcclient/cmd_test.c +++ b/source3/rpcclient/cmd_test.c @@ -22,6 +22,7 @@ #include "rpcclient.h" #include "../librpc/gen_ndr/cli_lsa.h" #include "rpc_client/cli_lsarpc.h" +#include "../librpc/gen_ndr/ndr_samr.h" static NTSTATUS cmd_testme(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, int argc, const char **argv) diff --git a/source3/smbd/lanman.c b/source3/smbd/lanman.c index c0bc909..6c94a88 100644 --- a/source3/smbd/lanman.c +++ b/source3/smbd/lanman.c @@ -4289,32 +4289,32 @@ static bool api_RNetUserGetInfo(connection_struct *conn, uint16 vuid, return False; } if (uLevel == 2) { - SIVAL(p,60,0); /* auth_flags */ - SIVAL(p,64,PTR_DIFF(p2,*rdata)); /* full_name */ + SIVAL(p,58,0); /* auth_flags */ + SIVAL(p,62,PTR_DIFF(p2,*rdata)); /* full_name */ strlcpy(p2,info->info21.full_name.string,PTR_DIFF(endp,p2)); p2 = skip_string(*rdata,*rdata_len,p2); if (!p2) { return False; } - SIVAL(p,68,0); /* urs_comment */ - SIVAL(p,72,PTR_DIFF(p2,*rdata)); /* parms */ + SIVAL(p,66,0); /* urs_comment */ + SIVAL(p,70,PTR_DIFF(p2,*rdata)); /* parms */ strlcpy(p2,"",PTR_DIFF(endp,p2)); p2 = skip_string(*rdata,*rdata_len,p2); if (!p2) { return False; } - SIVAL(p,76,0); /* workstations */ - SIVAL(p,80,0); /* last_logon */ - SIVAL(p,84,0); /* last_logoff */ - SIVALS(p,88,-1); /* acct_expires */ - SIVALS(p,92,-1); /* max_storage */ - SSVAL(p,96,168); /* units_per_week */ - SIVAL(p,98,PTR_DIFF(p2,*rdata)); /* logon_hours */ + SIVAL(p,74,0); /* workstations */ + SIVAL(p,78,0); /* last_logon */ + SIVAL(p,82,0); /* last_logoff */ + SIVALS(p,86,-1); /* acct_expires */ + SIVALS(p,90,-1); /* max_storage */ + SSVAL(p,94,168); /* units_per_week */ + SIVAL(p,96,PTR_DIFF(p2,*rdata)); /* logon_hours */ memset(p2,-1,21); p2 += 21; - SSVALS(p,102,-1); /* bad_pw_count */ - SSVALS(p,104,-1); /* num_logons */ - SIVAL(p,106,PTR_DIFF(p2,*rdata)); /* logon_server */ + SSVALS(p,100,-1); /* bad_pw_count */ + SSVALS(p,102,-1); /* num_logons */ + SIVAL(p,104,PTR_DIFF(p2,*rdata)); /* logon_server */ { TALLOC_CTX *ctx = talloc_tos(); int space_rem = *rdata_len - (p2 - *rdata); @@ -4344,8 +4344,8 @@ static bool api_RNetUserGetInfo(connection_struct *conn, uint16 vuid, if (!p2) { return False; } - SSVAL(p,110,49); /* country_code */ - SSVAL(p,112,860); /* code page */ + SSVAL(p,108,49); /* country_code */ + SSVAL(p,110,860); /* code page */ } } diff --git a/source3/utils/net_rpc_shell.c b/source3/utils/net_rpc_shell.c index 11facf9..b1de4d2 100644 --- a/source3/utils/net_rpc_shell.c +++ b/source3/utils/net_rpc_shell.c @@ -20,6 +20,7 @@ #include "includes.h" #include "utils/net.h" +#include "../librpc/gen_ndr/ndr_samr.h" static NTSTATUS rpc_sh_info(struct net_context *c, TALLOC_CTX *mem_ctx, struct rpc_sh_ctx *ctx, -- Samba Shared Repository