r3065: BUG 1519 (more): apparently the server_name notify request is used to fill...
authorGerald Carter <jerry@samba.org>
Tue, 19 Oct 2004 14:45:48 +0000 (14:45 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:53:00 +0000 (10:53 -0500)
(This used to be commit fc691572c9ba5ae85c63db5202b7777efdbf7260)

source3/rpc_server/srv_spoolss_nt.c

index 2bdcfeff4da35d846419cd3691c0f10f578ae1a5..d096ed40219815198db6c4c26b55fe89a2e1485b 100644 (file)
@@ -2750,8 +2750,6 @@ WERROR _spoolss_rffpcnex(pipes_struct *p, SPOOL_Q_RFFPCNEX *q_u, SPOOL_R_RFFPCNE
        return WERR_OK;
 }
 
-#if 0  /* JERRY -- disabled; not used for now */
-
 /*******************************************************************
  * fill a notify_info_data with the servername
  ********************************************************************/
@@ -2762,14 +2760,10 @@ void spoolss_notify_server_name(int snum,
                                       NT_PRINTER_INFO_LEVEL *printer,
                                       TALLOC_CTX *mem_ctx) 
 {
-       pstring temp_name, temp;
+       pstring temp;
        uint32 len;
 
-       fstrcpy( temp_name, "\\\\%L" );
-       standard_sub_basic( "", temp_name, sizeof(temp_name)-1 );
-
-
-       len = rpcstr_push(temp, temp_name, sizeof(temp)-2, STR_TERMINATE);
+       len = rpcstr_push(temp, printer->info_2->servername, sizeof(temp)-2, STR_TERMINATE);
 
        data->notify_data.data.length = len;
        data->notify_data.data.string = (uint16 *)talloc(mem_ctx, len);
@@ -2782,9 +2776,6 @@ void spoolss_notify_server_name(int snum,
        memcpy(data->notify_data.data.string, temp, len);
 }
 
-#endif
-
-
 /*******************************************************************
  * fill a notify_info_data with the printername (not including the servername).
  ********************************************************************/
@@ -3457,7 +3448,7 @@ struct s_notify_info_data_table
 
 static const struct s_notify_info_data_table notify_info_data_table[] =
 {
-{ PRINTER_NOTIFY_TYPE, PRINTER_NOTIFY_SERVER_NAME,         "PRINTER_NOTIFY_SERVER_NAME",         NOTIFY_STRING,   NULL},
+{ PRINTER_NOTIFY_TYPE, PRINTER_NOTIFY_SERVER_NAME,         "PRINTER_NOTIFY_SERVER_NAME",         NOTIFY_STRING,   spoolss_notify_server_name },
 { PRINTER_NOTIFY_TYPE, PRINTER_NOTIFY_PRINTER_NAME,        "PRINTER_NOTIFY_PRINTER_NAME",        NOTIFY_STRING,   spoolss_notify_printer_name },
 { PRINTER_NOTIFY_TYPE, PRINTER_NOTIFY_SHARE_NAME,          "PRINTER_NOTIFY_SHARE_NAME",          NOTIFY_STRING,   spoolss_notify_share_name },
 { PRINTER_NOTIFY_TYPE, PRINTER_NOTIFY_PORT_NAME,           "PRINTER_NOTIFY_PORT_NAME",           NOTIFY_STRING,   spoolss_notify_port_name },
@@ -3484,7 +3475,7 @@ static const struct s_notify_info_data_table notify_info_data_table[] =
 { PRINTER_NOTIFY_TYPE, PRINTER_NOTIFY_TOTAL_BYTES,         "PRINTER_NOTIFY_TOTAL_BYTES",         NOTIFY_POINTER,   NULL },
 { PRINTER_NOTIFY_TYPE, PRINTER_NOTIFY_BYTES_PRINTED,       "PRINTER_NOTIFY_BYTES_PRINTED",       NOTIFY_POINTER,   NULL },
 { JOB_NOTIFY_TYPE,     JOB_NOTIFY_PRINTER_NAME,            "JOB_NOTIFY_PRINTER_NAME",            NOTIFY_STRING,   spoolss_notify_printer_name },
-{ JOB_NOTIFY_TYPE,     JOB_NOTIFY_MACHINE_NAME,            "JOB_NOTIFY_MACHINE_NAME",            NOTIFY_STRING,   NULL},
+{ JOB_NOTIFY_TYPE,     JOB_NOTIFY_MACHINE_NAME,            "JOB_NOTIFY_MACHINE_NAME",            NOTIFY_STRING,   spoolss_notify_server_name },
 { JOB_NOTIFY_TYPE,     JOB_NOTIFY_PORT_NAME,               "JOB_NOTIFY_PORT_NAME",               NOTIFY_STRING,   spoolss_notify_port_name },
 { JOB_NOTIFY_TYPE,     JOB_NOTIFY_USER_NAME,               "JOB_NOTIFY_USER_NAME",               NOTIFY_STRING,   spoolss_notify_username },
 { JOB_NOTIFY_TYPE,     JOB_NOTIFY_NOTIFY_NAME,             "JOB_NOTIFY_NOTIFY_NAME",             NOTIFY_STRING,   spoolss_notify_username },