From 668470c9923364c6c43afbf94162b549c8baef9a Mon Sep 17 00:00:00 2001
From: Andrew Bartlett <abartlet@samba.org>
Date: Tue, 15 Sep 2009 07:42:54 -0700
Subject: libcli:nbt make the lmhosts parsing code and dependicies common

This starts the process to have Samba4 use lmhosts.

Andrew Bartlett
---
 source3/include/proto.h | 9 ---------
 1 file changed, 9 deletions(-)

(limited to 'source3/include')

diff --git a/source3/include/proto.h b/source3/include/proto.h
index 5da13ca0d7..b037bf3ac0 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -1342,20 +1342,11 @@ NTSTATUS sid_array_from_info3(TALLOC_CTX *mem_ctx,
 
 /* The following definitions come from lib/util_sock.c  */
 
-bool interpret_string_addr_internal(struct addrinfo **ppres,
-					const char *str, int flags);
 bool is_broadcast_addr(const struct sockaddr *pss);
-bool interpret_string_addr(struct sockaddr_storage *pss,
-		const char *str,
-		int flags);
-bool interpret_string_addr_prefer_ipv4(struct sockaddr_storage *pss,
-		const char *str,
-		int flags);
 bool is_loopback_ip_v4(struct in_addr ip);
 bool is_loopback_addr(const struct sockaddr *pss);
 bool is_zero_addr(const struct sockaddr *pss);
 void zero_ip_v4(struct in_addr *ip);
-void zero_sockaddr(struct sockaddr_storage *pss);
 void in_addr_to_sockaddr_storage(struct sockaddr_storage *ss,
 		struct in_addr ip);
 bool same_net(const struct sockaddr *ip1,
-- 
cgit 


From d3af0346c87390b72f6f1708019c7cd055ae047d Mon Sep 17 00:00:00 2001
From: Günther Deschner <gd@samba.org>
Date: Mon, 14 Sep 2009 20:39:54 +0200
Subject: s3-dcerpc: use dcerpc_AuthLevel and remove duplicate set of flags.

Guenther
---
 source3/include/client.h   |  2 +-
 source3/include/ntdomain.h |  9 +--------
 source3/include/proto.h    | 22 +++++++++++-----------
 3 files changed, 13 insertions(+), 20 deletions(-)

(limited to 'source3/include')

diff --git a/source3/include/client.h b/source3/include/client.h
index 5b64b9be3a..e83927cfe5 100644
--- a/source3/include/client.h
+++ b/source3/include/client.h
@@ -48,7 +48,7 @@ struct print_job_info {
 
 struct cli_pipe_auth_data {
 	enum pipe_auth_type auth_type; /* switch for the union below. Defined in ntdomain.h */
-	enum pipe_auth_level auth_level; /* defined in ntdomain.h */
+	enum dcerpc_AuthLevel auth_level; /* defined in ntdomain.h */
 
 	char *domain;
 	char *user_name;
diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h
index 53e89a8751..1d303ca64a 100644
--- a/source3/include/ntdomain.h
+++ b/source3/include/ntdomain.h
@@ -132,13 +132,6 @@ typedef struct pipe_rpc_fns {
 enum pipe_auth_type { PIPE_AUTH_TYPE_NONE = 0, PIPE_AUTH_TYPE_NTLMSSP, PIPE_AUTH_TYPE_SCHANNEL,
 			PIPE_AUTH_TYPE_SPNEGO_NTLMSSP, PIPE_AUTH_TYPE_KRB5, PIPE_AUTH_TYPE_SPNEGO_KRB5 };
 
-/* Possible auth levels - keep these in sync with the wire values. */
-enum pipe_auth_level { PIPE_AUTH_LEVEL_NONE = 0,
-			PIPE_AUTH_LEVEL_CONNECT = 1,	/* We treat as NONE. */
-			PIPE_AUTH_LEVEL_INTEGRITY = 5,	/* Sign. */
-			PIPE_AUTH_LEVEL_PRIVACY = 6	/* Seal. */
-};
-
 /* auth state for krb5. */
 struct kerberos_auth_struct {
 	const char *service_principal;
@@ -155,7 +148,7 @@ struct schannel_auth_struct {
 
 struct pipe_auth_data {
 	enum pipe_auth_type auth_type; /* switch for union below. */
-	enum pipe_auth_level auth_level;
+	enum dcerpc_AuthLevel auth_level;
 	union {
 		struct schannel_auth_struct *schannel_auth;
 		AUTH_NTLMSSP_STATE *auth_ntlmssp_state;
diff --git a/source3/include/proto.h b/source3/include/proto.h
index b037bf3ac0..35d1a9929d 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -5291,17 +5291,17 @@ NTSTATUS rpccli_anon_bind_data(TALLOC_CTX *mem_ctx,
 			       struct cli_pipe_auth_data **presult);
 NTSTATUS rpccli_ntlmssp_bind_data(TALLOC_CTX *mem_ctx,
 				  enum pipe_auth_type auth_type,
-				  enum pipe_auth_level auth_level,
+				  enum dcerpc_AuthLevel auth_level,
 				  const char *domain,
 				  const char *username,
 				  const char *password,
 				  struct cli_pipe_auth_data **presult);
 NTSTATUS rpccli_schannel_bind_data(TALLOC_CTX *mem_ctx, const char *domain,
-				   enum pipe_auth_level auth_level,
+				   enum dcerpc_AuthLevel auth_level,
 				   const uint8_t sess_key[16],
 				   struct cli_pipe_auth_data **presult);
 NTSTATUS rpccli_kerberos_bind_data(TALLOC_CTX *mem_ctx,
-				   enum pipe_auth_level auth_level,
+				   enum dcerpc_AuthLevel auth_level,
 				   const char *service_princ,
 				   const char *username,
 				   const char *password,
@@ -5326,7 +5326,7 @@ NTSTATUS cli_rpc_pipe_open_noauth_transport(struct cli_state *cli,
 NTSTATUS cli_rpc_pipe_open_ntlmssp(struct cli_state *cli,
 				   const struct ndr_syntax_id *interface,
 				   enum dcerpc_transport_t transport,
-				   enum pipe_auth_level auth_level,
+				   enum dcerpc_AuthLevel auth_level,
 				   const char *domain,
 				   const char *username,
 				   const char *password,
@@ -5334,7 +5334,7 @@ NTSTATUS cli_rpc_pipe_open_ntlmssp(struct cli_state *cli,
 NTSTATUS cli_rpc_pipe_open_spnego_ntlmssp(struct cli_state *cli,
 					  const struct ndr_syntax_id *interface,
 					  enum dcerpc_transport_t transport,
-					  enum pipe_auth_level auth_level,
+					  enum dcerpc_AuthLevel auth_level,
 					  const char *domain,
 					  const char *username,
 					  const char *password,
@@ -5346,14 +5346,14 @@ NTSTATUS get_schannel_session_key(struct cli_state *cli,
 NTSTATUS cli_rpc_pipe_open_schannel_with_key(struct cli_state *cli,
 					     const struct ndr_syntax_id *interface,
 					     enum dcerpc_transport_t transport,
-					     enum pipe_auth_level auth_level,
+					     enum dcerpc_AuthLevel auth_level,
 					     const char *domain,
 					     struct netlogon_creds_CredentialState **pdc,
 					     struct rpc_pipe_client **presult);
 NTSTATUS cli_rpc_pipe_open_ntlmssp_auth_schannel(struct cli_state *cli,
 						 const struct ndr_syntax_id *interface,
 						 enum dcerpc_transport_t transport,
-						 enum pipe_auth_level auth_level,
+						 enum dcerpc_AuthLevel auth_level,
 						 const char *domain,
 						 const char *username,
 						 const char *password,
@@ -5361,12 +5361,12 @@ NTSTATUS cli_rpc_pipe_open_ntlmssp_auth_schannel(struct cli_state *cli,
 NTSTATUS cli_rpc_pipe_open_schannel(struct cli_state *cli,
 				    const struct ndr_syntax_id *interface,
 				    enum dcerpc_transport_t transport,
-				    enum pipe_auth_level auth_level,
+				    enum dcerpc_AuthLevel auth_level,
 				    const char *domain,
 				    struct rpc_pipe_client **presult);
 NTSTATUS cli_rpc_pipe_open_krb5(struct cli_state *cli,
 				const struct ndr_syntax_id *interface,
-				enum pipe_auth_level auth_level,
+				enum dcerpc_AuthLevel auth_level,
 				const char *service_princ,
 				const char *username,
 				const char *password,
@@ -5706,11 +5706,11 @@ bool prs_uint16s(bool charmode, const char *name, prs_struct *ps, int depth, uin
 bool prs_uint32s(bool charmode, const char *name, prs_struct *ps, int depth, uint32 *data32s, int len);
 bool prs_unistr(const char *name, prs_struct *ps, int depth, UNISTR *str);
 bool prs_string(const char *name, prs_struct *ps, int depth, char *str, int max_buf_size);
-void schannel_encode(struct schannel_auth_struct *a, enum pipe_auth_level auth_level,
+void schannel_encode(struct schannel_auth_struct *a, enum dcerpc_AuthLevel auth_level,
 		   enum schannel_direction direction,
 		   struct NL_AUTH_SIGNATURE *verf,
 		   char *data, size_t data_len);
-bool schannel_decode(struct schannel_auth_struct *a, enum pipe_auth_level auth_level,
+bool schannel_decode(struct schannel_auth_struct *a, enum dcerpc_AuthLevel auth_level,
 		   enum schannel_direction direction, 
 		   struct NL_AUTH_SIGNATURE *verf, char *data, size_t data_len);
 bool prs_init_data_blob(prs_struct *prs, DATA_BLOB *blob, TALLOC_CTX *mem_ctx);
-- 
cgit 


From 7b36ea55ea542d5a7f293359a12c441e3e9ba0c6 Mon Sep 17 00:00:00 2001
From: Günther Deschner <gd@samba.org>
Date: Tue, 15 Sep 2009 06:36:44 +0200
Subject: s3-dcerpc: remove duplicate RPC_AUTH_LEVEL flags.

Guenther
---
 source3/include/rpc_dce.h | 9 ---------
 1 file changed, 9 deletions(-)

(limited to 'source3/include')

diff --git a/source3/include/rpc_dce.h b/source3/include/rpc_dce.h
index 7992658a72..27ad3c3feb 100644
--- a/source3/include/rpc_dce.h
+++ b/source3/include/rpc_dce.h
@@ -64,15 +64,6 @@ enum RPC_PKT_TYPE {
 #define RPC_KRB5_AUTH_TYPE        16 /* Not yet implemented. */ 
 #define RPC_SCHANNEL_AUTH_TYPE    68 /* 0x44 */
 
-/* DCE-RPC standard identifiers to indicate 
-   signing or sealing of an RPC pipe */
-#define RPC_AUTH_LEVEL_NONE      1
-#define RPC_AUTH_LEVEL_CONNECT   2
-#define RPC_AUTH_LEVEL_CALL      3
-#define RPC_AUTH_LEVEL_PACKET    4
-#define RPC_AUTH_LEVEL_INTEGRITY 5
-#define RPC_AUTH_LEVEL_PRIVACY   6
-
 #if 0
 #define RPC_PIPE_AUTH_SIGN_LEVEL 0x5
 #define RPC_PIPE_AUTH_SEAL_LEVEL 0x6
-- 
cgit 


From e1ecb807e39264ab6bdd4a7d3dc35c95d7c17442 Mon Sep 17 00:00:00 2001
From: Günther Deschner <gd@samba.org>
Date: Tue, 15 Sep 2009 06:37:10 +0200
Subject: s3-dcerpc: remove more unused structs.

Guenther
---
 source3/include/rpc_dce.h | 12 ------------
 1 file changed, 12 deletions(-)

(limited to 'source3/include')

diff --git a/source3/include/rpc_dce.h b/source3/include/rpc_dce.h
index 27ad3c3feb..e5c1e3ae3a 100644
--- a/source3/include/rpc_dce.h
+++ b/source3/include/rpc_dce.h
@@ -53,9 +53,6 @@ enum RPC_PKT_TYPE {
 #define RPC_FLG_LAST  0x02
 #define RPC_FLG_NOCALL 0x20
 
-
-#define SMBD_NTLMSSP_NEG_FLAGS 0x000082b1 /* ALWAYS_SIGN|NEG_NTLM|NEG_LM|NEG_SEAL|NEG_SIGN|NEG_UNICODE */
-
 /* DCE RPC auth types - extended by Microsoft. */
 #define RPC_ANONYMOUS_AUTH_TYPE    0
 #define RPC_AUTH_TYPE_KRB5_1	   1
@@ -165,15 +162,6 @@ typedef struct rpc_hdr_auth_info {
 
 #define RPC_HDR_AUTH_LEN 8
 
-/* attached to the end of encrypted rpc requests and responses */
-/* RPC_AUTH_SCHANNEL_CHK */
-typedef struct rpc_auth_schannel_chk_info {
-	uint8 sig  [8]; /* 77 00 7a 00 ff ff 00 00 */
-	uint8 packet_digest[8]; /* checksum over the packet, MD5'ed with session key */
-	uint8 seq_num[8]; /* verifier, seq num */
-	uint8 confounder[8]; /* random 8-byte nonce */
-} RPC_AUTH_SCHANNEL_CHK;
-
 typedef struct rpc_context {
 	uint16 context_id;		/* presentation context identifier. */
 	uint8 num_transfer_syntaxes;	/* the number of syntaxes */
-- 
cgit 


From fdf3bd6203b35fc82bda1fd07cc91b76de3f9edd Mon Sep 17 00:00:00 2001
From: Günther Deschner <gd@samba.org>
Date: Tue, 15 Sep 2009 08:21:00 +0200
Subject: s3-dcerpc: remove unsed auth type defines as seen on the wire.

Guenther
---
 source3/include/rpc_dce.h | 13 -------------
 1 file changed, 13 deletions(-)

(limited to 'source3/include')

diff --git a/source3/include/rpc_dce.h b/source3/include/rpc_dce.h
index e5c1e3ae3a..fc2d8809b9 100644
--- a/source3/include/rpc_dce.h
+++ b/source3/include/rpc_dce.h
@@ -53,19 +53,6 @@ enum RPC_PKT_TYPE {
 #define RPC_FLG_LAST  0x02
 #define RPC_FLG_NOCALL 0x20
 
-/* DCE RPC auth types - extended by Microsoft. */
-#define RPC_ANONYMOUS_AUTH_TYPE    0
-#define RPC_AUTH_TYPE_KRB5_1	   1
-#define RPC_SPNEGO_AUTH_TYPE       9 
-#define RPC_NTLMSSP_AUTH_TYPE     10
-#define RPC_KRB5_AUTH_TYPE        16 /* Not yet implemented. */ 
-#define RPC_SCHANNEL_AUTH_TYPE    68 /* 0x44 */
-
-#if 0
-#define RPC_PIPE_AUTH_SIGN_LEVEL 0x5
-#define RPC_PIPE_AUTH_SEAL_LEVEL 0x6
-#endif
-
 /* Netlogon schannel auth type and level */
 #define SCHANNEL_SIGN_SIGNATURE { 0x77, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00 }
 #define SCHANNEL_SEAL_SIGNATURE { 0x77, 0x00, 0x7a, 0x00, 0xff, 0xff, 0x00, 0x00 }
-- 
cgit 


From 5a01071692db91a4ea7131e31c41b6426d184758 Mon Sep 17 00:00:00 2001
From: Andrew Bartlett <abartlet@samba.org>
Date: Tue, 15 Sep 2009 10:11:45 -0700
Subject: libcli:nbt put util_net.c protos in new header file

This fixed a very odd build problem due to util.h importing
system/network.h being imported before the uid_wapper code.

Andrew Bartlett
---
 source3/include/includes.h | 1 +
 1 file changed, 1 insertion(+)

(limited to 'source3/include')

diff --git a/source3/include/includes.h b/source3/include/includes.h
index 31dfc00545..d1be3b06a8 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -612,6 +612,7 @@ struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx);
 
 /* Lists, trees, caching, database... */
 #include "../lib/util/util.h"
+#include "../lib/util/util_net.h"
 #include "../lib/util/xfile.h"
 #include "../lib/util/memory.h"
 #include "../lib/util/attr.h"
-- 
cgit