BOOL lp_ssl_reqClientCert(void);
BOOL lp_ssl_reqServerCert(void);
BOOL lp_ssl_compatibility(void);
+BOOL lp_ms_add_printer_wizard(void);
BOOL lp_dns_proxy(void);
BOOL lp_wins_support(void);
BOOL lp_we_are_a_wins_server(void);
uint32 *needed);
uint32 spoolss_addprinterdriver(const char *srv_name, uint32 level, PRINTER_DRIVER_CTR *info);
-/*The following definitions come from rpc_client/cli_spoolss_notify.c */
-
-BOOL spoolss_disconnect_from_client( struct cli_state *cli);
-BOOL spoolss_connect_to_client( struct cli_state *cli, char *remote_machine);
-BOOL cli_spoolss_reply_open_printer(struct cli_state *cli, char *printer, uint32 localprinter, uint32 type, uint32 *status, POLICY_HND *handle);
-BOOL cli_spoolss_reply_rrpcn(struct cli_state *cli, POLICY_HND *handle,
- uint32 change_low, uint32 change_high, uint32 *status);
-BOOL cli_spoolss_reply_close_printer(struct cli_state *cli, POLICY_HND *handle, uint32 *status);
-
/*The following definitions come from rpc_client/cli_srvsvc.c */
BOOL do_srv_net_srv_conn_enum(struct cli_state *cli,
BOOL sslReqServerCert;
BOOL sslCompatibility;
#endif /* WITH_SSL */
+ BOOL bMsAddPrinterWizard;
BOOL bDNSproxy;
BOOL bWINSsupport;
BOOL bWINSproxy;
{"enumports command", P_STRING, P_GLOBAL, &Globals.szEnumPortsCommand, NULL, NULL, 0},
{"addprinter command", P_STRING, P_GLOBAL, &Globals.szAddPrinterCommand, NULL, NULL, 0},
{"deleteprinter command", P_STRING, P_GLOBAL, &Globals.szDeletePrinterCommand, NULL, NULL, 0},
+ {"show add printer wizard", P_BOOL, P_GLOBAL, &Globals.bMsAddPrinterWizard, NULL, NULL, 0},
{"printer name", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, FLAG_PRINT},
{"printer", P_STRING, P_LOCAL, &sDefault.szPrintername, NULL, NULL, 0},
*/
+ Globals.bMsAddPrinterWizard = True;
Globals.bPreferredMaster = Auto; /* depending on bDomainMaster */
Globals.os_level = 20;
Globals.bLocalMaster = True;
FN_GLOBAL_BOOL(lp_ssl_compatibility, &Globals.sslCompatibility);
#endif /* WITH_SSL */
+FN_GLOBAL_BOOL(lp_ms_add_printer_wizard, &Globals.bMsAddPrinterWizard)
FN_GLOBAL_BOOL(lp_dns_proxy, &Globals.bDNSproxy)
FN_GLOBAL_BOOL(lp_wins_support, &Globals.bWINSsupport)
FN_GLOBAL_BOOL(lp_we_are_a_wins_server, &Globals.bWINSsupport)
return False;
smb_connections--;
+
+ return True;
}
/****************************************************************************
DEBUGADD(10,("Unlinking output file [%s]\n", tmp_file));
unlink(tmp_file);
- // Send SIGHUP to process group... is there a better way?
+ /* Send SIGHUP to process group... is there a better way? */
kill(0, SIGHUP);
if ( ( i = lp_servicenumber( Printer->dev.handlename ) ) >= 0 ) {
{
Printer_entry *new_printer;
+ DEBUG(10,("open_printer_hnd: name [%s]\n", name));
clear_handle(hnd);
create_printer_hnd(hnd);
return False;
}
+
+ return True;
}
/***************************************************************************
fstrcpy(printer, "");
srv_spoolss_receive_message(printer);
+
+ return True;
}
/********************************************************************
return ERROR_ACCESS_DENIED;
}
+ /* Disallow MS AddPrinterWizard if access rights are insufficient OR
+ if parameter disables it. The client tries an OpenPrinterEx with
+ SERVER_ALL_ACCESS(0xf0003), which we force to fail. It then tries
+ OpenPrinterEx with SERVER_READ(0x20002) which we allow. This lets
+ it see any printers there, but does not show the MSAPW */
+ if (handle_is_printserver(handle) &&
+ printer_default->access_required != (SERVER_READ) &&
+ !lp_ms_add_printer_wizard() ) {
+ return ERROR_ACCESS_DENIED;
+ }
+
return NT_STATUS_NO_PROBLEMO;
}
if(!cli_spoolss_reply_open_printer(&cli, printer, localprinter, type, &status, handle))
return False;
+
+ return True;
}
/********************************************************************
unlink(tmp_file);
if(numlines) {
- // Set the portname to what the script says the portname should be
+ /* Set the portname to what the script says the portname should be. */
strncpy(printer->info_2->portname, qlines[0], sizeof(printer->info_2->portname));
DEBUGADD(6,("Line[0] = [%s]\n", qlines[0]));
- // Send SIGHUP to process group... is there a better way?
+ /* Send SIGHUP to process group... is there a better way? */
kill(0, SIGHUP);
add_all_printers();
}
DEBUG(10,("Returned [%d]\n", ret));
if (ret != 0) {
unlink(tmp_file);
- // Is this the best error to return here?
+ /* Is this the best error to return here? */
return ERROR_ACCESS_DENIED;
}
DEBUGADD(10,("returned [%d]\n", ret));
if (ret != 0) {
unlink(tmp_file);
- // Is this the best error to return here?
+ /* Is this the best error to return here? */
return ERROR_ACCESS_DENIED;
}