s3: Add "print notify backchannel" parameter to prevent us doing the reverse print...
authorVolker Lendecke <Volker.Lendecke@SerNet.DE>
Fri, 18 Mar 2011 19:07:43 +0000 (12:07 -0700)
committerJeremy Allison <jra@samba.org>
Fri, 18 Mar 2011 19:51:45 +0000 (12:51 -0700)
(cherry picked from commit e8a8c65f2309cfa4b5a366ae4102d727cc86b5cf)

docs-xml/smbdotconf/printing/printnotifybackchannel.xml [new file with mode: 0644]
source3/include/proto.h
source3/param/loadparm.c
source3/rpc_server/spoolss/srv_spoolss_nt.c

diff --git a/docs-xml/smbdotconf/printing/printnotifybackchannel.xml b/docs-xml/smbdotconf/printing/printnotifybackchannel.xml
new file mode 100644 (file)
index 0000000..f895f9c
--- /dev/null
@@ -0,0 +1,18 @@
+<samba:parameter name="print notify backchannel"
+                context="S"
+                print="1"
+                type="boolean"
+                xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
+<description>
+<para>Windows print clients can update print queue status by expecting
+       the server to open a backchannel SMB connection to them. Due to
+       client firewall settings this can cause considerable timeouts
+       and will often fail, as there is no guarantee the client is even
+       running an SMB server. By setting this parameter to <constant>no</constant>
+       the Samba print server will not try to connect back to clients
+       and treat corresponding requests as if the connection back to
+       the client failed. The default setting of <constant>yes</constant>
+       causes smbd to attempt this connection.
+</description>
+<value type="default">yes</value>
+</samba:parameter>
index f944b2a58d149c6f3a6ddc789319188a6f35f979..9edbfc5902e6494e16e3c68bf900c6030e935879 100644 (file)
@@ -3199,6 +3199,7 @@ bool lp_guest_ok(int );
 bool lp_guest_only(int );
 bool lp_administrative_share(int );
 bool lp_print_ok(int );
+bool lp_print_notify_backchannel(int );
 bool lp_map_hidden(int );
 bool lp_map_archive(int );
 bool lp_store_dos_attributes(int );
index 3314ad26ca143bc1afffb94fd638f1e08cc7ef05..f9b8f706707d692b96557163f61b688c0cb5897d 100644 (file)
@@ -474,6 +474,7 @@ struct service {
        bool bAdministrative_share;
        bool bGuest_ok;
        bool bPrint_ok;
+       bool bPrintNotifyBackchannel;
        bool bMap_system;
        bool bMap_hidden;
        bool bMap_archive;
@@ -618,6 +619,7 @@ static struct service sDefault = {
        False,                  /* bAdministrative_share */
        False,                  /* bGuest_ok */
        False,                  /* bPrint_ok */
+       True,                   /* bPrintNotifyBackchannel */
        False,                  /* bMap_system */
        False,                  /* bMap_hidden */
        True,                   /* bMap_archive */
@@ -2712,6 +2714,15 @@ static struct parm_struct parm_table[] = {
                .enum_list      = NULL,
                .flags          = FLAG_ADVANCED | FLAG_PRINT,
        },
+       {
+               .label          = "print notify backchannel",
+               .type           = P_BOOL,
+               .p_class        = P_LOCAL,
+               .ptr            = &sDefault.bPrintNotifyBackchannel,
+               .special        = NULL,
+               .enum_list      = NULL,
+               .flags          = FLAG_ADVANCED,
+       },
        {
                .label          = "print ok",
                .type           = P_BOOL,
@@ -5918,6 +5929,7 @@ FN_LOCAL_BOOL(lp_guest_ok, bGuest_ok)
 FN_LOCAL_BOOL(lp_guest_only, bGuest_only)
 FN_LOCAL_BOOL(lp_administrative_share, bAdministrative_share)
 FN_LOCAL_BOOL(lp_print_ok, bPrint_ok)
+FN_LOCAL_BOOL(lp_print_notify_backchannel, bPrintNotifyBackchannel)
 FN_LOCAL_BOOL(lp_map_hidden, bMap_hidden)
 FN_LOCAL_BOOL(lp_map_archive, bMap_archive)
 FN_LOCAL_BOOL(lp_store_dos_attributes, bStoreDosAttributes)
index 3026a889e6602c6df1fb70875c1b6ef42e75ffc9..030324c0853680746f9620295fc7e451dcd5dbbd 100644 (file)
@@ -2736,6 +2736,12 @@ WERROR _spoolss_RemoteFindFirstPrinterChangeNotifyEx(struct pipes_struct *p,
        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;