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
7 +#ifndef PRINTER_SUPPORT
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
20 +#ifdef PRINTER_SUPPORT
26 --- a/source3/printing/spoolssd.c
27 +++ b/source3/printing/spoolssd.c
28 @@ -165,6 +165,10 @@ void start_spoolssd(struct tevent_contex
32 +#ifndef PRINTER_SUPPORT
36 DEBUG(1, ("Forking SPOOLSS Daemon\n"));
39 --- a/source3/utils/net_rpc.c
40 +++ b/source3/utils/net_rpc.c
41 @@ -7841,6 +7841,10 @@ int net_rpc_printer(struct net_context *
42 {NULL, NULL, 0, NULL, NULL}
45 +#ifndef PRINTER_SUPPORT
50 if (c->display_usage) {
51 d_printf(_("Usage:\n"));
52 --- a/source3/smbd/reply.c
53 +++ b/source3/smbd/reply.c
54 @@ -5208,7 +5208,11 @@ void reply_printopen(struct smb_request
58 - if (!CAN_PRINT(conn)) {
60 +#ifdef PRINTER_SUPPORT
61 + if (!CAN_PRINT(conn))
64 reply_nterror(req, NT_STATUS_ACCESS_DENIED);
65 END_PROFILE(SMBsplopen);
67 @@ -5314,7 +5318,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))
76 reply_nterror(req, NT_STATUS_ACCESS_DENIED);
77 END_PROFILE(SMBsplretq);
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;
85 +#ifndef PRINTER_SUPPORT
89 if (!str1 || !str2 || !p) {
92 @@ -999,6 +1003,10 @@ static bool api_DosPrintQEnum(struct smb
93 union spoolss_DriverInfo *driver_info;
94 union spoolss_JobInfo **job_info;
96 +#ifndef PRINTER_SUPPORT
100 if (!param_format || !output_format1 || !p) {
103 @@ -3105,6 +3113,10 @@ static bool api_RDosPrintJobDel(struct s
104 struct spoolss_DevmodeContainer devmode_ctr;
105 enum spoolss_JobControl command;
107 +#ifndef PRINTER_SUPPORT
111 if (!str1 || !str2 || !p) {
114 @@ -3238,6 +3250,10 @@ static bool api_WPrintQueueCtrl(struct s
115 struct sec_desc_buf secdesc_ctr;
116 enum spoolss_PrinterControl command;
118 +#ifndef PRINTER_SUPPORT
122 if (!str1 || !str2 || !QueueName) {
125 @@ -3404,6 +3420,10 @@ static bool api_PrintJobInfo(struct smbd
126 union spoolss_JobInfo info;
127 struct spoolss_SetJobInfo1 info1;
129 +#ifndef PRINTER_SUPPORT
133 if (!str1 || !str2 || !p) {
136 @@ -4547,6 +4567,10 @@ static bool api_WPrintJobGetInfo(struct
137 struct spoolss_DevmodeContainer devmode_ctr;
138 union spoolss_JobInfo info;
140 +#ifndef PRINTER_SUPPORT
144 if (!str1 || !str2 || !p) {
147 @@ -4685,6 +4709,10 @@ static bool api_WPrintJobEnumerate(struc
149 union spoolss_JobInfo *info;
151 +#ifndef PRINTER_SUPPORT
155 if (!str1 || !str2 || !p) {
158 @@ -4890,6 +4918,10 @@ static bool api_WPrintDestGetInfo(struct
159 struct spoolss_DevmodeContainer devmode_ctr;
160 union spoolss_PrinterInfo info;
162 +#ifndef PRINTER_SUPPORT
166 if (!str1 || !str2 || !p) {
169 @@ -5026,6 +5058,10 @@ static bool api_WPrintDestEnum(struct sm
170 union spoolss_PrinterInfo *info;
173 +#ifndef PRINTER_SUPPORT
177 if (!str1 || !str2 || !p) {
180 @@ -5129,6 +5165,10 @@ static bool api_WPrintDriverEnum(struct
182 struct pack_desc desc;
184 +#ifndef PRINTER_SUPPORT
188 if (!str1 || !str2 || !p) {
191 @@ -5193,6 +5233,10 @@ static bool api_WPrintQProcEnum(struct s
193 struct pack_desc desc;
195 +#ifndef PRINTER_SUPPORT
199 if (!str1 || !str2 || !p) {
202 @@ -5257,6 +5301,10 @@ static bool api_WPrintPortEnum(struct sm
204 struct pack_desc desc;
206 +#ifndef PRINTER_SUPPORT
210 if (!str1 || !str2 || !p) {
213 --- a/source3/smbd/server_exit.c
214 +++ b/source3/smbd/server_exit.c
215 @@ -141,7 +141,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();
223 rpc_srvsvc_shutdown();
224 rpc_winreg_shutdown();
225 --- a/source3/smbd/open.c
226 +++ b/source3/smbd/open.c
227 @@ -1608,6 +1608,9 @@ static NTSTATUS open_file_ntcreate(conne
228 * Most of the passed parameters are ignored.
231 +#ifndef PRINTER_SUPPORT
232 + return NT_STATUS_ACCESS_DENIED;
235 *pinfo = FILE_WAS_CREATED;
237 --- a/source3/smbd/close.c
238 +++ b/source3/smbd/close.c
239 @@ -643,6 +643,9 @@ static NTSTATUS close_normal_file(struct
240 status = ntstatus_keeperror(status, tmp);
242 if (fsp->print_file) {
243 +#ifndef PRINTER_SUPPORT
244 + return NT_STATUS_OK;
246 /* FIXME: return spool errors */
247 print_spool_end(fsp, close_type);
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
255 +#ifndef PRINTER_SUPPORT
259 ret = print_spool_write(fsp, data, n, pos, &t);
262 --- a/source3/smbd/smb2_create.c
263 +++ b/source3/smbd/smb2_create.c
264 @@ -486,7 +486,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))
273 tevent_req_nterror(req, status);
274 return tevent_req_post(req, ev);
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 )
280 /* add builtin services */
282 +#ifdef PRINTER_SUPPORT
283 svcctl_ops[i].name = talloc_strdup( svcctl_ops, "Spooler" );
284 svcctl_ops[i].ops = &spoolss_svc_ops;
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)) {
296 +#ifdef PRINTER_SUPPORT
297 if (!smb_register_ndr_interface(&ndr_table_spoolss)) {
301 if (!smb_register_ndr_interface(&ndr_table_netdfs)) {
304 --- a/source3/smbd/process.c
305 +++ b/source3/smbd/process.c
306 @@ -2423,8 +2423,10 @@ static bool housekeeping_fn(const struct
308 change_to_root_user();
310 +#ifdef PRINTER_SUPPORT
311 /* update printer queue caches if necessary */
312 update_monitored_printq_cache(sconn->msg_ctx);
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 @@ -123,7 +123,9 @@ static void smb_pcap_updated(struct mess
321 struct tevent_context *ev_ctx =
322 talloc_get_type_abort(private_data, struct tevent_context);
324 +#ifndef PRINTER_SUPPORT
327 DEBUG(10,("Got message saying pcap was updated. Reloading.\n"));
328 change_to_root_user();
329 reload_printers(ev_ctx, msg);
330 @@ -1277,6 +1279,7 @@ extern void build_options(bool screen);
331 * The print backend init also migrates the printing tdb's,
332 * this requires a winreg pipe.
334 +#ifdef PRINTER_SUPPORT
335 if (!print_backend_init(smbd_messaging_context()))
338 @@ -1315,7 +1318,7 @@ extern void build_options(bool screen);
339 smbd_messaging_context());