Root/package/network/services/samba36/patches/200-remove_printer_support.patch

1--- a/source3/rpc_server/rpc_ep_setup.c
2+++ b/source3/rpc_server/rpc_ep_setup.c
3@@ -1110,6 +1110,10 @@ bool dcesrv_ep_setup(struct tevent_conte
4                        "rpc_server",
5                        "spoolss",
6                        "embedded");
7+#ifndef PRINTER_SUPPORT
8+ if (1) {
9+ } else
10+#endif
11     if (StrCaseCmp(rpcsrv_type, "embedded") == 0) {
12         spoolss_cb.init = spoolss_init_cb;
13         spoolss_cb.shutdown = spoolss_shutdown_cb;
14--- a/source3/rpcclient/rpcclient.c
15+++ b/source3/rpcclient/rpcclient.c
16@@ -624,7 +624,9 @@ static struct cmd_set *rpcclient_command
17     lsarpc_commands,
18     ds_commands,
19     samr_commands,
20+#ifdef PRINTER_SUPPORT
21     spoolss_commands,
22+#endif
23     netlogon_commands,
24     srvsvc_commands,
25     dfs_commands,
26--- a/source3/printing/spoolssd.c
27+++ b/source3/printing/spoolssd.c
28@@ -153,6 +153,10 @@ void start_spoolssd(struct tevent_contex
29     NTSTATUS status;
30     int ret;
31 
32+#ifndef PRINTER_SUPPORT
33+ return;
34+#endif
35+
36     DEBUG(1, ("Forking SPOOLSS Daemon\n"));
37 
38     pid = sys_fork();
39--- a/source3/utils/net_rpc.c
40+++ b/source3/utils/net_rpc.c
41@@ -7791,6 +7791,10 @@ int net_rpc_printer(struct net_context *
42         {NULL, NULL, 0, NULL, NULL}
43     };
44 
45+#ifndef PRINTER_SUPPORT
46+ return 0;
47+#endif
48+
49     if (argc == 0) {
50         if (c->display_usage) {
51             d_printf(_("Usage:\n"));
52--- a/source3/smbd/reply.c
53+++ b/source3/smbd/reply.c
54@@ -5194,7 +5194,11 @@ void reply_printopen(struct smb_request
55         return;
56     }
57 
58- if (!CAN_PRINT(conn)) {
59+
60+#ifdef PRINTER_SUPPORT
61+ if (!CAN_PRINT(conn))
62+#endif
63+ {
64         reply_nterror(req, NT_STATUS_ACCESS_DENIED);
65         END_PROFILE(SMBsplopen);
66         return;
67@@ -5300,7 +5304,10 @@ void reply_printqueue(struct smb_request
68        is really quite gross and only worked when there was only
69        one printer - I think we should now only accept it if they
70        get it right (tridge) */
71- if (!CAN_PRINT(conn)) {
72+#ifdef PRINTER_SUPPORT
73+ if (!CAN_PRINT(conn))
74+#endif
75+ {
76         reply_nterror(req, NT_STATUS_ACCESS_DENIED);
77         END_PROFILE(SMBsplretq);
78         return;
79--- a/source3/smbd/lanman.c
80+++ b/source3/smbd/lanman.c
81@@ -784,6 +784,10 @@ static bool api_DosPrintQGetInfo(struct
82     union spoolss_JobInfo *job_info = NULL;
83     union spoolss_PrinterInfo printer_info;
84 
85+#ifndef PRINTER_SUPPORT
86+ return False;
87+#endif
88+
89     if (!str1 || !str2 || !p) {
90         return False;
91     }
92@@ -999,6 +1003,10 @@ static bool api_DosPrintQEnum(struct smb
93     union spoolss_DriverInfo *driver_info;
94     union spoolss_JobInfo **job_info;
95 
96+#ifndef PRINTER_SUPPORT
97+ return False;
98+#endif
99+
100     if (!param_format || !output_format1 || !p) {
101         return False;
102     }
103@@ -3350,6 +3358,10 @@ static bool api_RDosPrintJobDel(struct s
104     struct spoolss_DevmodeContainer devmode_ctr;
105     enum spoolss_JobControl command;
106 
107+#ifndef PRINTER_SUPPORT
108+ return False;
109+#endif
110+
111     if (!str1 || !str2 || !p) {
112         return False;
113     }
114@@ -3483,6 +3495,10 @@ static bool api_WPrintQueueCtrl(struct s
115     struct sec_desc_buf secdesc_ctr;
116     enum spoolss_PrinterControl command;
117 
118+#ifndef PRINTER_SUPPORT
119+ return False;
120+#endif
121+
122     if (!str1 || !str2 || !QueueName) {
123         return False;
124     }
125@@ -3649,6 +3665,10 @@ static bool api_PrintJobInfo(struct smbd
126     union spoolss_JobInfo info;
127     struct spoolss_SetJobInfo1 info1;
128 
129+#ifndef PRINTER_SUPPORT
130+ return False;
131+#endif
132+
133     if (!str1 || !str2 || !p) {
134         return False;
135     }
136@@ -4792,6 +4812,10 @@ static bool api_WPrintJobGetInfo(struct
137     struct spoolss_DevmodeContainer devmode_ctr;
138     union spoolss_JobInfo info;
139 
140+#ifndef PRINTER_SUPPORT
141+ return False;
142+#endif
143+
144     if (!str1 || !str2 || !p) {
145         return False;
146     }
147@@ -4930,6 +4954,10 @@ static bool api_WPrintJobEnumerate(struc
148     uint32_t count = 0;
149     union spoolss_JobInfo *info;
150 
151+#ifndef PRINTER_SUPPORT
152+ return False;
153+#endif
154+
155     if (!str1 || !str2 || !p) {
156         return False;
157     }
158@@ -5135,6 +5163,10 @@ static bool api_WPrintDestGetInfo(struct
159     struct spoolss_DevmodeContainer devmode_ctr;
160     union spoolss_PrinterInfo info;
161 
162+#ifndef PRINTER_SUPPORT
163+ return False;
164+#endif
165+
166     if (!str1 || !str2 || !p) {
167         return False;
168     }
169@@ -5271,6 +5303,10 @@ static bool api_WPrintDestEnum(struct sm
170     union spoolss_PrinterInfo *info;
171     uint32_t count;
172 
173+#ifndef PRINTER_SUPPORT
174+ return False;
175+#endif
176+
177     if (!str1 || !str2 || !p) {
178         return False;
179     }
180@@ -5374,6 +5410,10 @@ static bool api_WPrintDriverEnum(struct
181     int succnt;
182     struct pack_desc desc;
183 
184+#ifndef PRINTER_SUPPORT
185+ return False;
186+#endif
187+
188     if (!str1 || !str2 || !p) {
189         return False;
190     }
191@@ -5438,6 +5478,10 @@ static bool api_WPrintQProcEnum(struct s
192     int succnt;
193     struct pack_desc desc;
194 
195+#ifndef PRINTER_SUPPORT
196+ return False;
197+#endif
198+
199     if (!str1 || !str2 || !p) {
200         return False;
201     }
202@@ -5502,6 +5546,10 @@ static bool api_WPrintPortEnum(struct sm
203     int succnt;
204     struct pack_desc desc;
205 
206+#ifndef PRINTER_SUPPORT
207+ return False;
208+#endif
209+
210     if (!str1 || !str2 || !p) {
211         return False;
212     }
213--- a/source3/smbd/server_exit.c
214+++ b/source3/smbd/server_exit.c
215@@ -142,7 +142,9 @@ static void exit_server_common(enum serv
216         rpc_eventlog_shutdown();
217         rpc_ntsvcs_shutdown();
218         rpc_svcctl_shutdown();
219+#ifdef PRINTER_SUPPORT
220         rpc_spoolss_shutdown();
221+#endif
222 
223         rpc_srvsvc_shutdown();
224         rpc_winreg_shutdown();
225--- a/source3/smbd/open.c
226+++ b/source3/smbd/open.c
227@@ -1556,6 +1556,9 @@ static NTSTATUS open_file_ntcreate(conne
228          * Most of the passed parameters are ignored.
229          */
230 
231+#ifndef PRINTER_SUPPORT
232+ return NT_STATUS_ACCESS_DENIED;
233+#endif
234         if (pinfo) {
235             *pinfo = FILE_WAS_CREATED;
236         }
237--- a/source3/smbd/close.c
238+++ b/source3/smbd/close.c
239@@ -638,6 +638,9 @@ static NTSTATUS close_normal_file(struct
240     status = ntstatus_keeperror(status, tmp);
241 
242     if (fsp->print_file) {
243+#ifndef PRINTER_SUPPORT
244+ return NT_STATUS_OK;
245+#endif
246         /* FIXME: return spool errors */
247         print_spool_end(fsp, close_type);
248         file_free(req, fsp);
249--- a/source3/smbd/fileio.c
250+++ b/source3/smbd/fileio.c
251@@ -298,6 +298,10 @@ ssize_t write_file(struct smb_request *r
252         uint32_t t;
253         int ret;
254 
255+#ifndef PRINTER_SUPPORT
256+ return -1;
257+#endif
258+
259         ret = print_spool_write(fsp, data, n, pos, &t);
260         if (ret) {
261             errno = ret;
262--- a/source3/smbd/smb2_create.c
263+++ b/source3/smbd/smb2_create.c
264@@ -485,7 +485,10 @@ static struct tevent_req *smbd_smb2_crea
265         info = FILE_WAS_OPENED;
266     } else if (CAN_PRINT(smb1req->conn)) {
267         status = file_new(smb1req, smb1req->conn, &result);
268- if(!NT_STATUS_IS_OK(status)) {
269+#ifdef PRINTER_SUPPORT
270+ if(!NT_STATUS_IS_OK(status))
271+#endif
272+ {
273             tevent_req_nterror(req, status);
274             return tevent_req_post(req, ev);
275         }
276--- a/source3/rpc_server/svcctl/srv_svcctl_nt.c
277+++ b/source3/rpc_server/svcctl/srv_svcctl_nt.c
278@@ -85,9 +85,11 @@ bool init_service_op_table( void )
279 
280     /* add builtin services */
281 
282+#ifdef PRINTER_SUPPORT
283     svcctl_ops[i].name = talloc_strdup( svcctl_ops, "Spooler" );
284     svcctl_ops[i].ops = &spoolss_svc_ops;
285     i++;
286+#endif
287 
288     svcctl_ops[i].name = talloc_strdup( svcctl_ops, "NETLOGON" );
289     svcctl_ops[i].ops = &netlogon_svc_ops;
290--- a/source3/librpc/rpc/rpc_common.c
291+++ b/source3/librpc/rpc/rpc_common.c
292@@ -113,9 +113,11 @@ static bool initialize_interfaces(void)
293     if (!smb_register_ndr_interface(&ndr_table_winreg)) {
294         return false;
295     }
296+#ifdef PRINTER_SUPPORT
297     if (!smb_register_ndr_interface(&ndr_table_spoolss)) {
298         return false;
299     }
300+#endif
301     if (!smb_register_ndr_interface(&ndr_table_netdfs)) {
302         return false;
303     }
304--- a/source3/smbd/process.c
305+++ b/source3/smbd/process.c
306@@ -2475,8 +2475,10 @@ static bool housekeeping_fn(const struct
307 
308     change_to_root_user();
309 
310+#ifdef PRINTER_SUPPORT
311     /* update printer queue caches if necessary */
312     update_monitored_printq_cache(sconn->msg_ctx);
313+#endif
314 
315     /* check if we need to reload services */
316     check_reload(sconn, time_mono(NULL));
317--- a/source3/smbd/server.c
318+++ b/source3/smbd/server.c
319@@ -126,7 +126,9 @@ static void smb_pcap_updated(struct mess
320 {
321     struct tevent_context *ev_ctx =
322         talloc_get_type_abort(private_data, struct tevent_context);
323-
324+#ifndef PRINTER_SUPPORT
325+ return;
326+#endif
327     DEBUG(10,("Got message saying pcap was updated. Reloading.\n"));
328     change_to_root_user();
329     reload_printers(ev_ctx, msg);
330@@ -1211,8 +1213,10 @@ extern void build_options(bool screen);
331     if (!W_ERROR_IS_OK(registry_init_full()))
332         exit(1);
333 
334+#ifdef PRINTER_SUPPORT
335     if (!print_backend_init(smbd_messaging_context()))
336         exit(1);
337+#endif
338 
339     /* Open the share_info.tdb here, so we don't have to open
340        after the fork on every single connection. This is a small
341@@ -1256,6 +1260,7 @@ extern void build_options(bool screen);
342         exit(1);
343     }
344 
345+#ifdef PRINTER_SUPPORT
346     /* Publish nt printers, this requires a working winreg pipe */
347     pcap_cache_reload(server_event_context(), smbd_messaging_context(),
348               &reload_printers);
349@@ -1284,6 +1289,7 @@ extern void build_options(bool screen);
350                        smbd_messaging_context());
351         }
352     }
353+#endif
354 
355     if (!is_daemon) {
356         /* inetd mode */
357

Archive Download this file



interactive