s3/rpc_server/spoolss: remove SETUP_SPOOLSS_NOTIFY_DATA_SECDESC
[samba.git] / source3 / rpc_server / spoolss / srv_spoolss_nt.c
index c1d4dc043552cb754362a1590e96ebbc3e19f36a..588aae4eb902c995ffaca9c5b053c554d90b8939 100644 (file)
@@ -375,7 +375,7 @@ static WERROR delete_printer_hook(TALLOC_CTX *ctx, struct security_token *token,
                                  const char *sharename,
                                  struct messaging_context *msg_ctx)
 {
-       char *cmd = lp_deleteprinter_cmd(talloc_tos());
+       char *cmd = lp_deleteprinter_command(talloc_tos());
        char *command = NULL;
        int ret;
        bool is_print_op = false;
@@ -846,14 +846,6 @@ static bool is_monitoring_event(struct printer_handle *p, uint16_t notify_type,
 #define SETUP_SPOOLSS_NOTIFY_DATA_DEVMODE(_data, _devmode) \
        _data->data.devmode.devmode = _devmode;
 
-#define SETUP_SPOOLSS_NOTIFY_DATA_SECDESC(_data, _sd) \
-       _data->data.sd.sd = dup_sec_desc(mem_ctx, _sd); \
-       if (!_data->data.sd.sd) { \
-               _data->data.sd.sd_size = 0; \
-       } \
-       _data->data.sd.sd_size = \
-               ndr_size_security_descriptor(_data->data.sd.sd, 0);
-
 static void init_systemtime_buffer(TALLOC_CTX *mem_ctx,
                                   struct tm *t,
                                   const char **pp,
@@ -1515,6 +1507,7 @@ void srv_spoolss_cleanup(void)
 /**********************************************************************
  callback to receive a MSG_PRINTER_DRVUPGRADE message and interate
  over all printers, upgrading ones as necessary
+ This is now *ONLY* called inside the background lpq updater. JRA.
  **********************************************************************/
 
 void do_drv_upgrade_printer(struct messaging_context *msg,
@@ -1804,7 +1797,7 @@ WERROR _spoolss_OpenPrinterEx(struct pipes_struct *p,
 
                if ( r->in.access_mask & SERVER_ACCESS_ADMINISTER )
                {
-                       if (!lp_ms_add_printer_wizard()) {
+                       if (!lp_show_add_printer_wizard()) {
                                close_printer_handle(p, r->out.handle);
                                ZERO_STRUCTP(r->out.handle);
                                return WERR_ACCESS_DENIED;
@@ -2942,7 +2935,9 @@ static void spoolss_notify_security_desc(struct messaging_context *msg_ctx,
                                         struct spoolss_PrinterInfo2 *pinfo2,
                                         TALLOC_CTX *mem_ctx)
 {
-       SETUP_SPOOLSS_NOTIFY_DATA_SECDESC(data, pinfo2->secdesc);
+       data->data.sd.sd = dup_sec_desc(mem_ctx, pinfo2->secdesc);
+       data->data.sd.sd_size = ndr_size_security_descriptor(data->data.sd.sd,
+                                                            0);
 }
 
 /*******************************************************************
@@ -6179,7 +6174,7 @@ static bool check_printer_ok(TALLOC_CTX *mem_ctx,
 
 static WERROR add_port_hook(TALLOC_CTX *ctx, struct security_token *token, const char *portname, const char *uri)
 {
-       char *cmd = lp_addport_cmd(talloc_tos());
+       char *cmd = lp_addport_command(talloc_tos());
        char *command = NULL;
        int ret;
        bool is_print_op = false;
@@ -6240,7 +6235,7 @@ static bool add_printer_hook(TALLOC_CTX *ctx, struct security_token *token,
                             const char *remote_machine,
                             struct messaging_context *msg_ctx)
 {
-       char *cmd = lp_addprinter_cmd(talloc_tos());
+       char *cmd = lp_addprinter_command(talloc_tos());
        char **qlines;
        char *command = NULL;
        int numlines;
@@ -6795,7 +6790,7 @@ static WERROR update_printer(struct pipes_struct *p,
        /* Call addprinter hook */
        /* Check changes to see if this is really needed */
 
-       if (*lp_addprinter_cmd(talloc_tos()) &&
+       if (*lp_addprinter_command(talloc_tos()) &&
                        (!strequal(printer->drivername, old_printer->drivername) ||
                         !strequal(printer->comment, old_printer->comment) ||
                         !strequal(printer->portname, old_printer->portname) ||
@@ -7869,7 +7864,7 @@ static WERROR fill_port_2(TALLOC_CTX *mem_ctx,
 
 static WERROR enumports_hook(TALLOC_CTX *ctx, int *count, char ***lines)
 {
-       char *cmd = lp_enumports_cmd(talloc_tos());
+       char *cmd = lp_enumports_command(talloc_tos());
        char **qlines = NULL;
        char *command = NULL;
        int numlines;
@@ -8133,7 +8128,7 @@ static WERROR spoolss_addprinterex_level_2(struct pipes_struct *p,
        /* FIXME!!!  smbd should check to see if the driver is installed before
           trying to add a printer like this  --jerry */
 
-       if (*lp_addprinter_cmd(talloc_tos()) ) {
+       if (*lp_addprinter_command(talloc_tos()) ) {
                char *raddr;
 
                raddr = tsocket_address_inet_addr_string(p->remote_address,