Remove a redundant reference to rpc_pipe_state->cli from srv_spoolss
[jra/samba/.git] / source / rpc_server / srv_spoolss_nt.c
index 3758c8fd63ed9cbaeb2198f913599198e71af486..722ad5495106b0f73877ecd70850717addc93d62 100644 (file)
@@ -521,7 +521,13 @@ static bool set_printer_hnd_name(Printer_entry *Printer, char *handlename)
                fstrcpy(sname, lp_servicename(snum));
 
                printer = NULL;
-               result = get_a_printer( NULL, &printer, 2, sname );
+
+               /* This call doesn't fill in the location or comment from
+                * a CUPS server for efficiency with large numbers of printers.
+                * JRA.
+                */
+
+               result = get_a_printer_search( NULL, &printer, 2, sname );
                if ( !W_ERROR_IS_OK(result) ) {
                        DEBUG(0,("set_printer_hnd_name: failed to lookup printer [%s] -- result [%s]\n",
                                sname, dos_errstr(result)));
@@ -2603,10 +2609,6 @@ static bool spoolss_connect_to_client(struct rpc_pipe_client **pp_pipe,
                return False;
        }
 
-       /* make sure to save the cli_state pointer.  Keep its own talloc_ctx */
-
-       (*pp_pipe)->cli = the_cli;
-
        return True;
 }
 
@@ -6033,7 +6035,11 @@ static WERROR update_printer_sec(POLICY_HND *handle, uint32 level,
        /* NT seems to like setting the security descriptor even though
           nothing may have actually changed. */
 
-       nt_printing_getsec(p->mem_ctx, Printer->sharename, &old_secdesc_ctr);
+       if ( !nt_printing_getsec(p->mem_ctx, Printer->sharename, &old_secdesc_ctr)) {
+               DEBUG(2,("update_printer_sec: nt_printing_getsec() failed\n"));
+               result = WERR_BADFID;
+               goto done;
+       }
 
        if (DEBUGLEVEL >= 10) {
                SEC_ACL *the_acl;