200-remove_printer_support.patch 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  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. @@ -165,6 +165,10 @@ void start_spoolssd(struct tevent_contex
  29. NTSTATUS status;
  30. int ret;
  31. +#ifndef PRINTER_SUPPORT
  32. + return;
  33. +#endif
  34. +
  35. DEBUG(1, ("Forking SPOOLSS Daemon\n"));
  36. pid = sys_fork();
  37. --- a/source3/utils/net_rpc.c
  38. +++ b/source3/utils/net_rpc.c
  39. @@ -7841,6 +7841,10 @@ int net_rpc_printer(struct net_context *
  40. {NULL, NULL, 0, NULL, NULL}
  41. };
  42. +#ifndef PRINTER_SUPPORT
  43. + return 0;
  44. +#endif
  45. +
  46. if (argc == 0) {
  47. if (c->display_usage) {
  48. d_printf(_("Usage:\n"));
  49. --- a/source3/smbd/reply.c
  50. +++ b/source3/smbd/reply.c
  51. @@ -5208,7 +5208,11 @@ void reply_printopen(struct smb_request
  52. return;
  53. }
  54. - if (!CAN_PRINT(conn)) {
  55. +
  56. +#ifdef PRINTER_SUPPORT
  57. + if (!CAN_PRINT(conn))
  58. +#endif
  59. + {
  60. reply_nterror(req, NT_STATUS_ACCESS_DENIED);
  61. END_PROFILE(SMBsplopen);
  62. return;
  63. @@ -5314,7 +5318,10 @@ void reply_printqueue(struct smb_request
  64. is really quite gross and only worked when there was only
  65. one printer - I think we should now only accept it if they
  66. get it right (tridge) */
  67. - if (!CAN_PRINT(conn)) {
  68. +#ifdef PRINTER_SUPPORT
  69. + if (!CAN_PRINT(conn))
  70. +#endif
  71. + {
  72. reply_nterror(req, NT_STATUS_ACCESS_DENIED);
  73. END_PROFILE(SMBsplretq);
  74. return;
  75. --- a/source3/smbd/lanman.c
  76. +++ b/source3/smbd/lanman.c
  77. @@ -784,6 +784,10 @@ static bool api_DosPrintQGetInfo(struct
  78. union spoolss_JobInfo *job_info = NULL;
  79. union spoolss_PrinterInfo printer_info;
  80. +#ifndef PRINTER_SUPPORT
  81. + return False;
  82. +#endif
  83. +
  84. if (!str1 || !str2 || !p) {
  85. return False;
  86. }
  87. @@ -999,6 +1003,10 @@ static bool api_DosPrintQEnum(struct smb
  88. union spoolss_DriverInfo *driver_info;
  89. union spoolss_JobInfo **job_info;
  90. +#ifndef PRINTER_SUPPORT
  91. + return False;
  92. +#endif
  93. +
  94. if (!param_format || !output_format1 || !p) {
  95. return False;
  96. }
  97. @@ -3105,6 +3113,10 @@ static bool api_RDosPrintJobDel(struct s
  98. struct spoolss_DevmodeContainer devmode_ctr;
  99. enum spoolss_JobControl command;
  100. +#ifndef PRINTER_SUPPORT
  101. + return False;
  102. +#endif
  103. +
  104. if (!str1 || !str2 || !p) {
  105. return False;
  106. }
  107. @@ -3238,6 +3250,10 @@ static bool api_WPrintQueueCtrl(struct s
  108. struct sec_desc_buf secdesc_ctr;
  109. enum spoolss_PrinterControl command;
  110. +#ifndef PRINTER_SUPPORT
  111. + return False;
  112. +#endif
  113. +
  114. if (!str1 || !str2 || !QueueName) {
  115. return False;
  116. }
  117. @@ -3404,6 +3420,10 @@ static bool api_PrintJobInfo(struct smbd
  118. union spoolss_JobInfo info;
  119. struct spoolss_SetJobInfo1 info1;
  120. +#ifndef PRINTER_SUPPORT
  121. + return False;
  122. +#endif
  123. +
  124. if (!str1 || !str2 || !p) {
  125. return False;
  126. }
  127. @@ -4547,6 +4567,10 @@ static bool api_WPrintJobGetInfo(struct
  128. struct spoolss_DevmodeContainer devmode_ctr;
  129. union spoolss_JobInfo info;
  130. +#ifndef PRINTER_SUPPORT
  131. + return False;
  132. +#endif
  133. +
  134. if (!str1 || !str2 || !p) {
  135. return False;
  136. }
  137. @@ -4685,6 +4709,10 @@ static bool api_WPrintJobEnumerate(struc
  138. uint32_t count = 0;
  139. union spoolss_JobInfo *info;
  140. +#ifndef PRINTER_SUPPORT
  141. + return False;
  142. +#endif
  143. +
  144. if (!str1 || !str2 || !p) {
  145. return False;
  146. }
  147. @@ -4890,6 +4918,10 @@ static bool api_WPrintDestGetInfo(struct
  148. struct spoolss_DevmodeContainer devmode_ctr;
  149. union spoolss_PrinterInfo info;
  150. +#ifndef PRINTER_SUPPORT
  151. + return False;
  152. +#endif
  153. +
  154. if (!str1 || !str2 || !p) {
  155. return False;
  156. }
  157. @@ -5026,6 +5058,10 @@ static bool api_WPrintDestEnum(struct sm
  158. union spoolss_PrinterInfo *info;
  159. uint32_t count;
  160. +#ifndef PRINTER_SUPPORT
  161. + return False;
  162. +#endif
  163. +
  164. if (!str1 || !str2 || !p) {
  165. return False;
  166. }
  167. @@ -5129,6 +5165,10 @@ static bool api_WPrintDriverEnum(struct
  168. int succnt;
  169. struct pack_desc desc;
  170. +#ifndef PRINTER_SUPPORT
  171. + return False;
  172. +#endif
  173. +
  174. if (!str1 || !str2 || !p) {
  175. return False;
  176. }
  177. @@ -5193,6 +5233,10 @@ static bool api_WPrintQProcEnum(struct s
  178. int succnt;
  179. struct pack_desc desc;
  180. +#ifndef PRINTER_SUPPORT
  181. + return False;
  182. +#endif
  183. +
  184. if (!str1 || !str2 || !p) {
  185. return False;
  186. }
  187. @@ -5257,6 +5301,10 @@ static bool api_WPrintPortEnum(struct sm
  188. int succnt;
  189. struct pack_desc desc;
  190. +#ifndef PRINTER_SUPPORT
  191. + return False;
  192. +#endif
  193. +
  194. if (!str1 || !str2 || !p) {
  195. return False;
  196. }
  197. --- a/source3/smbd/server_exit.c
  198. +++ b/source3/smbd/server_exit.c
  199. @@ -141,7 +141,9 @@ static void exit_server_common(enum serv
  200. rpc_eventlog_shutdown();
  201. rpc_ntsvcs_shutdown();
  202. rpc_svcctl_shutdown();
  203. +#ifdef PRINTER_SUPPORT
  204. rpc_spoolss_shutdown();
  205. +#endif
  206. rpc_srvsvc_shutdown();
  207. rpc_winreg_shutdown();
  208. --- a/source3/smbd/open.c
  209. +++ b/source3/smbd/open.c
  210. @@ -1608,6 +1608,9 @@ static NTSTATUS open_file_ntcreate(conne
  211. * Most of the passed parameters are ignored.
  212. */
  213. +#ifndef PRINTER_SUPPORT
  214. + return NT_STATUS_ACCESS_DENIED;
  215. +#endif
  216. if (pinfo) {
  217. *pinfo = FILE_WAS_CREATED;
  218. }
  219. --- a/source3/smbd/close.c
  220. +++ b/source3/smbd/close.c
  221. @@ -643,6 +643,9 @@ static NTSTATUS close_normal_file(struct
  222. status = ntstatus_keeperror(status, tmp);
  223. if (fsp->print_file) {
  224. +#ifndef PRINTER_SUPPORT
  225. + return NT_STATUS_OK;
  226. +#endif
  227. /* FIXME: return spool errors */
  228. print_spool_end(fsp, close_type);
  229. file_free(req, fsp);
  230. --- a/source3/smbd/fileio.c
  231. +++ b/source3/smbd/fileio.c
  232. @@ -298,6 +298,10 @@ ssize_t write_file(struct smb_request *r
  233. uint32_t t;
  234. int ret;
  235. +#ifndef PRINTER_SUPPORT
  236. + return -1;
  237. +#endif
  238. +
  239. ret = print_spool_write(fsp, data, n, pos, &t);
  240. if (ret) {
  241. errno = ret;
  242. --- a/source3/smbd/smb2_create.c
  243. +++ b/source3/smbd/smb2_create.c
  244. @@ -486,7 +486,10 @@ static struct tevent_req *smbd_smb2_crea
  245. info = FILE_WAS_OPENED;
  246. } else if (CAN_PRINT(smb1req->conn)) {
  247. status = file_new(smb1req, smb1req->conn, &result);
  248. - if(!NT_STATUS_IS_OK(status)) {
  249. +#ifdef PRINTER_SUPPORT
  250. + if(!NT_STATUS_IS_OK(status))
  251. +#endif
  252. + {
  253. tevent_req_nterror(req, status);
  254. return tevent_req_post(req, ev);
  255. }
  256. --- a/source3/rpc_server/svcctl/srv_svcctl_nt.c
  257. +++ b/source3/rpc_server/svcctl/srv_svcctl_nt.c
  258. @@ -85,9 +85,11 @@ bool init_service_op_table( void )
  259. /* add builtin services */
  260. +#ifdef PRINTER_SUPPORT
  261. svcctl_ops[i].name = talloc_strdup( svcctl_ops, "Spooler" );
  262. svcctl_ops[i].ops = &spoolss_svc_ops;
  263. i++;
  264. +#endif
  265. svcctl_ops[i].name = talloc_strdup( svcctl_ops, "NETLOGON" );
  266. svcctl_ops[i].ops = &netlogon_svc_ops;
  267. --- a/source3/librpc/rpc/rpc_common.c
  268. +++ b/source3/librpc/rpc/rpc_common.c
  269. @@ -113,9 +113,11 @@ static bool initialize_interfaces(void)
  270. if (!smb_register_ndr_interface(&ndr_table_winreg)) {
  271. return false;
  272. }
  273. +#ifdef PRINTER_SUPPORT
  274. if (!smb_register_ndr_interface(&ndr_table_spoolss)) {
  275. return false;
  276. }
  277. +#endif
  278. if (!smb_register_ndr_interface(&ndr_table_netdfs)) {
  279. return false;
  280. }
  281. --- a/source3/smbd/process.c
  282. +++ b/source3/smbd/process.c
  283. @@ -2423,8 +2423,10 @@ static bool housekeeping_fn(const struct
  284. change_to_root_user();
  285. +#ifdef PRINTER_SUPPORT
  286. /* update printer queue caches if necessary */
  287. update_monitored_printq_cache(sconn->msg_ctx);
  288. +#endif
  289. /* check if we need to reload services */
  290. check_reload(sconn, time_mono(NULL));
  291. --- a/source3/smbd/server.c
  292. +++ b/source3/smbd/server.c
  293. @@ -123,7 +123,9 @@ static void smb_pcap_updated(struct mess
  294. {
  295. struct tevent_context *ev_ctx =
  296. talloc_get_type_abort(private_data, struct tevent_context);
  297. -
  298. +#ifndef PRINTER_SUPPORT
  299. + return;
  300. +#endif
  301. DEBUG(10,("Got message saying pcap was updated. Reloading.\n"));
  302. change_to_root_user();
  303. reload_printers(ev_ctx, msg);
  304. @@ -1277,6 +1279,7 @@ extern void build_options(bool screen);
  305. * The print backend init also migrates the printing tdb's,
  306. * this requires a winreg pipe.
  307. */
  308. +#ifdef PRINTER_SUPPORT
  309. if (!print_backend_init(smbd_messaging_context()))
  310. exit(1);
  311. @@ -1315,7 +1318,7 @@ extern void build_options(bool screen);
  312. smbd_messaging_context());
  313. }
  314. }
  315. -
  316. +#endif
  317. if (!is_daemon) {
  318. /* inetd mode */
  319. TALLOC_FREE(frame);