On Fri, Mar 18, 2011 at 10:12:59AM -0700, Jeremy Allison wrote:
> Missing attachment :-). Can you add it to v3-6-test and
> master. I really think we need this one :-).

The mailing list ate it. Here they are inline.

Volker


>From 810d7e464dfaa575b1a6ac49531caa40719da795 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <[email protected]>
Date: Fri, 18 Mar 2011 16:12:42 +0100
Subject: [PATCH] s3: Add "spoolss backchannel" parameter

---
 .../smbdotconf/printing/spoolssbackchannel.xml     |   16 ++++++++++++++++
 source3/include/proto.h                            |    1 +
 source3/param/loadparm.c                           |   12 ++++++++++++
 source3/rpc_server/srv_spoolss_nt.c                |    6 ++++++
 4 files changed, 35 insertions(+), 0 deletions(-)
 create mode 100644 docs-xml/smbdotconf/printing/spoolssbackchannel.xml

diff --git a/docs-xml/smbdotconf/printing/spoolssbackchannel.xml 
b/docs-xml/smbdotconf/printing/spoolssbackchannel.xml
new file mode 100644
index 0000000..dc168fe
--- /dev/null
+++ b/docs-xml/smbdotconf/printing/spoolssbackchannel.xml
@@ -0,0 +1,16 @@
+<samba:parameter name="spoolss backchannel"
+                 context="S"
+                                print="1"
+                                type="boolean"
+                 xmlns:samba="http://www.samba.org/samba/DTD/samba-doc";>
+<synonym>print ok</synonym>
+<description>
+  <para>Windows print clients often demand that the server opens
+    connections back to them. Due to firewall settings this can cause
+    considerable timeouts. By setting this parameter to
+    <constant>no</constant> the Samba print server will not even try
+    to connect to clients and treat corresponding requests as if the
+    connection back to the client failed.
+</description>
+<value type="default">yes</value>
+</samba:parameter>
diff --git a/source3/include/proto.h b/source3/include/proto.h
index ef80b92..3b0f28b 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -4186,6 +4186,7 @@ bool lp_guest_ok(int );
 bool lp_guest_only(int );
 bool lp_administrative_share(int );
 bool lp_print_ok(int );
+bool lp_spoolss_backchannel(int );
 bool lp_map_hidden(int );
 bool lp_map_archive(int );
 bool lp_store_dos_attributes(int );
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 76e2303..d88327e 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -450,6 +450,7 @@ struct service {
        bool bAdministrative_share;
        bool bGuest_ok;
        bool bPrint_ok;
+       bool bSpoolssBackchannel;
        bool bMap_system;
        bool bMap_hidden;
        bool bMap_archive;
@@ -594,6 +595,7 @@ static struct service sDefault = {
        False,                  /* bAdministrative_share */
        False,                  /* bGuest_ok */
        False,                  /* bPrint_ok */
+       True,                   /* bSpoolssBackchannel */
        False,                  /* bMap_system */
        False,                  /* bMap_hidden */
        True,                   /* bMap_archive */
@@ -2642,6 +2644,15 @@ static struct parm_struct parm_table[] = {
                .flags          = FLAG_HIDE,
        },
        {
+               .label          = "spoolss backchannel",
+               .type           = P_BOOL,
+               .p_class        = P_LOCAL,
+               .ptr            = &sDefault.bSpoolssBackchannel,
+               .special        = NULL,
+               .enum_list      = NULL,
+               .flags          = FLAG_ADVANCED,
+       },
+       {
                .label          = "printing",
                .type           = P_ENUM,
                .p_class        = P_LOCAL,
@@ -5665,6 +5676,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_spoolss_backchannel, bSpoolssBackchannel)
 FN_LOCAL_BOOL(lp_map_hidden, bMap_hidden)
 FN_LOCAL_BOOL(lp_map_archive, bMap_archive)
 FN_LOCAL_BOOL(lp_store_dos_attributes, bStoreDosAttributes)
diff --git a/source3/rpc_server/srv_spoolss_nt.c 
b/source3/rpc_server/srv_spoolss_nt.c
index afc27fe..5fb00d0 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -2617,6 +2617,12 @@ WERROR 
_spoolss_RemoteFindFirstPrinterChangeNotifyEx(pipes_struct *p,
                return WERR_SERVER_UNAVAILABLE;
        }
 
+       if (!lp_spoolss_backchannel(snum)) {
+               DEBUG(10, ("_spoolss_RemoteFindFirstPrinterChangeNotifyEx: "
+                          "backchannel disabled\n"));
+               return WERR_SERVER_UNAVAILABLE;
+       }
+
        if (!interpret_string_addr(&client_ss, p->client_address,
                                   AI_NUMERICHOST)) {
                return WERR_SERVER_UNAVAILABLE;
-- 
1.7.0.4




>From 34e68e7a378f3bd89eea836aefef5477b518d5ee Mon Sep 17 00:00:00 2001
From: Volker Lendecke <[email protected]>
Date: Fri, 18 Mar 2011 16:12:42 +0100
Subject: [PATCH] s3: Add "spoolss backchannel" parameter

---
 .../smbdotconf/printing/spoolssbackchannel.xml     |   16 ++++++++++++++++
 source3/include/proto.h                            |    1 +
 source3/param/loadparm.c                           |   12 ++++++++++++
 source3/rpc_server/spoolss/srv_spoolss_nt.c        |    6 ++++++
 4 files changed, 35 insertions(+), 0 deletions(-)
 create mode 100644 docs-xml/smbdotconf/printing/spoolssbackchannel.xml

diff --git a/docs-xml/smbdotconf/printing/spoolssbackchannel.xml 
b/docs-xml/smbdotconf/printing/spoolssbackchannel.xml
new file mode 100644
index 0000000..dc168fe
--- /dev/null
+++ b/docs-xml/smbdotconf/printing/spoolssbackchannel.xml
@@ -0,0 +1,16 @@
+<samba:parameter name="spoolss backchannel"
+                 context="S"
+                                print="1"
+                                type="boolean"
+                 xmlns:samba="http://www.samba.org/samba/DTD/samba-doc";>
+<synonym>print ok</synonym>
+<description>
+  <para>Windows print clients often demand that the server opens
+    connections back to them. Due to firewall settings this can cause
+    considerable timeouts. By setting this parameter to
+    <constant>no</constant> the Samba print server will not even try
+    to connect to clients and treat corresponding requests as if the
+    connection back to the client failed.
+</description>
+<value type="default">yes</value>
+</samba:parameter>
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 78965de..f58fb12 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -3200,6 +3200,7 @@ bool lp_guest_ok(int );
 bool lp_guest_only(int );
 bool lp_administrative_share(int );
 bool lp_print_ok(int );
+bool lp_spoolss_backchannel(int );
 bool lp_map_hidden(int );
 bool lp_map_archive(int );
 bool lp_store_dos_attributes(int );
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 3314ad2..7ca5543 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -474,6 +474,7 @@ struct service {
        bool bAdministrative_share;
        bool bGuest_ok;
        bool bPrint_ok;
+       bool bSpoolssBackchannel;
        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,                   /* bSpoolssBackchannel */
        False,                  /* bMap_system */
        False,                  /* bMap_hidden */
        True,                   /* bMap_archive */
@@ -2722,6 +2724,15 @@ static struct parm_struct parm_table[] = {
                .flags          = FLAG_HIDE,
        },
        {
+               .label          = "spoolss backchannel",
+               .type           = P_BOOL,
+               .p_class        = P_LOCAL,
+               .ptr            = &sDefault.bSpoolssBackchannel,
+               .special        = NULL,
+               .enum_list      = NULL,
+               .flags          = FLAG_ADVANCED,
+       },
+       {
                .label          = "printing",
                .type           = P_ENUM,
                .p_class        = P_LOCAL,
@@ -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_spoolss_backchannel, bSpoolssBackchannel)
 FN_LOCAL_BOOL(lp_map_hidden, bMap_hidden)
 FN_LOCAL_BOOL(lp_map_archive, bMap_archive)
 FN_LOCAL_BOOL(lp_store_dos_attributes, bStoreDosAttributes)
diff --git a/source3/rpc_server/spoolss/srv_spoolss_nt.c 
b/source3/rpc_server/spoolss/srv_spoolss_nt.c
index 3026a88..3a5b060 100644
--- a/source3/rpc_server/spoolss/srv_spoolss_nt.c
+++ b/source3/rpc_server/spoolss/srv_spoolss_nt.c
@@ -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_spoolss_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;
-- 
1.7.0.4

-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba

Reply via email to