[SCM] Samba Shared Repository - branch v3-2-stable updated - release-3-2-0pre3-48-g49be6c8

Karolin Seeger kseeger at samba.org
Mon May 5 14:52:26 GMT 2008


The branch, v3-2-stable has been updated
       via  49be6c8dac6ddb90cd3ea2324d2dbc5d7cc503dd (commit)
       via  8856bb986dfbf18ea43c6e2e57f16083dc622357 (commit)
       via  b2dfc68d856bbf8ab8bff951f73d846ca3bc32ca (commit)
       via  8e0cf54c9004d7636183aa29ec96c5722d9be667 (commit)
       via  159e4750c5fbd61a72a49ff2252fb699b89c3a1d (commit)
       via  ac2ce7e02a2ad110d7e637f4a390f9f3d777c00b (commit)
       via  231cdbdfe9a5961bcf6fe316fb17221eaa7cd691 (commit)
       via  d157c424f49c513e3a6510aca84ddafd98975ca6 (commit)
       via  43238ff9f47ebf4b3fd377e0f01c4c5215ed8de0 (commit)
       via  23c920235c5d7a7241549cd675971e0cd8044a4c (commit)
       via  1af3fab7b157266ef04c36ecba9bedf5ae181c49 (commit)
       via  2d718f0b7fa7ed53970a77e4371659d04aef9632 (commit)
       via  e788d0eebcb5289cdf886df5ab71409564c4e7ce (commit)
       via  859f512a45ac2c3b7f59624e4362382f7864cbd8 (commit)
       via  afa4d7303e116deb10137d23c93b602a12e2811d (commit)
       via  ba91013e045b94abb8706fdd7503318682bbd673 (commit)
       via  a9b00fa65e8495acd2b0f1616f1b4f9b69a56fee (commit)
       via  c3e2f35cd35589a3f4edf847d40e4a082e2ef62f (commit)
       via  6aadcc3ef949e4bfb1a8c8635d535f520140b8d4 (commit)
       via  6f5213ef802ec67ca0c915dd5a5f0b955babf024 (commit)
       via  2a473de4158867cc91d985ac11e8a99d1d52f9ef (commit)
       via  7d26767ade7d329ba719d224fa546860c03e190a (commit)
       via  b8e974022d27811f9e84c7c47fd8d58e6b24f194 (commit)
       via  d9a0e7730f5303c7397c816f01edb54a8dabc1d9 (commit)
       via  0c9c4e2ac7b5b2c661fb07075dccca90f43cbda2 (commit)
       via  9b5546a05bf2ae52293734dbeee89641e49d634d (commit)
       via  029b7663a576ac44b5ab7ccab412599f6aacf6b1 (commit)
       via  75daf868677bdaa3ebd6f9a0c8de9233a95d1c3f (commit)
       via  714be349a031ac5d50aed429d2761af552448090 (commit)
       via  74dd414e5c7be0ae3c2aac80437580dffd8ff9b2 (commit)
       via  80fc63e137c92afb4811d45a86f134581bbdc71f (commit)
       via  a40a6a34b2101f2c2ef221b700b7e99cd2672ac2 (commit)
       via  de687368b0b9e554e86459b0f75709628b69d122 (commit)
       via  d9c64508b69a70fc971da37692bdf02edf9f15fc (commit)
       via  8e84d5a7ee22e1ad19c76a7c57bb2653cacfd06f (commit)
       via  b3161ef66b4ba939353e53b9b79a0bc01e53d369 (commit)
       via  937f7a2873573c1547b1e610c86b467b5f842e1d (commit)
       via  45ed3959b77a8ba0b42b96c4c8229c9098a93c5f (commit)
       via  14264b246406cdec728d124ade5a47e463d6677b (commit)
      from  49e56637971c8ae2f091aa61c6f6c878b4accd23 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-stable


- Log -----------------------------------------------------------------
commit 49be6c8dac6ddb90cd3ea2324d2dbc5d7cc503dd
Author: Björn Jacke <bj at sernet.de>
Date:   Wed Apr 9 18:20:07 2008 +0200

    fix some extrasemi compile warnings
    
    (cherry picked from parts of cbdb79b7a1044945e515a294f487e4c1a9c91be5)

commit 8856bb986dfbf18ea43c6e2e57f16083dc622357
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Mar 6 12:44:41 2008 +0100

    Fix a "nested extern declaration" warning
    (cherry picked from commit e473e6d50c56f52ef5e4853e4ca3b3548af06f51)

commit b2dfc68d856bbf8ab8bff951f73d846ca3bc32ca
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Mar 29 17:20:15 2008 +0100

    Make use of ZERO_STRUCT instead of memset in namequery.c
    (cherry picked from commit 4f1d49615e1407b9c3ad5eeb50a248b8fee50e23)

commit 8e0cf54c9004d7636183aa29ec96c5722d9be667
Author: Michael Adam <obnox at samba.org>
Date:   Fri Apr 25 14:01:57 2008 +0200

    docs: fix indentation in expand-smbxonfdoc.
    
    Michael
    (cherry picked from commit 79f53a06820b226cbfbc939ae9a6d255e4a4a2d1)

commit 159e4750c5fbd61a72a49ff2252fb699b89c3a1d
Author: Michael Adam <obnox at samba.org>
Date:   Mon Apr 21 15:53:04 2008 +0200

    configure: fix a comment typo
    
    Michael
    (cherry picked from commit af2a1f15e6d45139ba62e334a3529d407430e6bd)

commit ac2ce7e02a2ad110d7e637f4a390f9f3d777c00b
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Mar 5 17:20:01 2008 +0100

    Fix Coverity ID 565
    
    This would crash safely
    (cherry picked from commit 0f14357c86aee9a76ffbb45ea6419f4cc4106d62)

commit 231cdbdfe9a5961bcf6fe316fb17221eaa7cd691
Author: Michael Adam <obnox at samba.org>
Date:   Fri Mar 28 15:39:52 2008 +0100

    srv_winreg: add a debug message to _winreg_CreateKey().
    
    Michael
    (cherry picked from commit 971f6749ed23523f6eafe5136f6d4c920c20aec4)

commit d157c424f49c513e3a6510aca84ddafd98975ca6
Author: James Peach <jpeach at apple.com>
Date:   Mon Apr 21 11:19:22 2008 -0700

    smbspool: Fix the smbspool build.
    (cherry picked from commit a51cb3c1a9549d74c1e5cf05bc43b955af1a25b7)

commit 43238ff9f47ebf4b3fd377e0f01c4c5215ed8de0
Author: James Peach <jpeach at apple.com>
Date:   Mon Apr 21 10:57:09 2008 -0700

    smbspool: minor formatting cleanups.
    (cherry picked from commit 831a09ae25e98eacc0b0be5390d3ac3aa671a8a5)

commit 23c920235c5d7a7241549cd675971e0cd8044a4c
Author: James Peach <jpeach at apple.com>
Date:   Mon Apr 21 10:10:29 2008 -0700

    smbspool: Run indent to approximate conding standards.
    (cherry picked from commit 4244be792eeb69e883a1ece013b62fe6941086f2)

commit 1af3fab7b157266ef04c36ecba9bedf5ae181c49
Author: James Peach <jpeach at apple.com>
Date:   Mon Apr 21 09:29:07 2008 -0700

    smbspool: add my copyright.
    (cherry picked from commit b294b2055a422e1af59e3b6843b84750b6786d99)

commit 2d718f0b7fa7ed53970a77e4371659d04aef9632
Author: Mike Sweet <msweet at apple.com>
Date:   Mon Apr 21 09:19:51 2008 -0700

    smbspool: Fix CUPS authentication protocol support.
    
    There were a couple of places where we weren't checking for
    authentication correctly. This chance fixes those places and properly
    supports Kerberos where available.
    (cherry picked from commit 8eff35bc4acc13807c895af43b52db79ee195cb5)

commit e788d0eebcb5289cdf886df5ab71409564c4e7ce
Author: Mike Sweet <msweet at apple.com>
Date:   Mon Apr 21 09:16:01 2008 -0700

    smbspool: fix Kerberos support for CUPS 1.3.
    
    To summarize the changes, the patches remove the old (probably non-
    working) Kerberos support code which is unnecessary with CUPS 1.3
    and adds some checks on the NT status we get back to see whether
    the connection error is related to authentication.  If so, we send
    the ATTR: message to tell CUPS we need a username and password and
    return exit code 2 so cupsd will do the right thing.
    
    AUTH_USERNAME, AUTH_PASSWORD, and KRB5CCNAME are set and supported
    by CUPS 1.3.  The new exit code is supported by CUPS 1.2.x and 1.3,
    and it treated as a general failure in CUPS 1.1.  The ATTR: message
    is only supported by CUPS 1.3, while CUPS 1.2 will assume the
    "username,password" value we are setting.
    
    The current code only uses the AUTH_* env vars if they are set.
    If not, we fall back to the previous behavior.
    
    I really can't tell whether the Kerberos code that was in there
    would work at all. It did not work for Mac OS X which is why
    I dropped it.
    (cherry picked from commit 8c12c5cea01d9b801fe80c2a87b8139c488a62a5)

commit 859f512a45ac2c3b7f59624e4362382f7864cbd8
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Mar 20 16:15:38 2008 +0100

    Fix an uninitialized variable warning
    (cherry picked from commit 4cc09ec40609484c973361a0cc0f05bfaef1738e)

commit afa4d7303e116deb10137d23c93b602a12e2811d
Author: Michael Adam <obnox at samba.org>
Date:   Wed Mar 12 02:10:35 2008 +0100

    init_srv_share_info_ctr: Add debug messages.
    
    Michael
    (cherry picked from commit 8b2cc36ffcb3bccb760ec7cb0a22558eab56070d)

commit ba91013e045b94abb8706fdd7503318682bbd673
Author: Günther Deschner <gd at samba.org>
Date:   Wed Mar 26 11:45:28 2008 +0100

    Strip whitespace in ntsvcs rpc server.
    
    Guenther
    (cherry picked from commit 0c7af8bc136f45484eab3c36b761046f88653b93)

commit a9b00fa65e8495acd2b0f1616f1b4f9b69a56fee
Author: Michael Adam <obnox at samba.org>
Date:   Mon Apr 21 00:20:35 2008 +0200

    loadparm: reformat - fix whitespace/tab
    
    Michael
    (cherry picked from commit 3acc0d84dc8f29b67ddaa1124224a93cb43b07ad)

commit c3e2f35cd35589a3f4edf847d40e4a082e2ef62f
Author: Günther Deschner <gd at samba.org>
Date:   Wed Mar 26 22:25:51 2008 +0100

    Fix typo.
    
    Guenther
    (cherry picked from commit ffe77dc8b0476b7a5d81d63c3cf67f81033df12e)

commit 6aadcc3ef949e4bfb1a8c8635d535f520140b8d4
Author: Günther Deschner <gd at samba.org>
Date:   Mon Apr 21 10:25:28 2008 +0200

    samlogoncache: Use data_blob_const in netsamlogon_cache_get.
    
    Guenther
    (cherry picked from commit f27a20f25c9b2038621a6394821bbedbf17daa73)

commit 6f5213ef802ec67ca0c915dd5a5f0b955babf024
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Mar 30 22:08:17 2008 +0200

    Remove two pointless else branches
    (cherry picked from commit ed343114cd0844a7fd14b45f95c0f43a6d172a42)

commit 2a473de4158867cc91d985ac11e8a99d1d52f9ef
Author: Eric Cronin <ecronin at gizmolabs.org>
Date:   Mon Mar 24 12:33:04 2008 -0700

    Missing HAVE_UPDWTMPX check before using updwtmpx().
    
    In 10.5 Mac OS X added enough utmpx support to make it past the
    first two preprocessor checks around line 390 of src/smbd/utmp.c
    and on to the utmpx block which uses updwtmpx().  Unfortunately,
    as ./configure correctly surmised, 10.5 doesn't have that.
    
    https://bugzilla.samba.org/show_bug.cgi?id=5184
    (cherry picked from commit f19d1e3d93d0d9dfe80372c6c5635f1047f9aa88)

commit 7d26767ade7d329ba719d224fa546860c03e190a
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Apr 24 14:04:47 2008 -0700

    The first of Martin Zielinski <mz at seh.de> Vista printing patches.
    Jerry will test and should get into 3.2 final (and the next 3.0.x
    release).
    Jeremy.
    (cherry picked from commit 3fc1ab210b8772ee9f867499c0b1a7bb4bcdd285)

commit b8e974022d27811f9e84c7c47fd8d58e6b24f194
Author: Michael Adam <obnox at samba.org>
Date:   Sun Apr 20 22:06:37 2008 +0200

    rpc_parse: fix "assignment discards qualifier" warning by using CONST_DISCARD.
    
    Michael
    (cherry picked from commit 0de001a5446545b928eb88e1916b4fe674017424)

commit d9a0e7730f5303c7397c816f01edb54a8dabc1d9
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Apr 19 17:04:46 2008 +0200

    Fix an uninitialized variable
    (cherry picked from commit 825f78d9f12b5b3e835bd91961e00402cab0bf60)

commit 0c9c4e2ac7b5b2c661fb07075dccca90f43cbda2
Author: Michael Adam <obnox at samba.org>
Date:   Sun Apr 20 21:49:01 2008 +0200

    vfs_cacheprime: fix C++ warning - make implicit cast explicit
    
    Michael
    (cherry picked from commit 04d671b8c9bd5bf811e6dbd6981f1874eb49740c)

commit 9b5546a05bf2ae52293734dbeee89641e49d634d
Author: Günther Deschner <gd at samba.org>
Date:   Thu Apr 24 22:19:23 2008 +0200

    errors: add WERR_INVALID_DOMAINNAME.
    
    Guenther
    (cherry picked from commit b11a5e70d38239fb50ba4606656e2168cc398a12)

commit 029b7663a576ac44b5ab7ccab412599f6aacf6b1
Author: Alexander Bokovoy <ab at samba.org>
Date:   Mon Apr 14 13:56:36 2008 +0400

    Use more error-prone form of testing dm_destroy_session() return code after discussing with Tridge
    (cherry picked from commit 4abdbad52e456764bca1b17ead04edee1e2a2a64)

commit 75daf868677bdaa3ebd6f9a0c8de9233a95d1c3f
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Apr 24 15:02:23 2008 -0700

    Fix from Martin Zielinski <mz at seh.de>. Don't delete files when
    they're in use by other drivers.
    Jeremy.
    (cherry picked from commit 205c352caeb32693a02fcfaeb3f18515719ac373)

commit 714be349a031ac5d50aed429d2761af552448090
Author: Björn Jacke <bj at sernet.de>
Date:   Mon Apr 7 11:22:14 2008 +0200

    increase log level for this failed setsockopt call. EINVAL is a normal error on Solaris when we do this on an already resetted connection.
    (cherry picked from commit 42bc4ff7fd6bfc92bde015ae8f3a9fb62d443cd5)

commit 74dd414e5c7be0ae3c2aac80437580dffd8ff9b2
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Mar 5 16:28:43 2008 +0100

    Fix a memleak -- Coverity ID 222
    (cherry picked from commit a40781bafa3a8f0c7737164bca6cf74b0a452e72)
    (cherry picked from commit 86cabcad74ac06d888f2a352a2bef3abea1ed85c)

commit 80fc63e137c92afb4811d45a86f134581bbdc71f
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Apr 2 15:54:49 2008 +0200

    Fix some "ignoring asprintf result" warnings
    (cherry picked from commit 155d62ddfd3584d44a493c2aa1ea7f096bcff432)

commit a40a6a34b2101f2c2ef221b700b7e99cd2672ac2
Author: Günther Deschner <gd at samba.org>
Date:   Sat Apr 12 18:26:37 2008 +0200

    Fill in WHATSNEW.txt for pre3.
    
    Guenther
    (cherry picked from commit bf638d97d7668292ef9abf890eebc402645b8327)

commit de687368b0b9e554e86459b0f75709628b69d122
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Apr 19 13:08:14 2008 +0200

    Fix bug 5398
    
    Thanks to Jason Mader for sending the compiler output :-)
    
    Volker
    (cherry picked from commit 7a57c2da1a6cc0fcea0b4d949c696219f1822694)

commit d9c64508b69a70fc971da37692bdf02edf9f15fc
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Apr 19 16:54:26 2008 +0200

    Fix bug 5399
    
    Thanks to Jason Mader!
    
    Volker
    (cherry picked from commit 36740f4959194cfaa98b1e37eed08f22edbda1e4)

commit 8e84d5a7ee22e1ad19c76a7c57bb2653cacfd06f
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Mon Apr 21 17:48:31 2008 +0200

    Add in a nice big comment explaining why SamLogonEx matters.
    
    Andrew Bartlett
    (cherry picked from commit 87232351b5e66728f8d602259961909e8c1dfcb6)

commit b3161ef66b4ba939353e53b9b79a0bc01e53d369
Author: Michael Adam <obnox at samba.org>
Date:   Wed Apr 23 14:55:51 2008 +0200

    winbindd_cache: simplify logic in new key length check for UA keys.
    
    This reduces indentation by combining common code paths,
    and wraps long lines.
    
    Holger: sorry, I could not resist. I think it is much easier to
    understand what is going on when we only have one check and
    determine the max allowed key length in advance.
    
    Michael
    (cherry picked from commit e489f3d988feafe35b486b31a9e60c2399e6a6e7)

commit 937f7a2873573c1547b1e610c86b467b5f842e1d
Author: Holger Hetterich <hhetter at novell.com>
Date:   Fri Apr 11 14:02:19 2008 +0200

    winbindd_cache: recognize and allow longer UA keys
    
    UA keys consist of a potientally large number of concatenated SID strings which
    can grow much larger than 1024 bytes in complex environments. We catch those keys
    and allow them exclusivly to be larger.
    (cherry picked from commit fcd35232e111f9b046ae35d939d08c29d0d43438)

commit 45ed3959b77a8ba0b42b96c4c8229c9098a93c5f
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Apr 25 08:29:08 2008 -0700

    Remove hard coded sizes.
    Jeremy.
    (cherry picked from commit b9eec6e73fbcd0256d5cc507bb4434976d7133a0)

commit 14264b246406cdec728d124ade5a47e463d6677b
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Apr 19 16:56:44 2008 +0200

    Fix bug 5400
    
    Thanks to Jason Mader!
    
    Volker
    (cherry picked from commit 87d8a63ce4e6dd91ea3193d0a2574520a5857be2)

-----------------------------------------------------------------------

Summary of changes:
 WHATSNEW.txt                           |   16 +
 docs-xml/xslt/expand-smbconfdoc.xsl    |   18 +-
 source/client/mount.cifs.c             |    6 +-
 source/client/smbspool.c               | 1104 ++++++++++++++++----------------
 source/configure.in                    |    2 +-
 source/include/doserr.h                |    1 +
 source/lib/messages_ctdbd.c            |    2 +-
 source/lib/talloc/talloc.c             |    4 +-
 source/lib/util_sock.c                 |    5 +-
 source/libsmb/clireadwrite.c           |    5 -
 source/libsmb/doserr.c                 |    1 +
 source/libsmb/libsmb_context.c         |    3 +-
 source/libsmb/namequery.c              |    2 +-
 source/libsmb/samlogon_cache.c         |    3 +-
 source/modules/vfs_cacheprime.c        |    2 +-
 source/nsswitch/libwbclient/wbclient.c |    2 +-
 source/param/loadparm.c                |    6 +-
 source/passdb/pdb_ldap.c               |    3 +-
 source/printing/nt_printing.c          |   27 +-
 source/rpc_client/cli_netlogon.c       |    2 -
 source/rpc_parse/parse_rpc.c           |    2 +-
 source/rpc_parse/parse_spoolss.c       |    7 +-
 source/rpc_server/srv_ntsvcs_nt.c      |   26 +-
 source/rpc_server/srv_spoolss_nt.c     |    9 +-
 source/rpc_server/srv_srvsvc_nt.c      |    4 +
 source/rpc_server/srv_winreg_nt.c      |    5 +-
 source/smbd/chgpasswd.c                |    6 +-
 source/smbd/dmapi.c                    |    2 +-
 source/smbd/lanman.c                   |   30 +-
 source/smbd/nttrans.c                  |   12 +-
 source/smbd/process.c                  |   11 +-
 source/smbd/utmp.c                     |    4 +
 source/winbindd/winbindd_cache.c       |   11 +-
 source/winbindd/winbindd_pam.c         |   21 +
 34 files changed, 710 insertions(+), 654 deletions(-)


Changeset truncated at 500 lines:

diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index 05abdc4..fbd6406 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -35,6 +35,8 @@ Major enhancements in Samba 3.2.0 include:
   o Expansion of nested domain groups via NSS calls.
   o Support for Active Directory LDAP Signing policy.
   o New LGPL Winbind client library (libwbclient.so).
+  o Support for establishing interdomain trust relationships with
+    Windows 2008.
 
   Joining:
   o New NetApi library for domain join related queries (libnetapi.so)
@@ -46,6 +48,7 @@ Major enhancements in Samba 3.2.0 include:
   Users & Groups:
   o New ldb backend for local group mapping tables
   o Raised level of security defaults for authentication operations.
+  o New NetApi library for user account related queries.
 
 
   Documentation:
@@ -275,6 +278,19 @@ o   Guenther Deschner <gd at samba.org>
     * Fix the build of cifs.spnego.
     * Migration of the SRVSVC client and server DCE/RPC code to IDL
       based structures and autogenerated code
+    * Fix Kerberos session setup with Vista SP1 (ignore PAC type 12)
+    * Fix support for vampire of lockout policies and
+      for storing dialin/terminal server settings.
+    * Fix remote join/unjoin server implementation.
+    * BUG 5328: Fix netlogon credential chain with Windows 2008
+      (this also fixes joining Windows 2008 with rpc methods).
+    * Various fixes for establishing and validating interdomain trust
+      relationships with Windows 2008.
+    * Use IDL for storing domain controller information in dsgetdcname.
+    * Re-arranged internal structure of libnetapi.
+    * Add support for domain\dcname syntax in libnetjoin.
+    * Add support for browsing/joining OUs in netdomjoin-gui.
+    * Add various new calls to libnetapi.
 
 
 o   Björn Jacke <bj at sernet.de>
diff --git a/docs-xml/xslt/expand-smbconfdoc.xsl b/docs-xml/xslt/expand-smbconfdoc.xsl
index 8bb74d2..5b2de1c 100644
--- a/docs-xml/xslt/expand-smbconfdoc.xsl
+++ b/docs-xml/xslt/expand-smbconfdoc.xsl
@@ -164,15 +164,15 @@
 		</xsl:for-each>
 
 		<xsl:element name="section">
-					<xsl:element name="indexterm">
-						<xsl:attribute name="significance">
-							<xsl:text>preferred</xsl:text>
-						</xsl:attribute>
-						<xsl:element name="primary">
-						<xsl:value-of select="@name"/>
-						</xsl:element>
-					</xsl:element>
-					<xsl:copy-of select="$term"/>
+			<xsl:element name="indexterm">
+				<xsl:attribute name="significance">
+					<xsl:text>preferred</xsl:text>
+				</xsl:attribute>
+				<xsl:element name="primary">
+				<xsl:value-of select="@name"/>
+				</xsl:element>
+			</xsl:element>
+			<xsl:copy-of select="$term"/>
 			<xsl:element name="variablelist">
 				<xsl:element name="varlistentry">
 					<xsl:element name="listitem">
diff --git a/source/client/mount.cifs.c b/source/client/mount.cifs.c
index d1c7a69..c42375b 100644
--- a/source/client/mount.cifs.c
+++ b/source/client/mount.cifs.c
@@ -520,7 +520,7 @@ static int parse_options(char ** optionsp, int * filesys_flags)
 				printf("CIFS: invalid domain name\n");
 				return 1;	/* needs_arg; */
 			}
-			if (strnlen(value, 65) < 65) {
+			if (strnlen(value, DOMAIN_SIZE+1) < DOMAIN_SIZE+1) {
 				got_domain = 1;
 			} else {
 				printf("domain name too long\n");
@@ -1198,9 +1198,9 @@ int main(int argc, char ** argv)
 
 	if (getenv("PASSWD")) {
 		if(mountpassword == NULL)
-			mountpassword = (char *)calloc(65,1);
+			mountpassword = (char *)calloc(MOUNT_PASSWD_SIZE+1,1);
 		if(mountpassword) {
-			strlcpy(mountpassword,getenv("PASSWD"),MOUNT_PASSWD_SIZE);
+			strlcpy(mountpassword,getenv("PASSWD"),MOUNT_PASSWD_SIZE+1);
 			got_password = 1;
 		}
 	} else if (getenv("PASSWD_FD")) {
diff --git a/source/client/smbspool.c b/source/client/smbspool.c
index e827df4..ed5fc69 100644
--- a/source/client/smbspool.c
+++ b/source/client/smbspool.c
@@ -1,33 +1,47 @@
-/* 
+/*
    Unix SMB/CIFS implementation.
    SMB backend for the Common UNIX Printing System ("CUPS")
-   Copyright 1999 by Easy Software Products
-   Copyright Andrew Tridgell 1994-1998
-   Copyright Andrew Bartlett 2002
-   Copyright Rodrigo Fernandez-Vizarra 2005 
-   
+
+   Copyright (C) Easy Software Products	    1999
+   Copyright (C) Andrew Tridgell	    1994-1998
+   Copyright (C) Andrew Bartlett	    2002
+   Copyright (C) Rodrigo Fernandez-Vizarra  2005
+   Copyright (C) James Peach		    2008
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include "includes.h"
 
-#define TICKET_CC_DIR            "/tmp"
-#define CC_PREFIX                "krb5cc_" /* prefix of the ticket cache */
-#define CC_MAX_FILE_LEN          24   
-#define CC_MAX_FILE_PATH_LEN     (sizeof(TICKET_CC_DIR)-1)+ CC_MAX_FILE_LEN+2   
-#define OVERWRITE                1   
-#define KRB5CCNAME               "KRB5CCNAME"
+/*
+ * Starting with CUPS 1.3, Kerberos support is provided by cupsd including
+ * the forwarding of user credentials via the authenticated session between
+ * user and server and the KRB5CCNAME environment variable which will point
+ * to a temporary file or an in-memory representation depending on the version
+ * of Kerberos you use.  As a result, all of the ticket code that used to
+ * live here has been removed, and we depend on the user session (if you
+ * run smbspool by hand) or cupsd to provide the necessary Kerberos info.
+ *
+ * Also, the AUTH_USERNAME and AUTH_PASSWORD environment variables provide
+ * for per-job authentication for non-Kerberized printing.  We use those
+ * if there is no username and password specified in the device URI.
+ *
+ * Finally, if we have an authentication failure we return exit code 2
+ * which tells CUPS to hold the job for authentication and bug the user
+ * to get the necessary credentials.
+ */
+
 #define MAX_RETRY_CONNECT        3
 
 
@@ -41,523 +55,489 @@
  * Local functions...
  */
 
-static void		list_devices(void);
-static struct cli_state *smb_complete_connection(const char *, const char *,int , const char *, const char *, const char *, const char *, int);
-static struct cli_state	*smb_connect(const char *, const char *, int, const char *, const char *, const char *, const char *);
-static int		smb_print(struct cli_state *, char *, FILE *);
-static char *		uri_unescape_alloc(const char *);
+static int      get_exit_code(struct cli_state * cli, NTSTATUS nt_status);
+static void     list_devices(void);
+static struct cli_state *smb_complete_connection(const char *, const char *,
+	int, const char *, const char *, const char *, const char *, int, bool *need_auth);
+static struct cli_state *smb_connect(const char *, const char *, int, const
+	char *, const char *, const char *, const char *, bool *need_auth);
+static int      smb_print(struct cli_state *, char *, FILE *);
+static char    *uri_unescape_alloc(const char *);
 #if 0
-static bool smb_encrypt;
+static bool     smb_encrypt;
 #endif
 
 /*
  * 'main()' - Main entry for SMB backend.
  */
 
- int				/* O - Exit status */
- main(int  argc,			/* I - Number of command-line arguments */
-     char *argv[])		/* I - Command-line arguments */
-{
-  int		i;		/* Looping var */
-  int		copies;		/* Number of copies */
-  int 		port;		/* Port number */
-  char		uri[1024],	/* URI */
-		*sep,		/* Pointer to separator */
-		*tmp, *tmp2,	/* Temp pointers to do escaping */
-		*password;	/* Password */
-  char		*username,	/* Username */
-		*server,	/* Server name */
-		*printer;	/* Printer name */
-  const char	*workgroup;	/* Workgroup */
-  FILE		*fp;		/* File to print */
-  int		status=1;		/* Status of LPD job */
-  struct cli_state *cli;	/* SMB interface */
-  char null_str[1];
-  int tries = 0;
-  const char *dev_uri;
-  TALLOC_CTX *frame = talloc_stackframe();
-
-  null_str[0] = '\0';
-
-  /* we expect the URI in argv[0]. Detect the case where it is in argv[1] and cope */
-  if (argc > 2 && strncmp(argv[0],"smb://", 6) && !strncmp(argv[1],"smb://", 6)) {
-	  argv++;
-	  argc--;
-  }
-
-  if (argc == 1)
-  {
-   /*
-    * NEW!  In CUPS 1.1 the backends are run with no arguments to list the
-    *       available devices.  These can be devices served by this backend
-    *       or any other backends (i.e. you can have an SNMP backend that
-    *       is only used to enumerate the available network printers... :)
-    */
-
-    list_devices();
-    status = 0;
-    goto done;
-  }
-
-  if (argc < 6 || argc > 7)
-  {
-    fprintf(stderr, "Usage: %s [DEVICE_URI] job-id user title copies options [file]\n",
-            argv[0]);
-    fputs("       The DEVICE_URI environment variable can also contain the\n", stderr);
-    fputs("       destination printer:\n", stderr);
-    fputs("\n", stderr);
-    fputs("           smb://[username:password@][workgroup/]server[:port]/printer\n", stderr);
-    goto done;
-  }
-
- /*
-  * If we have 7 arguments, print the file named on the command-line.
-  * Otherwise, print data from stdin...
-  */
-
-
-  if (argc == 6)
-  {
-   /*
-    * Print from Copy stdin to a temporary file...
-    */
-
-    fp     = stdin;
-    copies = 1;
-  }
-  else if ((fp = fopen(argv[6], "rb")) == NULL)
-  {
-    perror("ERROR: Unable to open print file");
-    goto done;
-  }
-  else
-    copies = atoi(argv[4]);
-
- /*
-  * Find the URI...
-  */
-
-  dev_uri = getenv("DEVICE_URI");
-  if (dev_uri)
-    strncpy(uri, dev_uri, sizeof(uri) - 1);
-  else if (strncmp(argv[0], "smb://", 6) == 0)
-    strncpy(uri, argv[0], sizeof(uri) - 1);
-  else
-  {
-    fputs("ERROR: No device URI found in DEVICE_URI environment variable or argv[0] !\n", stderr);
-    goto done;
-  }
-
-  uri[sizeof(uri) - 1] = '\0';
-
- /*
-  * Extract the destination from the URI...
-  */
-
-  if ((sep = strrchr_m(uri, '@')) != NULL)
-  {
-    tmp = uri + 6;
-    *sep++ = '\0';
-
-    /* username is in tmp */
-
-    server = sep;
-
-   /*
-    * Extract password as needed...
-    */
-
-    if ((tmp2 = strchr_m(tmp, ':')) != NULL) {
-      *tmp2++ = '\0';
-      password = uri_unescape_alloc(tmp2);
-    } else {
-      password = null_str;
-    }
-    username = uri_unescape_alloc(tmp);
-  }
-  else
-  {
-    username = null_str;
-    password = null_str;
-    server   = uri + 6;
-  }
-
-  tmp = server;
-
-  if ((sep = strchr_m(tmp, '/')) == NULL)
-  {
-    fputs("ERROR: Bad URI - need printer name!\n", stderr);
-    goto done;
-  }
-
-  *sep++ = '\0';
-  tmp2 = sep;
-
-  if ((sep = strchr_m(tmp2, '/')) != NULL)
-  {
-   /*
-    * Convert to smb://[username:password@]workgroup/server/printer...
-    */
-
-    *sep++ = '\0';
-
-    workgroup = uri_unescape_alloc(tmp);
-    server    = uri_unescape_alloc(tmp2);
-    printer   = uri_unescape_alloc(sep);
-  }
-  else {
-    workgroup = NULL;
-    server = uri_unescape_alloc(tmp);
-    printer = uri_unescape_alloc(tmp2);
-  }
-  
-  if ((sep = strrchr_m(server, ':')) != NULL)
-  {
-    *sep++ = '\0';
-
-    port=atoi(sep);
-  }
-  else 
-  	port=0;
-	
- 
- /*
-  * Setup the SAMBA server state...
-  */
-
-  setup_logging("smbspool", True);
-
-  lp_set_in_client(True);       /* Make sure that we tell lp_load we are */
-
-  load_case_tables();
-
-  if (!lp_load(get_dyn_CONFIGFILE(), True, False, False, True))
-  {
-    fprintf(stderr, "ERROR: Can't load %s - run testparm to debug it\n", get_dyn_CONFIGFILE());
-    goto done;
-  }
-
-  if (workgroup == NULL)
-    workgroup = lp_workgroup();
-
-  load_interfaces();
-
-  do
-  {
-    if ((cli = smb_connect(workgroup, server, port, printer, username, password, argv[2])) == NULL)
-    {
-      if (getenv("CLASS") == NULL)
-      {
-        fprintf(stderr, "ERROR: Unable to connect to CIFS host, will retry in 60 seconds...\n");
-        sleep (60); /* should just waiting and retrying fix authentication  ??? */
-        tries++;
-      }
-      else
-      {
-        fprintf(stderr, "ERROR: Unable to connect to CIFS host, trying next printer...\n");
-    	goto done;
-      }
-    }
-  }
-  while ((cli == NULL) && (tries < MAX_RETRY_CONNECT));
-
-  if (cli == NULL) {
-        fprintf(stderr, "ERROR: Unable to connect to CIFS host after (tried %d times)\n", tries);
-    	goto done;
-  }
-
- /*
-  * Now that we are connected to the server, ignore SIGTERM so that we
-  * can finish out any page data the driver sends (e.g. to eject the
-  * current page...  Only ignore SIGTERM if we are printing data from
-  * stdin (otherwise you can't cancel raw jobs...)
-  */
-
-  if (argc < 7)
-    CatchSignal(SIGTERM, SIG_IGN);
-
- /*
-  * Queue the job...
-  */
-
-  for (i = 0; i < copies; i ++)
-    if ((status = smb_print(cli, argv[3] /* title */, fp)) != 0)
-      break;
-
-  cli_shutdown(cli);
-
- /*
-  * Return the queue status...
-  */
-
-  done:
-
-  TALLOC_FREE(frame);
-  return (status);
+int				/* O - Exit status */
+main(int argc,			/* I - Number of command-line arguments */
+     char *argv[])
+{				/* I - Command-line arguments */
+	int             i;	/* Looping var */
+	int             copies;	/* Number of copies */
+	int             port;	/* Port number */
+	char            uri[1024],	/* URI */
+	               *sep,	/* Pointer to separator */
+	               *tmp, *tmp2,	/* Temp pointers to do escaping */
+	               *password;	/* Password */
+	char           *username,	/* Username */
+	               *server,	/* Server name */
+	               *printer;/* Printer name */
+	const char     *workgroup;	/* Workgroup */
+	FILE           *fp;	/* File to print */
+	int             status = 1;	/* Status of LPD job */
+	struct cli_state *cli;	/* SMB interface */
+	char            null_str[1];
+	int             tries = 0;
+	bool		need_auth = true;
+	const char     *dev_uri;
+	TALLOC_CTX     *frame = talloc_stackframe();
+
+	null_str[0] = '\0';
+
+	/*
+	 * we expect the URI in argv[0]. Detect the case where it is in
+	 * argv[1] and cope
+	 */
+	if (argc > 2 && strncmp(argv[0], "smb://", 6) &&
+	    strncmp(argv[1], "smb://", 6) == 0) {
+		argv++;
+		argc--;
+	}
+
+	if (argc == 1) {
+		/*
+	         * NEW!  In CUPS 1.1 the backends are run with no arguments
+		 * to list the available devices.  These can be devices
+		 * served by this backend or any other backends (i.e. you
+		 * can have an SNMP backend that is only used to enumerate
+		 * the available network printers... :)
+	         */
+
+		list_devices();
+		status = 0;
+		goto done;
+	}
+
+	if (argc < 6 || argc > 7) {
+		fprintf(stderr,
+"Usage: %s [DEVICE_URI] job-id user title copies options [file]\n"
+"       The DEVICE_URI environment variable can also contain the\n"
+"       destination printer:\n"
+"\n"
+"           smb://[username:password@][workgroup/]server[:port]/printer\n",
+			argv[0]);
+		goto done;
+	}
+
+	/*
+         * If we have 7 arguments, print the file named on the command-line.
+         * Otherwise, print data from stdin...
+         */
+
+	if (argc == 6) {
+		/*
+	         * Print from Copy stdin to a temporary file...
+	         */
+
+		fp = stdin;
+		copies = 1;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list