#include "../librpc/gen_ndr/srv_spoolss.h"
#include "../librpc/gen_ndr/ndr_spoolss_c.h"
#include "rpc_client/init_spoolss.h"
+#include "rpc_client/cli_pipe.h"
#include "librpc/gen_ndr/messaging.h"
#include "../libcli/security/security.h"
#include "librpc/gen_ndr/ndr_security.h"
#include "secrets.h"
#include "../librpc/gen_ndr/netlogon.h"
#include "rpc_misc.h"
+#include "printing/notify.h"
+#include "serverid.h"
+#include "../libcli/registry/util_reg.h"
/* macros stolen from s4 spoolss server */
#define SPOOLSS_BUFFER_UNION(fn,info,level) \
return WERR_INVALID_PARAM;
}
- if (r->in.level < 0 || r->in.level > 3) {
+ if (r->in.level > 3) {
return WERR_INVALID_PARAM;
}
if ((r->in.level == 1 && !r->in.userlevel.level1) ||
struct sockaddr_storage rm_addr;
char addr[INET6_ADDRSTRLEN];
- if ( is_zero_addr((struct sockaddr *)client_ss) ) {
+ if ( is_zero_addr(client_ss) ) {
DEBUG(2,("spoolss_connect_to_client: resolving %s\n",
remote_machine));
if ( !resolve_name( remote_machine, &rm_addr, 0x20, false) ) {
DEBUG(10,("_spoolss_RemoteFindFirstPrinterChangeNotifyEx: "
"client_address is %s\n", p->client_id->addr));
+ if (!lp_print_notify_backchannel(snum)) {
+ DEBUG(10, ("_spoolss_RemoteFindFirstPrinterChangeNotifyEx: "
+ "backchannel disabled\n"));
+ return WERR_SERVER_UNAVAILABLE;
+ }
+
if (!interpret_string_addr(&client_ss, p->client_id->addr,
AI_NUMERICHOST)) {
return WERR_SERVER_UNAVAILABLE;
if ( !option )
return WERR_BADFID;
- get_printer_snum(p, hnd, &snum, NULL);
+ if (!get_printer_snum(p, hnd, &snum, NULL)) {
+ return WERR_BADFID;
+ }
/* Maybe we should use the SYSTEM session_info here... */
result = winreg_get_printer(mem_ctx,
* We are now using the change value, and
* I should check for PRINTER_NOTIFY_OPTIONS_REFRESH but as
* I don't have a global notification system, I'm sending back all the
- * informations even when _NOTHING_ has changed.
+ * information even when _NOTHING_ has changed.
*/
/* We need to keep track of the change value to send back in
goto done;
DEBUG(5,("Moving driver to final destination\n"));
- if( !W_ERROR_IS_OK(err = move_driver_to_download_area(p, r->in.info_ctr,
- &err)) ) {
+ err = move_driver_to_download_area(p, r->in.info_ctr);
+ if (!W_ERROR_IS_OK(err)) {
goto done;
}