[SCM] Samba Shared Repository - branch v3-6-stable updated

Karolin Seeger kseeger at samba.org
Mon Apr 29 02:12:49 MDT 2013


The branch, v3-6-stable has been updated
       via  bdfd222 WHATSNEW: Add some information on migrating printers.
       via  cc27113 WHATSNEW: Add changes since 3.6.13.
       via  c88d1f5 docs: Fix bug 9809 -- missing entry in specfile
       via  e6dd547 Fix bug 9811 - Old DOS SMB CTEMP request uses a non-VFS function to access the filesystem.
       via  46dd4f7 Bug 9807 - wbinfo: fix segfault in wbinfo_pam_logon
       via  197ced2 BUG 9766: Cache name_to_sid/sid_to_name correctly.
       via  de6f18e BUG 9139: Fix the username map optimization.
       via  f777a58 BUG 9699: Fix adding case sensitive spn.
       via  fb8a7fa8 vfs_fake_perms: Fix bug 9775, segfault for "artificial" conn_structs (cherry picked from commit 70107fc911570bbbc1cd613e9c594f5481e5685e)
       via  c926f18 Optimization suggested by Volker. Don't do a stat system call on normal read path.
       via  721c22e smbd: Tune "dir" a bit.
       via  4cdd289 BUG 9735: Fix winbind seperator in upn to username conversion.
       via  55df8b1 Fix bug #9733 - smbcontrol close-share is not working.
       via  a0346c1 Final fix for bug #9130 - Certain xattrs cause Windows error 0x800700FF
       via  6c9f139 Ensure we don't return uninitialized memory in the pad bytes.
       via  168fdf3 Fix bug #9130 - Certain xattrs cause Windows error 0x800700FF
       via  3a335d4 Change estimate_ea_size() to correctly estimate the EA size over SMB2.
       via  2b7b65c Modify fill_ea_chained_buffer() to be able to do size calculation only, no marshalling.
       via  bd4078a wkssvc: Fix bug 9727, NULL pointer dereference
       via  78f7218 printing: update registry and publish in background
       via  1c4af29 spoolss: only reload printers on pcap update message
       via  2ce6b4a printing: add sighup and conf change handlers
       via  339d2b0 printing: move pcap change notifier to bg process
       via  0b7efa6 smbd: fix cups printcap cache updates on startup
       via  2643262 Make sure that we only propogate the INHERITED flag when we are allowed to.
       via  6f766f8 torture: Add ntprinting latin1 test.
       via  ef7becb s3-net: Add encoding=<CP> to 'net printing dump'.
       via  0d0941d s3-net: Add encoding=<CP> to 'net printing migrate'.
       via  5e459cf ndr: Pass down string_flags in ndr_pull_ntprinting_printer().
       via  dcbf212 idl: Add flags for strings in ntprinting idl.
       via  33ac449 ndr: Add ndr_ntprinting_string_flags() function.
       via  3395375 pidl: Add skip option to elements.
       via  f637313 Fix bug #9724 - is_encrypted_packet() function incorrectly used inside server.
      from  d4382c7 WHATSNEW: Start release notes for Samba 3.6.14.

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


- Log -----------------------------------------------------------------
commit bdfd2220392769de631a600ed78e9f64fad4d9cd
Author: Karolin Seeger <kseeger at samba.org>
Date:   Fri Apr 26 12:02:58 2013 +0200

    WHATSNEW: Add some information on migrating printers.
    
    Thanks to Andreas for providing the text and making sure that it ends up in the
    release notes!
    
    Karolin
    (cherry picked from commit 5aba70a99dd8d3e7e12a4837c00194eaba5f271c)

commit cc271137b2c14251c0d3a775bfa3d20de1b76b6d
Author: Karolin Seeger <kseeger at samba.org>
Date:   Fri Apr 26 10:48:44 2013 +0200

    WHATSNEW: Add changes since 3.6.13.
    
    Karolin
    (cherry picked from commit 544e41ec27bcc8c5fe3ec784c4a937830bc8096b)

commit c88d1f523438ce0e0c17ae33583f55e1bebe0195
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Apr 19 16:17:13 2013 +0200

    docs: Fix bug 9809 -- missing entry in specfile
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Karolin Seeger <kseeger at samba.org>
    
    Autobuild-User(master): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(master): Mon Apr 22 11:35:52 CEST 2013 on sn-devel-104
    (cherry picked from commit 5512a43a93833d3d6f1721d69c894db0e2c77ef8)
    (cherry picked from commit 7441f3d9f1d2cec29e0caaeaf7a4fc92761fe82f)

commit e6dd547d0496f9ecd8fa32da6c8eb13eef4722d6
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Apr 18 11:19:20 2013 -0700

    Fix bug 9811 - Old DOS SMB CTEMP request uses a non-VFS function to access the filesystem.
    
    Fix bug in old create temp SMB request. Only use VFS functions.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 61d591bb1eacbd7bcdf6a1c4abe8442edfece524)

commit 46dd4f7a7f56c6a96252b75af4bf00c872235259
Author: David Disseldorp <ddiss at samba.org>
Date:   Wed Apr 17 10:39:12 2013 -0700

    Bug 9807 - wbinfo: fix segfault in wbinfo_pam_logon
    
    wbinfo_pam_logon() incorrectly assumes that wbcLogonUser() always
    returns an allocated wbcAuthErrorInfo struct on failure.
    
    Signed-off-by: David Disseldorp <ddiss at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Wed Apr 17 21:29:29 CEST 2013 on sn-devel-104
    (cherry picked from commit 8bb8f0011e567501a98a901adcfffbf4f34e73ae)

commit 197ced23c2df5875b818174a9b01d8b154254551
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Apr 4 12:18:25 2013 +0200

    BUG 9766: Cache name_to_sid/sid_to_name correctly.
    
    If there is no domain_name specified we still need to set to for
    caching else we will not find the entry later if we lookup the entry
    with the domain_name.
    
    Reviewed-by: Guenther Deschner <gd at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    Signed-off-by: Andreas Schneider <asn at samba.org>
    
    Autobuild-User(master): Günther Deschner <gd at samba.org>
    Autobuild-Date(master): Tue Apr  9 16:32:44 CEST 2013 on sn-devel-104
    (cherry picked from commit afcbaf373a1959f2323ffa729886b688c2b965e3)

commit de6f18eb3851d5f8414dafc2db33ece290ddddc8
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Apr 5 14:07:37 2013 +0200

    BUG 9139: Fix the username map optimization.
    
    If we successfully map a user. We call
    
    set_last_from_to(user_in, unixname);
    
    in the while loop reading the map file. After a successfull map we don't
    stop and continue the loop to check all other mappings in the username
    mapfile. But when we hit the end of the file and leave the loop we call:
    
    set_last_from_to(user_in, user_in);
    
    This overwrites the successful mapping, and the next time we call
    map_username() we skip the username and no mapping is done.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Günther Deschner <gd at samba.org>
    (cherry picked from commit d9b8bd03d002e0329a4b0ed4b1cc81d64fe9c6eb)

commit f777a58ed55b1a870d96208fc7c543e2a49dec28
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Apr 3 15:46:00 2013 +0200

    BUG 9699: Fix adding case sensitive spn.
    
    We should be able to define the case of the spn cause it is important
    for some services like nfs. 'net ads keytab add "nfs"' should not
    result in an uppercase spn.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 6848fb121a3a16b2d87b2bf2f7cca8364a1343f1)

commit fb8a7fa809662fbbdeeeff91a804d4fca9189a82
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Apr 9 21:43:28 2013 +0200

    vfs_fake_perms: Fix bug 9775, segfault for "artificial" conn_structs
    (cherry picked from commit 70107fc911570bbbc1cd613e9c594f5481e5685e)

commit c926f18f0c456563fbd8eb158a78c8c88e8e5d19
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Mar 25 09:54:50 2013 -0700

    Optimization suggested by Volker. Don't do a stat system call on normal read path.
    
    Only do it if we need it in the sendfile() path.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    
    Autobuild-User(master): Volker Lendecke <vl at samba.org>
    Autobuild-Date(master): Thu Mar 28 17:51:22 CET 2013 on sn-devel-104
    
    Fix bug #9748 - Remove unneeded fstat system call from hot read path.
    (cherry picked from commit 60a2fb5ddac02376d82f323f2acb1211bb7929e3)

commit 721c22ed2a536051207876b220af49b787a7c06c
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Mar 21 22:00:06 2013 +0100

    smbd: Tune "dir" a bit.
    
    for i in $(seq 1 20000) ; do echo dir ; done | smbclient //127.0.0.1/tmp -U%
    
    without and with this patch:
    
    $ time bin/smbd -d0 -i
    smbd version 4.1.0pre1-GIT-1f139ae started.
    Copyright Andrew Tridgell and the Samba Team 1992-2013
    Beendet
    
    real    0m28.342s
    user    0m10.249s
    sys     0m10.513s
    
    $ time bin/smbd -d0 -i
    smbd version 4.1.0pre1-GIT-1f139ae started.
    Copyright Andrew Tridgell and the Samba Team 1992-2013
    Beendet
    
    real    0m27.348s
    user    0m9.089s
    sys     0m10.853s
    
    The "real" timestamp is irrelevant, this also contains the time between
    starting smbd and the smbclient job. It's the "user" time. The result that this
    patch improves the time spent in user space by 10% is consistent.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Fix bug #9736 - Change to smbd/dir.c code gives significant performance
    increases on large directory listings.
    (cherry picked from commit 565d1409c7c424fbbeed1e98b042d3970b0acf73)

commit 4cdd2895540b5631ca7c5974addc15dcf623a09f
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Mar 22 14:15:57 2013 +0100

    BUG 9735: Fix winbind seperator in upn to username conversion.
    
    Reviewed-by: Günther Deschner <gd at samba.org>
    Signed-off-by: Andreas Schneider <asn at samba.org>
    (cherry picked from commit 01192ce939cf77737de8efe7072dded5c3e1da94)

commit 55df8b1633595bd4d7a3e11250da29cc542976fe
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Mar 21 13:59:20 2013 -0700

    Fix bug #9733 - smbcontrol close-share is not working.
    
    As part of forcibly disconnecting a client from a share,
    smbd must atomically call reload_services() to ensure that
    the entry in the ServicePtrs[] array corresponding to
    that share is removed if the share was removed from
    the smb.conf or registry entries.
    
    Otherwise the ServicePtrs[] array entry for the share
    remains active and the client races to auto-reconnect to
    the share before a second message to reload the smb.conf
    file can be sent.
    
    This has to be done as part of the close-share message
    processing, as removing the share from the smb.conf file
    first, then telling the smbd to reload followed by the
    forcible disconnect message doesn't work as in this
    sequence of events when the reload message is received
    the client is still connected to the share, so the
    ServicePtrs[] entry is still left active.
    
    The forcible-disconnect + service reload has to be done
    together as an atomic operation in order for this to work.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 1df61789ca466923a7a252244888bd1b7cfbc79e)

commit a0346c10974fd23a152b98783ba8975604dd3ea5
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Mar 27 11:54:34 2013 -0700

    Final fix for bug #9130 - Certain xattrs cause Windows error 0x800700FF
    
    The spec lies when it says that NextEntryOffset is the only value
    considered when finding the next EA. We were adding 4 more extra
    pad bytes than needed (i.e. if the next entry already was on a 4
    byte boundary, then we were adding 4 additional pad bytes).
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    
    The last 5 patches address bug #9130 - Certain xattrs cause Windows error
    0x800700FF.
    (cherry picked from commit 57db33599589b06a60cb7cbb454f87bf40c542e0)

commit 6c9f1394d1809a67a855bf2f98cdc2ac9dcf3f10
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Mar 26 17:07:55 2013 -0700

    Ensure we don't return uninitialized memory in the pad bytes.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 79503841059e945e6b14fa8c92375041c5390764)

commit 168fdf32f99253f10e0f0c4e9ff0330cae87af7a
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Mar 26 16:55:03 2013 -0700

    Fix bug #9130 - Certain xattrs cause Windows error 0x800700FF
    
    Ensure we never return any zero-length EA's.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 8794bb97495a7de4bf98f497abdf713be68db7a9)

commit 3a335d492ee8a969e19db33df9ee49dfa5e4b988
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Mar 26 16:53:45 2013 -0700

    Change estimate_ea_size() to correctly estimate the EA size over SMB2.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit c6688532c8a01836f29a38806ced62b34617222d)

commit 2b7b65c26732a837a4b622bc0250988caf5e9818
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Mar 26 16:50:13 2013 -0700

    Modify fill_ea_chained_buffer() to be able to do size calculation only, no marshalling.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 45654424a5c686a43cd9edb8026c0d0424260fd9)

commit bd4078a23e2c98afdf039fff26c0121d352a4b6d
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Mar 18 09:36:17 2013 +0100

    wkssvc: Fix bug 9727, NULL pointer dereference
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>
    
    Autobuild-User(master): Michael Adam <obnox at samba.org>
    Autobuild-Date(master): Mon Mar 18 11:39:27 CET 2013 on sn-devel-104
    (cherry picked from commit 05a7a10c88be99d864eacd6f9d37a340022f01f6)
    (cherry picked from commit 64fb72ccb26b8e48c50407bc58618499ab2f5603)

commit 78f721847ee861d644b03fcab0830cc3fe33760f
Author: David Disseldorp <ddiss at samba.org>
Date:   Fri Mar 15 16:54:06 2013 +0100

    printing: update registry and publish in background
    
    Currently all smbd processes unnecessarily access each printer registry
    TDB entry following printcap cache reload.
    This change moves responsibility for this to the background print queue
    process.
    
    This and the last four commits address bug 9650: New or delete cups
    printerqueues are not recognized by the samba.
    (cherry picked from commit ac6604868d1325dd4c872dc0f6ab056d10ebaecf)

commit 1c4af29ea41e200ef942fedbcf58fbd0f665d303
Author: David Disseldorp <ddiss at samba.org>
Date:   Fri Feb 15 12:17:53 2013 +0100

    spoolss: only reload printers on pcap update message
    
    Printcap cache updates are the responsibility of the background
    printing process, which after doing so broadcasts a MSG_PRINTER_PCAP
    message. Spoolssd should only reload printers after receiving such a
    message.
    (cherry picked from commit c30c66d8b5b4ebbde1b148c51310e336f29ca04e)

commit 2ce6b4a78efa548720566bf84e5f2b81337bffd7
Author: David Disseldorp <ddiss at samba.org>
Date:   Thu Feb 14 17:02:08 2013 +0100

    printing: add sighup and conf change handlers
    
    The background printing process is now responsible for all printcap
    cache updates, which should be done on SIGHUP and configuration change.
    (cherry picked from commit f4af7c4d4cafe15c437742d450c7753a8b6d8422)

commit 339d2b0cf5bc59566742b5a12eb6c44952bb8ee1
Author: David Disseldorp <ddiss at samba.org>
Date:   Thu Feb 14 14:42:21 2013 +0100

    printing: move pcap change notifier to bg process
    
    The background print queue process is responsible for printcap cache
    updates, and should be the only process to send notifications.
    (cherry picked from commit 23ac828ba93e2ffc60ced19656af9609dcc1b2ab)

commit 0b7efa6182388eaeeb31bb9a29a244eb150ff852
Author: David Disseldorp <ddiss at samba.org>
Date:   Tue Feb 12 18:57:53 2013 +0100

    smbd: fix cups printcap cache updates on startup
    
    On startup the parent smbd process currently calls pcap_cache_reload(),
    which is done immediately before the background queue process is forked.
    
    pcap_cache_reload() is asynchronous with cups, in that it forks a
    separate process to obtain the printer listing. The cache_fd_event
    print_cups.c global variable is used to track when a cups printer
    listing is in progress.
    
    cache_fd_event is set when the background queue process is forked, due
    to smbd's pcap_cache_reload() call immediately prior. As a result, the
    background queue process assumes an existing pcap_cache_reload() call is
    indefinitely outstanding, causing the printcap cache to remain stale
    thereafter.
    (cherry picked from commit d7286bb6520ebe03355e98e3311e1d79e2746791)

commit 264326285d8c1f8694129ee60f83f7140735052d
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Mar 28 09:36:41 2013 -0700

    Make sure that we only propogate the INHERITED flag when we are allowed to.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    
    Fix bug #9747 - When creating a directory Samba allows inherited bit to slip
    through.
    (cherry picked from commit 93bca1881e3a8993c76fec408d7c0c369556683d)

commit 6f766f8f6ace3676abe84f88a200c95bd65b7e58
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Mar 14 07:29:20 2013 +0100

    torture: Add ntprinting latin1 test.
    
    Reviewed-by: Günther Deschner <gd at samba.org>
    
    The last 7 patches address bug #9723 - Add a tool to migrate latin1 printing
    tdb's to registry.
    (cherry picked from commit 97bb3cc15bfa6572486e176aed9040ee3e7df714)

commit ef7becbd33808bad928cfc6ed9fbc6431a9da69c
Author: Andreas Schneider <asn at samba.org>
Date:   Tue Mar 12 18:42:02 2013 +0100

    s3-net: Add encoding=<CP> to 'net printing dump'.
    
    Reviewed-by: Günther Deschner <gd at samba.org>
    (cherry picked from commit c28da2d725e70a5494bebee3b4bb35a85ea7cf3b)

commit 0d0941d4897ce238c2cd391eb3ffebeb65ac2d90
Author: Andreas Schneider <asn at samba.org>
Date:   Tue Mar 12 11:39:08 2013 +0100

    s3-net: Add encoding=<CP> to 'net printing migrate'.
    
    This allows you to convert printing tdb's which are in e.g. in latin1 to
    convert to UTF-8 and import them into the registry.
    
    Reviewed-by: Günther Deschner <gd at samba.org>
    (cherry picked from commit 3877c1865550446ed25ac06a809518135d62e4f8)

commit 5e459cf4b2d5193c4400530148b2bdcd6a12d408
Author: Andreas Schneider <asn at samba.org>
Date:   Tue Mar 12 15:17:54 2013 +0100

    ndr: Pass down string_flags in ndr_pull_ntprinting_printer().
    
    Reviewed-by: Günther Deschner <gd at samba.org>
    (cherry picked from commit fa6a654790e2d61a3d69cdfed8ecba74450a870f)

commit dcbf212bf2bc5e8188d85cde52d385d68a3dc9e9
Author: Andreas Schneider <asn at samba.org>
Date:   Mon Mar 11 15:47:00 2013 +0100

    idl: Add flags for strings in ntprinting idl.
    
    Reviewed-by: Günther Deschner <gd at samba.org>
    (cherry picked from commit 171251595f18f5518f15d7b8c05aea68df0b024f)

commit 33ac44927e59e613d2d8c0f9cc44f4fc304cf411
Author: Andreas Schneider <asn at samba.org>
Date:   Mon Mar 11 15:45:15 2013 +0100

    ndr: Add ndr_ntprinting_string_flags() function.
    
    It defaults to utf8string.
    
    Reviewed-by: Günther Deschner <gd at samba.org>
    (cherry picked from commit 6abfeb7d806e40c932f09f0323f20535b54a5613)

commit 3395375c06ef7911da1934cf4e3d88de2b7b72bd
Author: Andreas Schneider <asn at samba.org>
Date:   Tue Mar 12 11:36:38 2013 +0100

    pidl: Add skip option to elements.
    
    This option allows to skip struct elements in pull and push function.
    This can be used to pass flags to the structure e.g. for string values.
    
    Reviewed-by: Günther Deschner <gd at samba.org>
    (cherry picked from commit 7f13e139825a4363d8d304c5b86c805bb2a1b0db)

commit f63731364b75a4e831f0de05d6807cfb93374ab4
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Mar 15 15:13:24 2013 -0700

    Fix bug #9724 - is_encrypted_packet() function incorrectly used inside server.
    
    The is_encrypted_packet() function should only be used on the raw received data
    to determine if a packet came in encrypted. Once we're inside the SMB1
    processing code in smbd/reply.c we should be looking at the
    smb1request->encrypted field to determine if a packet was really encrypted or
    not.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 3bc39aa493aa8d2db9ac423d82bed08bda10e754)

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

Summary of changes:
 WHATSNEW.txt                                    |   62 +++++++-
 librpc/idl/ntprinting.idl                       |   69 +++++---
 librpc/ndr/ndr_ntprinting.c                     |   15 ++
 librpc/ndr/ndr_ntprinting.h                     |    2 +
 nsswitch/pam_winbind.c                          |    2 +-
 nsswitch/wbinfo.c                               |    7 +-
 packaging/RHEL/samba.spec.tmpl                  |    1 +
 pidl/lib/Parse/Pidl/NDR.pm                      |    1 +
 pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm        |   12 +-
 source3/auth/user_util.c                        |   12 +-
 source3/lib/secdesc.c                           |    3 +-
 source3/libads/ldap.c                           |    6 +-
 source3/modules/vfs_fake_perms.c                |   30 +++-
 source3/printing/nt_printing_migrate.c          |   14 ++-
 source3/printing/nt_printing_migrate.h          |    6 +-
 source3/printing/nt_printing_migrate_internal.c |    6 +-
 source3/printing/printing.c                     |   77 ++++++++-
 source3/printing/spoolssd.c                     |   18 ++-
 source3/rpc_server/wkssvc/srv_wkssvc_nt.c       |    8 +-
 source3/smbd/conn.c                             |    7 +-
 source3/smbd/dir.c                              |   25 ++-
 source3/smbd/process.c                          |   53 ------
 source3/smbd/proto.h                            |    7 +-
 source3/smbd/reply.c                            |  156 +++++++++--------
 source3/smbd/server.c                           |   77 +++++++--
 source3/smbd/server_reload.c                    |   80 +++++----
 source3/smbd/trans2.c                           |   61 ++++++-
 source3/utils/net_printing.c                    |  134 +++++++++++++--
 source3/winbindd/winbindd_cache.c               |   21 +++
 source4/torture/ndr/ntprinting.c                |  217 +++++++++++++++++++++++
 30 files changed, 926 insertions(+), 263 deletions(-)


Changeset truncated at 500 lines:

diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index e27c6bd..be09c55 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -8,12 +8,72 @@ This is is the latest stable release of Samba 3.6.
 
 Major enhancements in Samba 3.6.14 include:
 
-o 
+o  Certain xattrs cause Windows error 0x800700FF (bug #9130).
 
 Changes since 3.6.13:
 ---------------------
 
 o   Jeremy Allison <jra at samba.org>
+    * BUG 9130: Certain xattrs cause Windows error 0x800700FF.
+    * BUG 9724: Use is_encrypted_packet() function correctly inside server.
+    * BUG 9733: Fix 'smbcontrol close-share' is not working.
+    * BUG 9747: Make sure that we only propogate the INHERITED flag when we are
+      allowed to.
+    * BUG 9748: Remove unneeded fstat system call from hot read path.
+    * BUG 9811: Fix bug in old create temp SMB request. Only use VFS functions.
+
+
+o   David Disseldorp <ddiss at samba.org>
+    * BUG 9650: New or deleted CUPS printerqueues are not recognized by Samba.
+    * BUG 9807: wbinfo: Fix segfault in wbinfo_pam_logon.
+
+
+o   Volker Lendecke <vl at samba.org>
+    * BUG 9727: wkssvc: Fix NULL pointer dereference.
+    * BUG 9736: smbd: Tune "dir" a bit.
+    * BUG 9775: Fix segfault for "artificial" conn_structs.
+    * BUG 9809: RHEL SPEC: Package dbwrap_tool man page.
+
+
+o   Andreas Schneider <asn at samba.org>
+    * BUG 9139: Fix the username map optimization.
+    * BUG 9699: Fix adding case sensitive spn.
+    * BUG 9723: Add a tool to migrate latin1 printing tdbs to registry.
+    * BUG 9735: Fix Winbind separator in upn to username conversion.
+    * BUG 9766: Cache name_to_sid/sid_to_name correctly.
+
+
+Note about upgrading from older versions:
+-----------------------------------------
+
+It is still the case that there are printing tdbs (ntprinting.tdb, ntforms.tdb,
+ntdrivers.tdb) which are in latin1 or other encodings. When updating from
+Samba 3.5 or earlier to Samba 3.6 or 4.0 these tdbs need to be migrated to our
+new registry based printing management.  This means during the migration we
+also need to do charset conversion. This can only been done manually cause we don't
+know in which encoding the tdb is. You have to specify the correct code page
+for the conversion, see iconv -l and Wikipedia [1] for the available codepages.
+The mostly used one is Windows Latin1 which is CP1252.
+
+We've extended the 'net printing dump' and 'net printing migrate' commands to
+define the encoding of the tdb. So you can correctly view the tdb with:
+
+  net printing dump encoding=CP1252 /path/to/ntprinters.tdb
+
+or migrate it with e.g.:
+
+  net printing migrate encoding=CP1252 /path/to/ntprinters.tdb
+
+If you migrate printers we suggest you do it in the following order.
+
+ntforms.tdb
+ntdrivers.tdb
+ntprinting.tdb
+
+Don't forget to rename, move or delete these files in /var/lib/samba after the
+migration.
+
+[1] https://en.wikipedia.org/wiki/Code_page
 
 
 ######################################################################
diff --git a/librpc/idl/ntprinting.idl b/librpc/idl/ntprinting.idl
index 7013566..8152144 100644
--- a/librpc/idl/ntprinting.idl
+++ b/librpc/idl/ntprinting.idl
@@ -30,20 +30,24 @@ interface ntprinting
 		[in] ntprinting_form form
 		);
 
-	/* Samba 3 tdb storage format: drivers
+	/*
+	 * First the string flags and then the Samba 3 tdb storage
+	 * format: drivers
 	 * "dffffffff" followed by a remaining buffer of "f" array */
 
 	typedef [flag(NDR_NOALIGN),public] struct {
+		[skip] uint32 string_flags;
+
 		uint32 version;
-		utf8string name;
-		utf8string environment;
-		utf8string driverpath;
-		utf8string datafile;
-		utf8string configfile;
-		utf8string helpfile;
-		utf8string monitorname;
-		utf8string defaultdatatype;
-		[flag(STR_UTF8|STR_NOTERM|NDR_REMAINING)] string_array dependent_files;
+		[flag(ndr_ntprinting_string_flags(r->string_flags))] string name;
+		[flag(ndr_ntprinting_string_flags(r->string_flags))] string environment;
+		[flag(ndr_ntprinting_string_flags(r->string_flags))] string driverpath;
+		[flag(ndr_ntprinting_string_flags(r->string_flags))] string datafile;
+		[flag(ndr_ntprinting_string_flags(r->string_flags))] string configfile;
+		[flag(ndr_ntprinting_string_flags(r->string_flags))] string helpfile;
+		[flag(ndr_ntprinting_string_flags(r->string_flags))] string monitorname;
+		[flag(ndr_ntprinting_string_flags(r->string_flags))] string defaultdatatype;
+		[flag((ndr_ntprinting_string_flags(r->string_flags)&~STR_NULLTERM)|STR_NOTERM|NDR_REMAINING)] string_array dependent_files;
 	} ntprinting_driver;
 
 	[public] void decode_ntprinting_driver(
@@ -57,9 +61,11 @@ interface ntprinting
 	 * "B" private data blob */
 
 	typedef [flag(NDR_NOALIGN),public] struct {
+		[skip] uint32 string_flags;
+
 		/* uint32 devicemode_ptr; */
-		utf8string devicename;
-		utf8string formname;
+		[flag(ndr_ntprinting_string_flags(r->string_flags))] string devicename;
+		[flag(ndr_ntprinting_string_flags(r->string_flags))] string formname;
 		uint16 specversion;
 		uint16 driverversion;
 		uint16 size;
@@ -95,21 +101,30 @@ interface ntprinting
 		DATA_BLOB *nt_dev_private;
 	} ntprinting_devicemode;
 
-	/* Samba 3 tdb storage format: printer_data
+	/*
+	 * First the string flags and then the Samba 3 tdb storage
+	 * format: printer_data
 	 * "p" ptr to printer_data
 	 * "fdB" */
 
 	typedef [flag(NDR_NOALIGN),public] struct {
+		[skip] uint32 string_flags;
+
 		uint32 ptr;
-		utf8string name;
+		[flag(ndr_ntprinting_string_flags(r->string_flags))] string name;
 		uint32 type;
 		DATA_BLOB data;
 	} ntprinting_printer_data;
 
-	/* Samba 3 tdb storage format: printer_info
-	 * "dddddddddddfffffPfffff" */
+	/*
+	 * First the string flags and then the Samba 3 tdb storage
+	 * format: printer_info
+	 * "dddddddddddfffffPfffff"
+	 */
 
 	typedef [flag(NDR_NOALIGN),public] struct {
+		[skip] uint32 string_flags;
+
 		uint32 attributes;
 		uint32 priority;
 		uint32 default_priority;
@@ -121,17 +136,17 @@ interface ntprinting
 		uint32 changeid;
 		uint32 c_setprinter;
 		uint32 setuptime;
-		utf8string servername;
-		utf8string printername;
-		utf8string sharename;
-		utf8string portname;
-		utf8string drivername;
-		utf8string comment;
-		utf8string location;
-		utf8string sepfile;
-		utf8string printprocessor;
-		utf8string datatype;
-		utf8string parameters;
+		[flag(ndr_ntprinting_string_flags(r->string_flags))] string servername;
+		[flag(ndr_ntprinting_string_flags(r->string_flags))] string printername;
+		[flag(ndr_ntprinting_string_flags(r->string_flags))] string sharename;
+		[flag(ndr_ntprinting_string_flags(r->string_flags))] string portname;
+		[flag(ndr_ntprinting_string_flags(r->string_flags))] string drivername;
+		[flag(ndr_ntprinting_string_flags(r->string_flags))] string comment;
+		[flag(ndr_ntprinting_string_flags(r->string_flags))] string location;
+		[flag(ndr_ntprinting_string_flags(r->string_flags))] string sepfile;
+		[flag(ndr_ntprinting_string_flags(r->string_flags))] string printprocessor;
+		[flag(ndr_ntprinting_string_flags(r->string_flags))] string datatype;
+		[flag(ndr_ntprinting_string_flags(r->string_flags))] string parameters;
 	} ntprinting_printer_info;
 
 	/* Abstract Samba 3 printer
diff --git a/librpc/ndr/ndr_ntprinting.c b/librpc/ndr/ndr_ntprinting.c
index 76b296d..cb5293b 100644
--- a/librpc/ndr/ndr_ntprinting.c
+++ b/librpc/ndr/ndr_ntprinting.c
@@ -22,6 +22,19 @@
 #include "includes.h"
 #include "../librpc/gen_ndr/ndr_ntprinting.h"
 
+_PUBLIC_ uint32_t ndr_ntprinting_string_flags(uint32_t string_flags)
+{
+	uint32_t flags = LIBNDR_FLAG_STR_NULLTERM;
+
+	if (string_flags & LIBNDR_FLAG_STR_ASCII) {
+		flags |= LIBNDR_FLAG_STR_ASCII;
+	} else {
+		flags |= LIBNDR_FLAG_STR_UTF8;
+	}
+
+	return flags;
+}
+
 _PUBLIC_ enum ndr_err_code ndr_pull_ntprinting_printer(struct ndr_pull *ndr, int ndr_flags, struct ntprinting_printer *r)
 {
 	uint32_t _ptr_devmode;
@@ -43,6 +56,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_ntprinting_printer(struct ndr_pull *ndr, int
 			if (r->devmode) {
 				_mem_save_devmode_0 = NDR_PULL_GET_MEM_CTX(ndr);
 				NDR_PULL_SET_MEM_CTX(ndr, r->devmode, 0);
+				r->devmode->string_flags = r->info.string_flags;
 				NDR_CHECK(ndr_pull_ntprinting_devicemode(ndr, NDR_SCALARS|NDR_BUFFERS, r->devmode));
 				NDR_PULL_SET_MEM_CTX(ndr, _mem_save_devmode_0, 0);
 			}
@@ -59,6 +73,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_ntprinting_printer(struct ndr_pull *ndr, int
 				}
 				r->printer_data = talloc_realloc(ndr, r->printer_data, struct ntprinting_printer_data, r->count + 1);
 				NDR_ERR_HAVE_NO_MEMORY(r->printer_data);
+				r->printer_data[r->count].string_flags = r->info.string_flags;
 				NDR_CHECK(ndr_pull_ntprinting_printer_data(ndr, NDR_SCALARS, &r->printer_data[r->count]));
 				r->count++;
 			}
diff --git a/librpc/ndr/ndr_ntprinting.h b/librpc/ndr/ndr_ntprinting.h
index 8bda430..3b6ee01 100644
--- a/librpc/ndr/ndr_ntprinting.h
+++ b/librpc/ndr/ndr_ntprinting.h
@@ -22,4 +22,6 @@
 #include "includes.h"
 #include "../librpc/gen_ndr/ndr_ntprinting.h"
 
+_PUBLIC_ uint32_t ndr_ntprinting_string_flags(uint32_t string_flags);
+
 _PUBLIC_ enum ndr_err_code ndr_pull_ntprinting_printer(struct ndr_pull *ndr, int ndr_flags, struct ntprinting_printer *r);
diff --git a/nsswitch/pam_winbind.c b/nsswitch/pam_winbind.c
index 3257101..d126494 100644
--- a/nsswitch/pam_winbind.c
+++ b/nsswitch/pam_winbind.c
@@ -2448,7 +2448,7 @@ static char* winbind_upn_to_username(struct pwb_context *ctx,
 		return NULL;
 	}
 
-	return talloc_asprintf(ctx, "%s\\%s", domain, name);
+	return talloc_asprintf(ctx, "%s%c%s", domain, sep, name);
 }
 
 static int _pam_delete_cred(pam_handle_t *pamh, int flags,
diff --git a/nsswitch/wbinfo.c b/nsswitch/wbinfo.c
index ac07175..9d25f59 100644
--- a/nsswitch/wbinfo.c
+++ b/nsswitch/wbinfo.c
@@ -1728,7 +1728,7 @@ static bool wbinfo_pam_logon(char *username)
 {
 	wbcErr wbc_status = WBC_ERR_UNKNOWN_FAILURE;
 	struct wbcLogonUserParams params;
-	struct wbcAuthErrorInfo *error;
+	struct wbcAuthErrorInfo *error = NULL;
 	char *s = NULL;
 	char *p = NULL;
 	TALLOC_CTX *frame = talloc_tos();
@@ -1779,16 +1779,15 @@ static bool wbinfo_pam_logon(char *username)
 	d_printf("plaintext password authentication %s\n",
 		 WBC_ERROR_IS_OK(wbc_status) ? "succeeded" : "failed");
 
-	if (!WBC_ERROR_IS_OK(wbc_status)) {
+	if (!WBC_ERROR_IS_OK(wbc_status) && (error != NULL)) {
 		d_fprintf(stderr,
 			  "error code was %s (0x%x)\nerror message was: %s\n",
 			  error->nt_string,
 			  (int)error->nt_status,
 			  error->display_string);
 		wbcFreeMemory(error);
-		return false;
 	}
-	return true;
+	return WBC_ERROR_IS_OK(wbc_status);
 }
 
 /* Save creds with winbind */
diff --git a/packaging/RHEL/samba.spec.tmpl b/packaging/RHEL/samba.spec.tmpl
index adbc6df..a689435 100644
--- a/packaging/RHEL/samba.spec.tmpl
+++ b/packaging/RHEL/samba.spec.tmpl
@@ -370,6 +370,7 @@ fi
 %{_mandir}/man8/winbindd.8*
 %{_mandir}/man1/ntlm_auth.1*
 %{_mandir}/man1/wbinfo.1*
+%{_mandir}/man1/dbwrap_*.1*
 %{_mandir}/man8/vfs_*.8*
 %{_mandir}/man8/idmap_*.8*
 
diff --git a/pidl/lib/Parse/Pidl/NDR.pm b/pidl/lib/Parse/Pidl/NDR.pm
index 71e7228..c4cef64 100644
--- a/pidl/lib/Parse/Pidl/NDR.pm
+++ b/pidl/lib/Parse/Pidl/NDR.pm
@@ -1070,6 +1070,7 @@ my %property_list = (
 	"noprint"		=> ["FUNCTION", "TYPEDEF", "STRUCT", "UNION", "ENUM", "BITMAP", "ELEMENT", "PIPE"],
 	"nopython"		=> ["FUNCTION", "TYPEDEF", "STRUCT", "UNION", "ENUM", "BITMAP"],
 	"todo"			=> ["FUNCTION"],
+	"skip"			=> ["ELEMENT"],
 
 	# union
 	"switch_is"		=> ["ELEMENT"],
diff --git a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
index 3676d6d..10a886a 100644
--- a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
+++ b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
@@ -924,7 +924,11 @@ sub ParseDataPull($$$$$$$)
 
 		$var_name = get_pointer_to($var_name);
 
-		$self->pidl("NDR_CHECK(".TypeFunctionName("ndr_pull", $l->{DATA_TYPE})."($ndr, $ndr_flags, $var_name));");
+		if (has_property($e, "skip")) {
+			$self->pidl("/* [skip] '$var_name' */");
+		} else {
+			$self->pidl("NDR_CHECK(".TypeFunctionName("ndr_pull", $l->{DATA_TYPE})."($ndr, $ndr_flags, $var_name));");
+		}
 
 		my $pl = GetPrevLevel($e, $l);
 
@@ -962,7 +966,11 @@ sub ParseDataPush($$$$$$$)
 			$var_name = get_pointer_to($var_name);
 		}
 
-		$self->pidl("NDR_CHECK(".TypeFunctionName("ndr_push", $l->{DATA_TYPE})."($ndr, $ndr_flags, $var_name));");
+		if (has_property($e, "skip")) {
+			$self->pidl("/* [skip] '$var_name' */");
+		} else {
+			$self->pidl("NDR_CHECK(".TypeFunctionName("ndr_push", $l->{DATA_TYPE})."($ndr, $ndr_flags, $var_name));");
+		}
 	} else {
 		$self->ParseTypePush($l->{DATA_TYPE}, $ndr, $var_name, $primitives, $deferred);
 	}
diff --git a/source3/auth/user_util.c b/source3/auth/user_util.c
index d982c74..0ef0eb5 100644
--- a/source3/auth/user_util.c
+++ b/source3/auth/user_util.c
@@ -425,12 +425,16 @@ bool map_username(TALLOC_CTX *ctx, const char *user_in, char **p_user_out)
 	x_fclose(f);
 
 	/*
-	 * Setup the last_from and last_to as an optimization so
+	 * If we didn't successfully map a user in the loop above,
+	 * setup the last_from and last_to as an optimization so
 	 * that we don't scan the file again for the same user.
 	 */
-
-	set_last_from_to(user_in, user_in);
-	store_map_in_gencache(ctx, user_in, user_in);
+	if (!mapped_user) {
+		DEBUG(8, ("The user '%s' has no mapping. "
+			  "Skip it next time.\n", user_in));
+		set_last_from_to(user_in, user_in);
+		store_map_in_gencache(ctx, user_in, user_in);
+	}
 
 	return mapped_user;
 }
diff --git a/source3/lib/secdesc.c b/source3/lib/secdesc.c
index b7c9fc5..7ff3a6a 100644
--- a/source3/lib/secdesc.c
+++ b/source3/lib/secdesc.c
@@ -602,7 +602,8 @@ NTSTATUS se_create_child_secdesc(TALLOC_CTX *ctx,
 		if (!container) {
 			new_flags = 0;
 		} else {
-			new_flags &= ~SEC_ACE_FLAG_INHERIT_ONLY;
+			new_flags &= ~(SEC_ACE_FLAG_INHERIT_ONLY|
+					SEC_ACE_FLAG_INHERITED_ACE);
 
 			if (!(new_flags & SEC_ACE_FLAG_CONTAINER_INHERIT)) {
 				new_flags |= SEC_ACE_FLAG_INHERIT_ONLY;
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index e62a4b4..b841c84 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -1920,8 +1920,7 @@ ADS_STATUS ads_add_service_principal_name(ADS_STRUCT *ads, const char *machine_n
 		ads_msgfree(ads, res);
 		return ADS_ERROR(LDAP_NO_MEMORY);
 	}
-	strupper_m(psp1);
-	strlower_m(&psp1[strlen(spn)]);
+	strlower_m(&psp1[strlen(spn) + 1]);
 	servicePrincipalName[0] = psp1;
 
 	DEBUG(5,("ads_add_service_principal_name: INFO: Adding %s to host %s\n", 
@@ -1934,8 +1933,7 @@ ADS_STATUS ads_add_service_principal_name(ADS_STRUCT *ads, const char *machine_n
 		ret = ADS_ERROR(LDAP_NO_MEMORY);
 		goto out;
 	}
-	strupper_m(psp2);
-	strlower_m(&psp2[strlen(spn)]);
+	strlower_m(&psp2[strlen(spn) + 1]);
 	servicePrincipalName[1] = psp2;
 
 	DEBUG(5,("ads_add_service_principal_name: INFO: Adding %s to host %s\n", 
diff --git a/source3/modules/vfs_fake_perms.c b/source3/modules/vfs_fake_perms.c
index ade2407..9956a3d 100644
--- a/source3/modules/vfs_fake_perms.c
+++ b/source3/modules/vfs_fake_perms.c
@@ -29,6 +29,8 @@
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_VFS
 
+extern struct current_user current_user;
+
 static int fake_perms_stat(vfs_handle_struct *handle,
 			   struct smb_filename *smb_fname)
 {
@@ -41,8 +43,18 @@ static int fake_perms_stat(vfs_handle_struct *handle,
 		} else {
 			smb_fname->st.st_ex_mode = S_IRWXU;
 		}
-		smb_fname->st.st_ex_uid = handle->conn->session_info->utok.uid;
-		smb_fname->st.st_ex_gid = handle->conn->session_info->utok.gid;
+		if (handle->conn->session_info != NULL) {
+			smb_fname->st.st_ex_uid =
+				handle->conn->session_info->utok.uid;
+			smb_fname->st.st_ex_gid =
+				handle->conn->session_info->utok.gid;
+		} else {
+			/*
+			 * Sucks, but current_user is the best we can do here.
+			 */
+			smb_fname->st.st_ex_uid = current_user.ut.uid;
+			smb_fname->st.st_ex_gid = current_user.ut.gid;
+		}
 	}
 
 	return ret;
@@ -59,8 +71,18 @@ static int fake_perms_fstat(vfs_handle_struct *handle, files_struct *fsp, SMB_ST
 		} else {
 			sbuf->st_ex_mode = S_IRWXU;
 		}
-		sbuf->st_ex_uid = handle->conn->session_info->utok.uid;
-		sbuf->st_ex_gid = handle->conn->session_info->utok.gid;
+		if (handle->conn->session_info != NULL) {
+			sbuf->st_ex_uid =
+				handle->conn->session_info->utok.uid;
+			sbuf->st_ex_gid =
+				handle->conn->session_info->utok.gid;
+		} else {
+			/*
+			 * Sucks, but current_user is the best we can do here.
+			 */
+			sbuf->st_ex_uid = current_user.ut.uid;
+			sbuf->st_ex_gid = current_user.ut.gid;
+		}
 	}
 	return ret;
 }
diff --git a/source3/printing/nt_printing_migrate.c b/source3/printing/nt_printing_migrate.c
index 6eb2f44..7776619 100644
--- a/source3/printing/nt_printing_migrate.c
+++ b/source3/printing/nt_printing_migrate.c
@@ -103,7 +103,8 @@ NTSTATUS printing_tdb_migrate_driver(TALLOC_CTX *mem_ctx,
 				     struct rpc_pipe_client *winreg_pipe,
 				     const char *key_name,
 				     unsigned char *data,
-				     size_t length)
+				     size_t length,
+				     bool do_string_conversion)
 {
 	struct dcerpc_binding_handle *b = winreg_pipe->binding_handle;
 	enum ndr_err_code ndr_err;
@@ -121,6 +122,10 @@ NTSTATUS printing_tdb_migrate_driver(TALLOC_CTX *mem_ctx,
 
 	ZERO_STRUCT(r);
 
+	if (do_string_conversion) {
+		r.string_flags = LIBNDR_FLAG_STR_ASCII;
+	}
+
 	ndr_err = ndr_pull_struct_blob(&blob, mem_ctx, &r,
 		   (ndr_pull_flags_fn_t)ndr_pull_ntprinting_driver);
 	if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
@@ -177,7 +182,8 @@ NTSTATUS printing_tdb_migrate_printer(TALLOC_CTX *mem_ctx,
 				      struct rpc_pipe_client *winreg_pipe,
 				      const char *key_name,
 				      unsigned char *data,
-				      size_t length)
+				      size_t length,
+				      bool do_string_conversion)
 {
 	struct dcerpc_binding_handle *b = winreg_pipe->binding_handle;
 	enum ndr_err_code ndr_err;
@@ -200,6 +206,10 @@ NTSTATUS printing_tdb_migrate_printer(TALLOC_CTX *mem_ctx,
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list