r15975: Only call the printer publishing calls if 'security = ads'
authorGerald Carter <jerry@samba.org>
Wed, 31 May 2006 01:31:01 +0000 (01:31 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:17:15 +0000 (11:17 -0500)
(prevent a segv)
(This used to be commit a2ef525d9e3b4f050cb4e02fad67808d3e916373)

source3/rpc_server/srv_spoolss_nt.c

index 2e224896c4d3fa8fc01a432b7692fd0e6027797d..0281e3da0ca2ea30b2aa7d76bcbc08f47103d619 100644 (file)
@@ -6279,7 +6279,13 @@ static WERROR publish_or_unpublish_printer(pipes_struct *p, POLICY_HND *handle,
 #ifdef HAVE_ADS
        SPOOL_PRINTER_INFO_LEVEL_7 *info7 = info->info_7;
        int snum;
-       Printer_entry *Printer = find_printer_index_by_hnd(p, handle);
+       Printer_entry *Printer;
+
+       if ( lp_security() != SEC_ADS ) {
+               return WERR_UNKNOWN_LEVEL;
+       }
+
+       Printer = find_printer_index_by_hnd(p, handle);
 
        DEBUG(5,("publish_or_unpublish_printer, action = %d\n",info7->action));