aboutsummaryrefslogtreecommitdiffstats
path: root/unmaintained/samba36/260-remove_samr.patch
blob: 7e5557305607ac5fa4c0fe639f773fdcbf8b7194 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
--- a/source3/rpc_server/rpc_handles.c
+++ b/source3/rpc_server/rpc_handles.c
@@ -59,8 +59,11 @@ struct handle_list {
 
 static bool is_samr_lsa_pipe(const struct ndr_syntax_id *syntax)
 {
-	return (ndr_syntax_id_equal(syntax, &ndr_table_samr.syntax_id)
-		|| ndr_syntax_id_equal(syntax, &ndr_table_lsarpc.syntax_id));
+	return
+#ifdef SAMR_SUPPORT
+		ndr_syntax_id_equal(syntax, &ndr_table_samr.syntax_id) ||
+#endif
+		ndr_syntax_id_equal(syntax, &ndr_table_lsarpc.syntax_id);
 }
 
 size_t num_pipe_handles(struct pipes_struct *p)
--- a/source3/librpc/rpc/rpc_common.c
+++ b/source3/librpc/rpc/rpc_common.c
@@ -100,9 +100,11 @@ static bool initialize_interfaces(void)
 		return false;
 	}
 #endif
+#ifdef SAMR_SUPPORT
 	if (!smb_register_ndr_interface(&ndr_table_samr)) {
 		return false;
 	}
+#endif
 #ifdef NETLOGON_SUPPORT
 	if (!smb_register_ndr_interface(&ndr_table_netlogon)) {
 		return false;
--- a/source3/rpc_server/rpc_ep_setup.c
+++ b/source3/rpc_server/rpc_ep_setup.c
@@ -557,6 +557,7 @@ static bool lsarpc_init_cb(void *ptr)
 	return true;
 }
 
+#ifdef SAMR_SUPPORT
 static bool samr_init_cb(void *ptr)
 {
 	struct dcesrv_ep_context *ep_ctx =
@@ -605,6 +606,7 @@ static bool samr_init_cb(void *ptr)
 
 	return true;
 }
+#endif
 
 #ifdef NETLOGON_SUPPORT
 static bool netlogon_init_cb(void *ptr)
@@ -1111,12 +1113,14 @@ bool dcesrv_ep_setup(struct tevent_conte
 		return false;
 	}
 
+#ifdef SAMR_SUPPORT
 	samr_cb.init         = samr_init_cb;
 	samr_cb.shutdown     = NULL;
 	samr_cb.private_data = ep_ctx;
 	if (!NT_STATUS_IS_OK(rpc_samr_init(&samr_cb))) {
 		return false;
 	}
+#endif
 
 #ifdef NETLOGON_SUPPORT
 	netlogon_cb.init         = netlogon_init_cb;
--- a/source3/smbd/server_exit.c
+++ b/source3/smbd/server_exit.c
@@ -159,7 +159,9 @@ static void exit_server_common(enum serv
 #ifdef NETLOGON_SUPPORT
 		rpc_netlogon_shutdown();
 #endif
+#ifdef SAMR_SUPPORT
 		rpc_samr_shutdown();
+#endif
 		rpc_lsarpc_shutdown();
 	}
 
--- a/source3/rpcclient/rpcclient.c
+++ b/source3/rpcclient/rpcclient.c
@@ -623,7 +623,9 @@ static struct cmd_set *rpcclient_command
 	rpcclient_commands,
 	lsarpc_commands,
 	ds_commands,
+#ifdef SAMR_SUPPORT
 	samr_commands,
+#endif
 #ifdef PRINTER_SUPPORT
 	spoolss_commands,
 #endif
--- a/source3/smbd/lanman.c
+++ b/source3/smbd/lanman.c
@@ -2353,6 +2353,10 @@ static bool api_RNetGroupEnum(struct smb
 	NTSTATUS status, result;
 	struct dcerpc_binding_handle *b;
 
+#ifndef SAMR_SUPPORT
+	return False;
+#endif
+
 	if (!str1 || !str2 || !p) {
 		return False;
 	}
@@ -2541,6 +2545,10 @@ static bool api_NetUserGetGroups(struct
 	NTSTATUS status, result;
 	struct dcerpc_binding_handle *b;
 
+#ifndef SAMR_SUPPORT
+	return False;
+#endif
+
 	if (!str1 || !str2 || !UserName || !p) {
 		return False;
 	}
@@ -2741,6 +2749,10 @@ static bool api_RNetUserEnum(struct smbd
 
 	struct dcerpc_binding_handle *b;
 
+#ifndef SAMR_SUPPORT
+	return False;
+#endif
+
 	if (!str1 || !str2 || !p) {
 		return False;
 	}
@@ -2979,6 +2991,10 @@ static bool api_SamOEMChangePassword(str
 	int bufsize;
 	struct dcerpc_binding_handle *b;
 
+#ifndef SAMR_SUPPORT
+	return False;
+#endif
+
 	*rparam_len = 4;
 	*rparam = smb_realloc_limit(*rparam,*rparam_len);
 	if (!*rparam) {
@@ -4020,6 +4036,10 @@ static bool api_RNetUserGetInfo(struct s
 	union samr_UserInfo *info;
 	struct dcerpc_binding_handle *b = NULL;
 
+#ifndef SAMR_SUPPORT
+	return False;
+#endif
+
 	if (!str1 || !str2 || !UserName || !p) {
 		return False;
 	}