From 716ca530e1c4515d8683c9d5be3d56b301758b66 Mon Sep 17 00:00:00 2001 From: James <> Date: Wed, 4 Nov 2015 11:49:21 +0000 Subject: trunk-47381 --- .../patches/200-remove_printer_support.patch | 346 +++++++++++++++++++++ 1 file changed, 346 insertions(+) create mode 100644 package/network/services/samba36/patches/200-remove_printer_support.patch (limited to 'package/network/services/samba36/patches/200-remove_printer_support.patch') diff --git a/package/network/services/samba36/patches/200-remove_printer_support.patch b/package/network/services/samba36/patches/200-remove_printer_support.patch new file mode 100644 index 0000000..de567a7 --- /dev/null +++ b/package/network/services/samba36/patches/200-remove_printer_support.patch @@ -0,0 +1,346 @@ +--- a/source3/rpc_server/rpc_ep_setup.c ++++ b/source3/rpc_server/rpc_ep_setup.c +@@ -1110,6 +1110,10 @@ bool dcesrv_ep_setup(struct tevent_conte + "rpc_server", + "spoolss", + "embedded"); ++#ifndef PRINTER_SUPPORT ++ if (1) { ++ } else ++#endif + if (StrCaseCmp(rpcsrv_type, "embedded") == 0) { + spoolss_cb.init = spoolss_init_cb; + spoolss_cb.shutdown = spoolss_shutdown_cb; +--- a/source3/rpcclient/rpcclient.c ++++ b/source3/rpcclient/rpcclient.c +@@ -624,7 +624,9 @@ static struct cmd_set *rpcclient_command + lsarpc_commands, + ds_commands, + samr_commands, ++#ifdef PRINTER_SUPPORT + spoolss_commands, ++#endif + netlogon_commands, + srvsvc_commands, + dfs_commands, +--- a/source3/printing/spoolssd.c ++++ b/source3/printing/spoolssd.c +@@ -165,6 +165,10 @@ void start_spoolssd(struct tevent_contex + NTSTATUS status; + int ret; + ++#ifndef PRINTER_SUPPORT ++ return; ++#endif ++ + DEBUG(1, ("Forking SPOOLSS Daemon\n")); + + pid = sys_fork(); +--- a/source3/utils/net_rpc.c ++++ b/source3/utils/net_rpc.c +@@ -7841,6 +7841,10 @@ int net_rpc_printer(struct net_context * + {NULL, NULL, 0, NULL, NULL} + }; + ++#ifndef PRINTER_SUPPORT ++ return 0; ++#endif ++ + if (argc == 0) { + if (c->display_usage) { + d_printf(_("Usage:\n")); +--- a/source3/smbd/reply.c ++++ b/source3/smbd/reply.c +@@ -5208,7 +5208,11 @@ void reply_printopen(struct smb_request + return; + } + +- if (!CAN_PRINT(conn)) { ++ ++#ifdef PRINTER_SUPPORT ++ if (!CAN_PRINT(conn)) ++#endif ++ { + reply_nterror(req, NT_STATUS_ACCESS_DENIED); + END_PROFILE(SMBsplopen); + return; +@@ -5314,7 +5318,10 @@ void reply_printqueue(struct smb_request + is really quite gross and only worked when there was only + one printer - I think we should now only accept it if they + get it right (tridge) */ +- if (!CAN_PRINT(conn)) { ++#ifdef PRINTER_SUPPORT ++ if (!CAN_PRINT(conn)) ++#endif ++ { + reply_nterror(req, NT_STATUS_ACCESS_DENIED); + END_PROFILE(SMBsplretq); + return; +--- a/source3/smbd/lanman.c ++++ b/source3/smbd/lanman.c +@@ -784,6 +784,10 @@ static bool api_DosPrintQGetInfo(struct + union spoolss_JobInfo *job_info = NULL; + union spoolss_PrinterInfo printer_info; + ++#ifndef PRINTER_SUPPORT ++ return False; ++#endif ++ + if (!str1 || !str2 || !p) { + return False; + } +@@ -999,6 +1003,10 @@ static bool api_DosPrintQEnum(struct smb + union spoolss_DriverInfo *driver_info; + union spoolss_JobInfo **job_info; + ++#ifndef PRINTER_SUPPORT ++ return False; ++#endif ++ + if (!param_format || !output_format1 || !p) { + return False; + } +@@ -3105,6 +3113,10 @@ static bool api_RDosPrintJobDel(struct s + struct spoolss_DevmodeContainer devmode_ctr; + enum spoolss_JobControl command; + ++#ifndef PRINTER_SUPPORT ++ return False; ++#endif ++ + if (!str1 || !str2 || !p) { + return False; + } +@@ -3238,6 +3250,10 @@ static bool api_WPrintQueueCtrl(struct s + struct sec_desc_buf secdesc_ctr; + enum spoolss_PrinterControl command; + ++#ifndef PRINTER_SUPPORT ++ return False; ++#endif ++ + if (!str1 || !str2 || !QueueName) { + return False; + } +@@ -3404,6 +3420,10 @@ static bool api_PrintJobInfo(struct smbd + union spoolss_JobInfo info; + struct spoolss_SetJobInfo1 info1; + ++#ifndef PRINTER_SUPPORT ++ return False; ++#endif ++ + if (!str1 || !str2 || !p) { + return False; + } +@@ -4547,6 +4567,10 @@ static bool api_WPrintJobGetInfo(struct + struct spoolss_DevmodeContainer devmode_ctr; + union spoolss_JobInfo info; + ++#ifndef PRINTER_SUPPORT ++ return False; ++#endif ++ + if (!str1 || !str2 || !p) { + return False; + } +@@ -4685,6 +4709,10 @@ static bool api_WPrintJobEnumerate(struc + uint32_t count = 0; + union spoolss_JobInfo *info; + ++#ifndef PRINTER_SUPPORT ++ return False; ++#endif ++ + if (!str1 || !str2 || !p) { + return False; + } +@@ -4890,6 +4918,10 @@ static bool api_WPrintDestGetInfo(struct + struct spoolss_DevmodeContainer devmode_ctr; + union spoolss_PrinterInfo info; + ++#ifndef PRINTER_SUPPORT ++ return False; ++#endif ++ + if (!str1 || !str2 || !p) { + return False; + } +@@ -5026,6 +5058,10 @@ static bool api_WPrintDestEnum(struct sm + union spoolss_PrinterInfo *info; + uint32_t count; + ++#ifndef PRINTER_SUPPORT ++ return False; ++#endif ++ + if (!str1 || !str2 || !p) { + return False; + } +@@ -5129,6 +5165,10 @@ static bool api_WPrintDriverEnum(struct + int succnt; + struct pack_desc desc; + ++#ifndef PRINTER_SUPPORT ++ return False; ++#endif ++ + if (!str1 || !str2 || !p) { + return False; + } +@@ -5193,6 +5233,10 @@ static bool api_WPrintQProcEnum(struct s + int succnt; + struct pack_desc desc; + ++#ifndef PRINTER_SUPPORT ++ return False; ++#endif ++ + if (!str1 || !str2 || !p) { + return False; + } +@@ -5257,6 +5301,10 @@ static bool api_WPrintPortEnum(struct sm + int succnt; + struct pack_desc desc; + ++#ifndef PRINTER_SUPPORT ++ return False; ++#endif ++ + if (!str1 || !str2 || !p) { + return False; + } +--- a/source3/smbd/server_exit.c ++++ b/source3/smbd/server_exit.c +@@ -141,7 +141,9 @@ static void exit_server_common(enum serv + rpc_eventlog_shutdown(); + rpc_ntsvcs_shutdown(); + rpc_svcctl_shutdown(); ++#ifdef PRINTER_SUPPORT + rpc_spoolss_shutdown(); ++#endif + + rpc_srvsvc_shutdown(); + rpc_winreg_shutdown(); +--- a/source3/smbd/open.c ++++ b/source3/smbd/open.c +@@ -1608,6 +1608,9 @@ static NTSTATUS open_file_ntcreate(conne + * Most of the passed parameters are ignored. + */ + ++#ifndef PRINTER_SUPPORT ++ return NT_STATUS_ACCESS_DENIED; ++#endif + if (pinfo) { + *pinfo = FILE_WAS_CREATED; + } +--- a/source3/smbd/close.c ++++ b/source3/smbd/close.c +@@ -643,6 +643,9 @@ static NTSTATUS close_normal_file(struct + status = ntstatus_keeperror(status, tmp); + + if (fsp->print_file) { ++#ifndef PRINTER_SUPPORT ++ return NT_STATUS_OK; ++#endif + /* FIXME: return spool errors */ + print_spool_end(fsp, close_type); + file_free(req, fsp); +--- a/source3/smbd/fileio.c ++++ b/source3/smbd/fileio.c +@@ -298,6 +298,10 @@ ssize_t write_file(struct smb_request *r + uint32_t t; + int ret; + ++#ifndef PRINTER_SUPPORT ++ return -1; ++#endif ++ + ret = print_spool_write(fsp, data, n, pos, &t); + if (ret) { + errno = ret; +--- a/source3/smbd/smb2_create.c ++++ b/source3/smbd/smb2_create.c +@@ -486,7 +486,10 @@ static struct tevent_req *smbd_smb2_crea + info = FILE_WAS_OPENED; + } else if (CAN_PRINT(smb1req->conn)) { + status = file_new(smb1req, smb1req->conn, &result); +- if(!NT_STATUS_IS_OK(status)) { ++#ifdef PRINTER_SUPPORT ++ if(!NT_STATUS_IS_OK(status)) ++#endif ++ { + tevent_req_nterror(req, status); + return tevent_req_post(req, ev); + } +--- a/source3/rpc_server/svcctl/srv_svcctl_nt.c ++++ b/source3/rpc_server/svcctl/srv_svcctl_nt.c +@@ -85,9 +85,11 @@ bool init_service_op_table( void ) + + /* add builtin services */ + ++#ifdef PRINTER_SUPPORT + svcctl_ops[i].name = talloc_strdup( svcctl_ops, "Spooler" ); + svcctl_ops[i].ops = &spoolss_svc_ops; + i++; ++#endif + + svcctl_ops[i].name = talloc_strdup( svcctl_ops, "NETLOGON" ); + svcctl_ops[i].ops = &netlogon_svc_ops; +--- a/source3/librpc/rpc/rpc_common.c ++++ b/source3/librpc/rpc/rpc_common.c +@@ -113,9 +113,11 @@ static bool initialize_interfaces(void) + if (!smb_register_ndr_interface(&ndr_table_winreg)) { + return false; + } ++#ifdef PRINTER_SUPPORT + if (!smb_register_ndr_interface(&ndr_table_spoolss)) { + return false; + } ++#endif + if (!smb_register_ndr_interface(&ndr_table_netdfs)) { + return false; + } +--- a/source3/smbd/process.c ++++ b/source3/smbd/process.c +@@ -2423,8 +2423,10 @@ static bool housekeeping_fn(const struct + + change_to_root_user(); + ++#ifdef PRINTER_SUPPORT + /* update printer queue caches if necessary */ + update_monitored_printq_cache(sconn->msg_ctx); ++#endif + + /* check if we need to reload services */ + check_reload(sconn, time_mono(NULL)); +--- a/source3/smbd/server.c ++++ b/source3/smbd/server.c +@@ -123,7 +123,9 @@ static void smb_pcap_updated(struct mess + { + struct tevent_context *ev_ctx = + talloc_get_type_abort(private_data, struct tevent_context); +- ++#ifndef PRINTER_SUPPORT ++ return; ++#endif + DEBUG(10,("Got message saying pcap was updated. Reloading.\n")); + change_to_root_user(); + reload_printers(ev_ctx, msg); +@@ -1277,6 +1279,7 @@ extern void build_options(bool screen); + * The print backend init also migrates the printing tdb's, + * this requires a winreg pipe. + */ ++#ifdef PRINTER_SUPPORT + if (!print_backend_init(smbd_messaging_context())) + exit(1); + +@@ -1315,7 +1318,7 @@ extern void build_options(bool screen); + smbd_messaging_context()); + } + } +- ++#endif + if (!is_daemon) { + /* inetd mode */ + TALLOC_FREE(frame); -- cgit v1.2.3