[SCM] Samba Shared Repository - branch v4-0-test updated

Karolin Seeger kseeger at samba.org
Fri Sep 28 03:03:04 MDT 2012


The branch, v4-0-test has been updated
       via  c10debd s3-smbd: Don't segfault if user specified ports out for range.
       via  d5f5a6a Fix bug #9213 - Bad ASN.1 NegTokenInit packet can cause invalid free.
       via  4d295c9 s4:dns.py: reproducer for (bug #9184)
       via  c362ed5 lib/tsocket: fix receiving of udp packets from 0 bytes (bug #9184)
       via  036c23a libcli/echo: validate the message length
       via  350d5ec selftest: skip the samba4.smb2.compound testsuite
       via  010c93e s3:smbd:smb2: initialize variable in vfs_default_durable_reconnect()
       via  d995da0 selftest: we fail samba3.smb2.compound.interim2
       via  20656f8 s4:torture:smb2:compound: remove two unused macros (cherry picked from commit 6f6b1c6ac15f225978e8c2d67c1a817d9e098317)
       via  b40a7e6 s4:torture:smb2: don't skip the compound.interim2 test for non win7/win2k8 (cherry picked from commit 8df0b023c51ed198d3054760447e1b273eada991)
       via  c05693a s4:torture:smb2: don't skip the compound.interim1 test for non win7/win2k8 (cherry picked from commit 917e714831178b2a3d07c7f9d09711231a7ccf31)
       via  e17df2b s3:smbd: remove struct member smbd_smb2_request.cancelled - it was only written (cherry picked from commit 88d051f7f18ff88ec5385fdc798f051659134bd3)
       via  829d9dc s3:smb2_lock: let smbd_smb2_create_cancel() trigger NT_STATUS_CANCELED
       via  493dec1 s3:smb2_lock: smbd_smb2_notify_recv() can already return NT_STATUS_CANCELED
       via  c99507d s3:smb2_notify: make use of tevent_req_defer_callback() instead of custom tevent_immediate
       via  a6fd1ee s3:smb2_notify: don't call tevent_req_done() from smbd_smb2_notify_cancel()
       via  e899a51 s3:smb2_lock: let smbd_smb2_lock_cancel() trigger NT_STATUS_CANCELED
       via  aa16e20 s3:smb2_server: avoid segfault in smbd_smb2_request_pending_queue()
       via  0e5ecc5 s4:torture:smb2: extend the compound.invalid1 test
       via  c4d803b s3:smbd:smb2: simplify smbd_smb2_request_validate() and smbd_smb2_request_dispatch()
       via  021dd55 s3:smbd:smb2: add check for session_status for compound requests (cherry picked from commit 27d38b5c27bd96d5124c175d946718bf0836b8f4)
       via  9f73827 s3:smb2_server: do the req->next_status check before the signing checks
       via  b26bf82 s3:smb2_server: reset req->last_session_id and req->last_tid after using it
       via  f24ee3b s4:torture:smb2: fix the compound.invalid3 test to work against windows (cherry picked from commit bd8d50b451ea7f94efa7777fbe5dc0c2c19f6bf9)
       via  f9ef916 s4:torture:smb2: fix compound.related3 test to work against windows (cherry picked from commit 8e525a29a7c6512f61e4647ecb2e0771e2019a49)
       via  8b67af7 s3: Compound requests should continue processing.
       via  ce21ae1 s3-spoolss: Fix builtin forms order to match Windows again.
       via  569f63f s3: For read-only shares, filter out write bits from conn->access_mask
       via  b94c9a6 s3: Fix rejecting mkdir on read-only shares
       via  28f6a6d panic action is defined as GLOBAL_VAR(szPanicAction) not GLOBAL_VAR(panic_action)
       via  6d9841d s3:printing only do printing_subsystem_update when printing is enabled
       via  4ee9a57 dynconfig/config.m4: disallow --prefix=/usr and --prefix=/usr/local without --enable-fhs
       via  4c97f0d s3:smb2_server: fix usage of invalid memory in smb2_signing_check_pdu()
       via  68be257 We now pass "samba3.raw.acls.generic" and "samba3.smb2.acls.GENERIC" with the max access change.
       via  973281b Fix bug #9189 - SMB2 Create doesn't return correct MAX ACCESS access mask in blob.
      from  164cb1c packaging/RHEL-CTDB: add "BUILD_GPFS=no configure.rpm" and "BUILD_GPFS=no makerpms.sh"

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v4-0-test


- Log -----------------------------------------------------------------
commit c10debda1ed4d9b71238829656fc9f78eb75317d
Author: Andreas Schneider <asn at samba.org>
Date:   Tue Sep 25 14:28:22 2012 +0200

    s3-smbd: Don't segfault if user specified ports out for range.
    
    Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
    Autobuild-Date(master): Wed Sep 26 16:28:44 CEST 2012 on sn-devel-104
    (cherry picked from commit 50d324b7e070de4672eff3fb6231923e6dca807a)
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    
    Fix bug #9218 - Samba panics if a user specifies an invalid port number.
    
    Autobuild-User(v4-0-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-0-test): Fri Sep 28 11:02:16 CEST 2012 on sn-devel-104

commit d5f5a6a37c0c06c7e5b783da8636f0bcd23d6c07
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Sep 25 16:35:09 2012 -0700

    Fix bug #9213 - Bad ASN.1 NegTokenInit packet can cause invalid free.
    
    Not the correct fix for the specific issue, but a general fix to
    make sure this can never happen again.
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Wed Sep 26 04:07:57 CEST 2012 on sn-devel-104
    (cherry picked from commit 83f60672e1b3069e6b1b90b376460da895e37df3)

commit 4d295c9aed8234e561ed6c79473b061390f5ceec
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Sep 21 23:06:13 2012 +0200

    s4:dns.py: reproducer for (bug #9184)
    
    metze
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Sat Sep 22 06:08:05 CEST 2012 on sn-devel-104

commit c362ed52f22348e8621703e43e539a9f090b00bc
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Sep 21 22:54:26 2012 +0200

    lib/tsocket: fix receiving of udp packets from 0 bytes (bug #9184)
    
    It's possible for a client to send 0 bytes in a UDP packet,
    we need still need to call recvfrom() and skip the invalid
    packet at a higher level. Otherwise the kernel receive queue
    is blocked.
    
    metze

commit 036c23a33a8420d4529094adb29f03f587c30dfc
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Sep 21 22:18:10 2012 +0200

    libcli/echo: validate the message length
    
    metze

commit 350d5ecc91c5d66db5b48500058c117380852f59
Author: Michael Adam <obnox at samba.org>
Date:   Sat Sep 22 19:07:51 2012 +0200

    selftest: skip the samba4.smb2.compound testsuite
    
    Too many tests are starting but never finish.
    
    Autobuild-User(master): Michael Adam <obnox at samba.org>
    Autobuild-Date(master): Sat Sep 22 20:50:06 CEST 2012 on sn-devel-104
    (cherry picked from commit 162fbf4adbd78af0ca62e01da30e9c8bf86d3b4d)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    
    The last 21 patches address bug #9173 - SMB2 compound request
    create/delete_on_close/close doesn't work as windows.

commit 010c93e25c1de51ab227846053990ab356ca9939
Author: Michael Adam <obnox at samba.org>
Date:   Fri Sep 21 22:56:20 2012 +0200

    s3:smbd:smb2: initialize variable in vfs_default_durable_reconnect()
    
    Found by Ambi's state-of-the-art compiler!
    (cherry picked from commit 93bee9b3e31b398b9becc7be7804025d4066359b)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit d995da069f00846ce251a71ab773c2f8630f5cae
Author: Michael Adam <obnox at samba.org>
Date:   Thu Sep 20 20:46:53 2012 +0200

    selftest: we fail samba3.smb2.compound.interim2
    
    We currently return NT_STATUS_CANCELLED where we should
    return NT_STATUS_INTERNAL_ERROR.
    (cherry picked from commit 841934647b06d6400148932cc8ce02a20c209610)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 20656f8c4f1274605d0b6e8cdc31724916e262ae
Author: Michael Adam <obnox at samba.org>
Date:   Thu Sep 20 00:43:54 2012 +0200

    s4:torture:smb2:compound: remove two unused macros (cherry picked from commit 6f6b1c6ac15f225978e8c2d67c1a817d9e098317)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit b40a7e608ad3be47e326057162dd60b6fd9dba56
Author: Michael Adam <obnox at samba.org>
Date:   Thu Sep 20 00:41:48 2012 +0200

    s4:torture:smb2: don't skip the compound.interim2 test for non win7/win2k8 (cherry picked from commit 8df0b023c51ed198d3054760447e1b273eada991)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit c05693a139c57dabb5925eebaef260fdbb86268d
Author: Michael Adam <obnox at samba.org>
Date:   Thu Sep 20 00:41:04 2012 +0200

    s4:torture:smb2: don't skip the compound.interim1 test for non win7/win2k8 (cherry picked from commit 917e714831178b2a3d07c7f9d09711231a7ccf31)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit e17df2be46e000f18651510ac1821fad14a325dc
Author: Michael Adam <obnox at samba.org>
Date:   Sat Sep 22 02:05:18 2012 +0200

    s3:smbd: remove struct member smbd_smb2_request.cancelled - it was only written (cherry picked from commit 88d051f7f18ff88ec5385fdc798f051659134bd3)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 829d9dc5bf45853756c7c1a61870764e5be61fc1
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Sep 20 16:16:03 2012 +0200

    s3:smb2_lock: let smbd_smb2_create_cancel() trigger NT_STATUS_CANCELED
    
    Instead of violating the tevent_req layers.
    
    metze
    (cherry picked from commit 603f9bfa4cf7910e1c1cae1a8d0741a6d0874baa)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 493dec1a89908cb569df4e76c576c66e80c0c8d2
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Sep 20 16:16:03 2012 +0200

    s3:smb2_lock: smbd_smb2_notify_recv() can already return NT_STATUS_CANCELED
    
    That's why we can remove the code that violates the tevent_req layers.
    
    metze
    (cherry picked from commit 65a81060093cf9d7c0ebf8d6e160625bdc87baab)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit c99507d8c6e02e53e3a6f91d02657d79a2d2ef7b
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Sep 20 16:25:58 2012 +0200

    s3:smb2_notify: make use of tevent_req_defer_callback() instead of custom tevent_immediate
    
    metze
    (cherry picked from commit 882cee0acb9c1e2105a005f0ea90691197a696c7)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit a6fd1ee113d1b2c182edca97a5a6bd153fb30539
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Sep 20 16:23:26 2012 +0200

    s3:smb2_notify: don't call tevent_req_done() from smbd_smb2_notify_cancel()
    
    smbd_notify_cancel_by_smbreq() will already trigger this via
    smbd_smb2_notify_reply() and smbd_smb2_notify_reply_trigger().
    
    metze
    (cherry picked from commit 1f0dfd42f16c388abc7054a7b615d2e81031472b)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit e899a51df12a4b31c1862ba750989c478706af3f
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Sep 20 16:16:03 2012 +0200

    s3:smb2_lock: let smbd_smb2_lock_cancel() trigger NT_STATUS_CANCELED
    
    Instead of violating the tevent_req layers.
    
    metze
    (cherry picked from commit 1f8e4732c5870043fbbc22c772404b5380f808f0)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit aa16e201072bb90c1f64d87320cdd2947990ae83
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Sep 20 16:04:01 2012 +0200

    s3:smb2_server: avoid segfault in smbd_smb2_request_pending_queue()
    
    Because we should not call smbd_smb2_request_error() on an
    request that is still running.
    
    If the subreq implementes a cancel function, this should
    take care of triggering smbd_smb2_request_error.
    
    metze
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    (cherry picked from commit 9249871f40aab021d62d3154f8ca286b52f5ef76)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 0e5ecc554393b1899c77d9e15868d651beb8d647
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Sep 21 22:20:20 2012 +0200

    s4:torture:smb2: extend the compound.invalid1 test
    
    Test that when turning the related flag back off for the
    last compound request, the return code changes from
    invalid parameter to file closed.
    
    Pair-Programmed-With: Michael Adam <obnox at samba.org>
    (cherry picked from commit 25437df8a65e56616499dda18c696f58be08f67a)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit c4d803bcc7baf6282fdb81a147e310ad8713e8f1
Author: Michael Adam <obnox at samba.org>
Date:   Fri Sep 21 21:43:36 2012 +0200

    s3:smbd:smb2: simplify smbd_smb2_request_validate() and smbd_smb2_request_dispatch()
    
    removes unnneccary checks/assignments for compound_related and next_status
    and duplicate setting of error status.
    
    And remove (now) unused next_status from struct smbd_smb2_request.
    
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
    (cherry picked from commit 1ae6f9c62629f8513bbe93a56775b3c64ff06832)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 021dd55db013b552859afaf3f5a59fb2edb9f805
Author: Michael Adam <obnox at samba.org>
Date:   Sat Sep 22 04:06:27 2012 +0200

    s3:smbd:smb2: add check for session_status for compound requests (cherry picked from commit 27d38b5c27bd96d5124c175d946718bf0836b8f4)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 9f73827a8450d0598781fd85f08236d478670d23
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Sep 20 00:52:19 2012 +0200

    s3:smb2_server: do the req->next_status check before the signing checks
    
    Windows 2012 returns NT_STATUS_INVALID_PARAMETER to
    the smb2.compound.invalid1 test if that uses signing
    (instead of NT_STATUS_ACCESS_DENIED).
    
    metze
    (cherry picked from commit 4384485f82aac109bf4c4c31075e313e54b4c076)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit b26bf825be046dd0d0424b53f0c09346888a3df7
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Sep 20 05:10:28 2012 +0200

    s3:smb2_server: reset req->last_session_id and req->last_tid after using it
    
    If we can find a valid session or tcon we'll set it after the lookup,
    but it need to make sure to reset it if we don't find the session.
    
    This fixes a problem where a compound unrelated request between
    related requests doesn't reset the session.
    
    If we have 3 requests in a compound chain, request 3 should never
    use the id's cached from request 1. It should only every inherit
    handles from request 2.
    
    metze
    (cherry picked from commit 2552b6632372b35cbd7b788c4e00091dfe520a41)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit f24ee3b4ed0ee54b754a27c855b94114ec378330
Author: Michael Adam <obnox at samba.org>
Date:   Thu Sep 20 00:36:29 2012 +0200

    s4:torture:smb2: fix the compound.invalid3 test to work against windows (cherry picked from commit bd8d50b451ea7f94efa7777fbe5dc0c2c19f6bf9)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit f9ef9168906233f6b770307f60a01d9c7ed08e02
Author: Michael Adam <obnox at samba.org>
Date:   Thu Sep 20 00:35:52 2012 +0200

    s4:torture:smb2: fix compound.related3 test to work against windows (cherry picked from commit 8e525a29a7c6512f61e4647ecb2e0771e2019a49)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 8b67af7c7a84a98794f0941473356537b8d5ee85
Author: Ira Cooper <ira at samba.org>
Date:   Wed Sep 19 18:39:07 2012 +0000

    s3: Compound requests should continue processing.
    
    This patch addresses #9173.
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    (cherry picked from commit 75951946193c874b6db30c1b9c8722264c3ce656)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit ce21ae164454afacaa81c9a5ad047be0396a96ed
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Sep 26 18:21:55 2012 +0200

    s3-spoolss: Fix builtin forms order to match Windows again.
    
    Thanks to mamachine at gmail.com.
    
    (cherry picked from commit 24fc5b46f2b33f94bf79fc375432609697aaa45e)
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    
    Fix bug #8632 - printing regression: form sizes seem broken, cannot print letter
    size correctly.

commit 569f63f60c6ada7e935aeec3ae797a2ecde5af21
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Sep 26 15:26:35 2012 -0700

    s3: For read-only shares, filter out write bits from conn->access_mask
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 54e5590cc1267e9c886bc9abd37d8a8eb33cf3f6)
    
    The last 2 patches address bug #9217 - CreateFile with FILE_DIRECTORY_FILE can
    create directories on read-only shares.

commit b94c9a6aaa3b28a0685c480855f57b8bb732e973
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Sep 26 14:53:59 2012 -0700

    s3: Fix rejecting mkdir on read-only shares
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 6351ed1ec4b93ef1d7b79bab0b92536d74693d2a)

commit 28f6a6d8c542e8f1ff71486cb5fefceba86345e7
Author: Matthieu Patou <mat at matws.net>
Date:   Mon Sep 17 16:51:02 2012 -0700

    panic action is defined as GLOBAL_VAR(szPanicAction) not GLOBAL_VAR(panic_action)
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Tue Sep 18 06:12:00 CEST 2012 on sn-devel-104
    (cherry picked from commit 2a7484eb7286a6896826ad1ed15aa7b1760a451c)
    
    Fix bug #9199 - fix usage of panic action.

commit 6d9841db350aae14e26b23fa79a48786274e084c
Author: Christian Ambach <ambi at samba.org>
Date:   Sun Sep 23 08:39:49 2012 +0200

    s3:printing only do printing_subsystem_update when printing is enabled
    
    no point in calling this if printing was disabled and no spoolss service was started
    this hurts CTDB clusters as the smbds on the cluster nodes will fight for the single record in the TDB
    
    This fixes Bug 9197 - Disabling printing still makes smbd create and access printer_list.tdb

commit 4ee9a57f4ee14812b636e1e5036bec1b9189dc2e
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed Jan 18 08:33:37 2012 +0100

    dynconfig/config.m4: disallow --prefix=/usr and --prefix=/usr/local without --enable-fhs
    
    This matches the waf configure behavior and catches the case where old build
    scripts try '--with-fhs' instead of '--enable-fhs'.
    
    metze
    (cherry picked from commit ae037670b83557d8591c633896186a3634de30cc)
    
    Fix bug #9194 - dynconfig/config.m4: disallow --prefix=/usr and
    --prefix=/usr/local without --enable-fhs.

commit 4c97f0dc4fa4cff95d91056579a226ca75048b5c
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Sep 20 00:42:02 2012 +0200

    s3:smb2_server: fix usage of invalid memory in smb2_signing_check_pdu()
    
    metze
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Thu Sep 20 07:18:31 CEST 2012 on sn-devel-104
    (cherry picked from commit bc77745cfaf502e24575dab9ae323643d94760e3)
    
    Fix bug #9193 - s3:smb2_server: fix usage of invalid memory in
    smb2_signing_check_pdu().

commit 68be2576d91d21936d94f4be39be4202e71ab75f
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Sep 20 13:35:47 2012 -0700

    We now pass "samba3.raw.acls.generic" and "samba3.smb2.acls.GENERIC" with the max access change.

commit 973281b257030df1eea39d935c1dbafde2896f07
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Sep 20 12:32:10 2012 -0700

    Fix bug #9189 - SMB2 Create doesn't return correct MAX ACCESS access mask in blob.
    
    If we aren't already granted DELETE access, check if we have
    DELETE_CHILD in the containing directory.

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

Summary of changes:
 dynconfig/config.m4                         |    4 +
 lib/param/loadparm.c                        |    2 +-
 lib/tsocket/tsocket_bsd.c                   |    5 +-
 libcli/echo/echo.c                          |    5 +
 selftest/knownfail                          |    4 +-
 selftest/skip                               |    1 +
 source3/libsmb/clispnego.c                  |    4 +
 source3/param/loadparm.c                    |    1 -
 source3/rpc_client/cli_winreg_spoolss.c     |  238 +++++++++++++--------------
 source3/smbd/durable.c                      |    2 +-
 source3/smbd/globals.h                      |    3 -
 source3/smbd/open.c                         |    9 +-
 source3/smbd/server.c                       |   21 ++-
 source3/smbd/service.c                      |    7 +
 source3/smbd/smb2_create.c                  |   17 +--
 source3/smbd/smb2_lock.c                    |   30 +---
 source3/smbd/smb2_notify.c                  |   55 +------
 source3/smbd/smb2_read.c                    |    2 -
 source3/smbd/smb2_server.c                  |   93 +++--------
 source3/smbd/smb2_write.c                   |    2 -
 source4/scripting/python/samba/tests/dns.py |   29 ++++
 source4/torture/smb2/compound.c             |   30 ++--
 22 files changed, 238 insertions(+), 326 deletions(-)


Changeset truncated at 500 lines:

diff --git a/dynconfig/config.m4 b/dynconfig/config.m4
index 842a960..6b5dfdb 100644
--- a/dynconfig/config.m4
+++ b/dynconfig/config.m4
@@ -19,6 +19,10 @@ AC_ARG_ENABLE(fhs,
 [AS_HELP_STRING([--enable-fhs], [Turn on FHS support (default=no)])])
 
 if test x$enable_fhs != xyes; then
+	if test x"$prefix" = x"/usr" -o x"$prefix" = x"/usr/local"; then
+		AC_MSG_WARN([Don't install directly under /usr or /usr/local without using the FHS option (--enable-fhs)])
+		AC_MSG_ERROR([invalid --prefix=$prefix])
+	fi
 	MODULESDIR="${libdir}"
 	INCLUDEDIR="${includedir}"
 	SETUPDIR="${datadir}/setup"
diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
index 990dd29..b2e4218 100644
--- a/lib/param/loadparm.c
+++ b/lib/param/loadparm.c
@@ -2295,7 +2295,7 @@ static bool lpcfg_update(struct loadparm_context *lp_ctx)
 		return true;
 	}
 
-	panic_action = lp_ctx->globals->panic_action;
+	panic_action = lp_ctx->globals->szPanicAction;
 
 	reload_charcnv(lp_ctx);
 
diff --git a/lib/tsocket/tsocket_bsd.c b/lib/tsocket/tsocket_bsd.c
index 9e80065..d5721b4 100644
--- a/lib/tsocket/tsocket_bsd.c
+++ b/lib/tsocket/tsocket_bsd.c
@@ -876,10 +876,6 @@ static void tdgram_bsd_recvfrom_handler(void *private_data)
 	bool retry;
 
 	ret = tsocket_bsd_pending(bsds->fd);
-	if (ret == 0) {
-		/* retry later */
-		return;
-	}
 	err = tsocket_bsd_error_from_errno(ret, errno, &retry);
 	if (retry) {
 		/* retry later */
@@ -889,6 +885,7 @@ static void tdgram_bsd_recvfrom_handler(void *private_data)
 		return;
 	}
 
+	/* note that 'ret' can be 0 here */
 	state->buf = talloc_array(state, uint8_t, ret);
 	if (tevent_req_nomem(state->buf, req)) {
 		return;
diff --git a/libcli/echo/echo.c b/libcli/echo/echo.c
index b6005cb..0f5f7f7 100644
--- a/libcli/echo/echo.c
+++ b/libcli/echo/echo.c
@@ -172,6 +172,11 @@ static void echo_request_done(struct tevent_req *subreq)
 		return;
 	}
 
+	if (len != state->orig_len) {
+		tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE);
+		return;
+	}
+
 	state->message[len-1] = '\0';
 	/* Once the async function has completed, set tevent_req_done() */
 	tevent_req_done(req);
diff --git a/selftest/knownfail b/selftest/knownfail
index 0180eb3..3f4b513 100644
--- a/selftest/knownfail
+++ b/selftest/knownfail
@@ -45,7 +45,6 @@
 ^samba3.blackbox.smbclient_machine_auth.plain \(s3dc:local\)# the S3dc does not currently set up a self-join
 ^samba3.raw.samba3hide.samba3hide\((s3dc|plugin_s4_dc)\) # This test fails against an smbd environment with NT ACLs enabled
 ^samba3.raw.samba3closeerr.samba3closeerr\(s3dc\) # This test fails against an smbd environment with NT ACLs enabled
-^samba3.raw.acls.generic\(s3dc\) # This fails against smbd
 ^samba3.base.delete.deltest16a
 ^samba3.base.delete.deltest17a
 ^samba3.unix.whoami anonymous connection.whoami\(plugin_s4_dc\) # We need to resolve if we should be including SID_NT_WORLD and SID_NT_NETWORK in this token
@@ -196,13 +195,13 @@
 ^samba3.smb2.lease.multibreak
 ^samba3.smb2.oplock.batch12
 ^samba3.smb2.oplock.batch20
-^samba3.smb2.acls.GENERIC
 ^samba3.smb2.streams.rename
 ^samba3.smb2.streams.rename2
 ^samba3.smb2.streams.attributes
 ^samba3.smb2.getinfo.getinfo
 ^samba3.smb2.setinfo.setinfo
 ^samba3.smb2.session.*reauth5 # some special anonymous checks?
+^samba3.smb2.compound.interim2 # wrong return code (STATUS_CANCELLED)
 ^samba3.raw.session.*reauth2 # maybe fix this?
 ^samba3.rpc.spoolss.printer.addprinter.driver_info_winreg # knownfail or flapping?
 ^samba3.rpc.spoolss.printer.addprinterex.driver_info_winreg # knownfail or flapping?
@@ -212,7 +211,6 @@
 # but in the interests of ensuring we do not regress, we run the tests
 # and list the current failures here.
 #
-^samba3.raw.acls.generic\(plugin_s4_dc\)
 ^samba3.rpc.eventlog.eventlog.GetLogIntormation\(plugin_s4_dc\)
 ^samba3.rpc.eventlog.eventlog.FlushEventLog\(plugin_s4_dc\)
 ^samba3.rpc.eventlog.eventlog.ReportEventLog\(plugin_s4_dc\)
diff --git a/selftest/skip b/selftest/skip
index 174f257..171eee0 100644
--- a/selftest/skip
+++ b/selftest/skip
@@ -57,6 +57,7 @@
 ^samba4.smb2.durable-v2-open
 ^samba4.smb2.dir
 ^samba4.smb2.session
+^samba4.smb2.compound
 ^samba4.ntvfs.cifs.*.base.charset
 ^samba4.ntvfs.cifs.*.base.iometer
 ^samba4.ntvfs.cifs.*.base.casetable
diff --git a/source3/libsmb/clispnego.c b/source3/libsmb/clispnego.c
index a17efbf..9b4f8f9 100644
--- a/source3/libsmb/clispnego.c
+++ b/source3/libsmb/clispnego.c
@@ -103,6 +103,10 @@ bool spnego_parse_negTokenInit(TALLOC_CTX *ctx,
 	bool ret;
 	ASN1_DATA *data;
 
+	for (i = 0; i < ASN1_MAX_OIDS; i++) {
+		OIDs[i] = NULL;
+	}
+
 	data = asn1_init(talloc_tos());
 	if (data == NULL) {
 		return false;
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index f1999ad..61606ce 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -131,7 +131,6 @@ static bool defaults_saved = false;
 	char *tls_cafile;						\
 	char *tls_crlfile;						\
 	char *tls_dhpfile;						\
-	char *panic_action;						\
 	int bPreferredMaster;
 
 #include "param/param_global.h"
diff --git a/source3/rpc_client/cli_winreg_spoolss.c b/source3/rpc_client/cli_winreg_spoolss.c
index 7bd5033..ac4fe86 100644
--- a/source3/rpc_client/cli_winreg_spoolss.c
+++ b/source3/rpc_client/cli_winreg_spoolss.c
@@ -56,126 +56,124 @@
 
 /*        FLAGS,                NAME,                              with,   height,   left, top, right, bottom */
 static const struct spoolss_FormInfo1 builtin_forms1[] = {
-	{ SPOOLSS_FORM_BUILTIN, "10x11",                          {0x3e030,0x44368}, {0x0,0x0,0x3e030,0x44368} },
-	{ SPOOLSS_FORM_BUILTIN, "10x14",                          {0x3e030,0x56d10}, {0x0,0x0,0x3e030,0x56d10} },
-	{ SPOOLSS_FORM_BUILTIN, "11x17",                          {0x44368,0x696b8}, {0x0,0x0,0x44368,0x696b8} },
-	{ SPOOLSS_FORM_BUILTIN, "12x11",                          {0x4a724,0x443e1}, {0x0,0x0,0x4a724,0x443e1} },
-	{ SPOOLSS_FORM_BUILTIN, "15x11",                          {0x5d048,0x44368}, {0x0,0x0,0x5d048,0x44368} },
-	{ SPOOLSS_FORM_BUILTIN, "6 3/4 Envelope",                 {0x167ab,0x284ec}, {0x0,0x0,0x167ab,0x284ec} },
-	{ SPOOLSS_FORM_BUILTIN, "9x11",                           {0x37cf8,0x44368}, {0x0,0x0,0x37cf8,0x44368} },
-	{ SPOOLSS_FORM_BUILTIN, "A0",                             {0xcd528,0x122488},{0x0,0x0,0xcd528,0x122488} },
-	{ SPOOLSS_FORM_BUILTIN, "A1",                             {0x91050,0xcd528}, {0x0,0x0,0x91050,0xcd528} },
-	{ SPOOLSS_FORM_BUILTIN, "A2",                             {0x668a0,0x91050}, {0x0,0x0,0x668a0,0x91050} },
-	{ SPOOLSS_FORM_BUILTIN, "A3 Extra Transverse",            {0x4e9d0,0x6ca48}, {0x0,0x0,0x4e9d0,0x6ca48} },
-	{ SPOOLSS_FORM_BUILTIN, "A3 Extra",                       {0x4e9d0,0x6ca48}, {0x0,0x0,0x4e9d0,0x6ca48} },
-	{ SPOOLSS_FORM_BUILTIN, "A3 Rotated",                     {0x668a0,0x48828}, {0x0,0x0,0x668a0,0x48828} },
-	{ SPOOLSS_FORM_BUILTIN, "A3 Transverse",                  {0x48828,0x668a0}, {0x0,0x0,0x48828,0x668a0} },
-	{ SPOOLSS_FORM_BUILTIN, "A3",                             {0x48828,0x668a0}, {0x0,0x0,0x48828,0x668a0} },
-	{ SPOOLSS_FORM_BUILTIN, "A4 Extra",                       {0x397c2,0x4eb16}, {0x0,0x0,0x397c2,0x4eb16} },
-	{ SPOOLSS_FORM_BUILTIN, "A4 Plus",                        {0x33450,0x50910}, {0x0,0x0,0x33450,0x50910} },
-	{ SPOOLSS_FORM_BUILTIN, "A4 Rotated",                     {0x48828,0x33450}, {0x0,0x0,0x48828,0x33450} },
-	{ SPOOLSS_FORM_BUILTIN, "A4 Small",                       {0x33450,0x48828}, {0x0,0x0,0x33450,0x48828} },
-	{ SPOOLSS_FORM_BUILTIN, "A4 Transverse",                  {0x33450,0x48828}, {0x0,0x0,0x33450,0x48828} },
-	{ SPOOLSS_FORM_BUILTIN, "A4",                             {0x33450,0x48828}, {0x0,0x0,0x33450,0x48828} },
-	{ SPOOLSS_FORM_BUILTIN, "A5 Extra",                       {0x2a7b0,0x395f8}, {0x0,0x0,0x2a7b0,0x395f8} },
-	{ SPOOLSS_FORM_BUILTIN, "A5 Rotated",                     {0x33450,0x24220}, {0x0,0x0,0x33450,0x24220} },
-	{ SPOOLSS_FORM_BUILTIN, "A5 Transverse",                  {0x24220,0x33450}, {0x0,0x0,0x24220,0x33450} },
-	{ SPOOLSS_FORM_BUILTIN, "A5",                             {0x24220,0x33450}, {0x0,0x0,0x24220,0x33450} },
-	{ SPOOLSS_FORM_BUILTIN, "A6 Rotated",                     {0x24220,0x19a28}, {0x0,0x0,0x24220,0x19a28} },
-	{ SPOOLSS_FORM_BUILTIN, "A6",                             {0x19a28,0x24220}, {0x0,0x0,0x19a28,0x24220} },
-	{ SPOOLSS_FORM_BUILTIN, "B4 (ISO)",                       {0x3d090,0x562e8}, {0x0,0x0,0x3d090,0x562e8} },
-	{ SPOOLSS_FORM_BUILTIN, "B4 (JIS) Rotated",               {0x58de0,0x3ebe8}, {0x0,0x0,0x58de0,0x3ebe8} },
-	{ SPOOLSS_FORM_BUILTIN, "B4 (JIS)",                       {0x3ebe8,0x58de0}, {0x0,0x0,0x3ebe8,0x58de0} },
-	{ SPOOLSS_FORM_BUILTIN, "B5 (ISO) Extra",                 {0x31128,0x43620}, {0x0,0x0,0x31128,0x43620} },
-	{ SPOOLSS_FORM_BUILTIN, "B5 (JIS) Rotated",               {0x3ebe8,0x2c6f0}, {0x0,0x0,0x3ebe8,0x2c6f0} },
-	{ SPOOLSS_FORM_BUILTIN, "B5 (JIS) Transverse",            {0x2c6f0,0x3ebe8}, {0x0,0x0,0x2c6f0,0x3ebe8} },
-	{ SPOOLSS_FORM_BUILTIN, "B5 (JIS)",                       {0x2c6f0,0x3ebe8}, {0x0,0x0,0x2c6f0,0x3ebe8} },
-	{ SPOOLSS_FORM_BUILTIN, "B6 (JIS) Rotated",               {0x2c6f0,0x1f400}, {0x0,0x0,0x2c6f0,0x1f400} },
-	{ SPOOLSS_FORM_BUILTIN, "B6 (JIS)",                       {0x1f400,0x2c6f0}, {0x0,0x0,0x1f400,0x2c6f0} },
-	{ SPOOLSS_FORM_BUILTIN, "C size sheet",                   {0x696b8,0x886d0}, {0x0,0x0,0x696b8,0x886d0} },
-	{ SPOOLSS_FORM_BUILTIN, "D size sheet",                   {0x886d0,0xd2d70}, {0x0,0x0,0x886d0,0xd2d70} },
-	{ SPOOLSS_FORM_BUILTIN, "Double Japan Postcard Rotated",  {0x24220,0x30d40}, {0x0,0x0,0x24220,0x30d40} },
-	{ SPOOLSS_FORM_BUILTIN, "E size sheet",                   {0xd2d70,0x110da0},{0x0,0x0,0xd2d70,0x110da0} },
-	{ SPOOLSS_FORM_BUILTIN, "Envelope #10",                   {0x19947,0x3ae94}, {0x0,0x0,0x19947,0x3ae94} },
-	{ SPOOLSS_FORM_BUILTIN, "Envelope #11",                   {0x1be7c,0x40565}, {0x0,0x0,0x1be7c,0x40565} },
-	{ SPOOLSS_FORM_BUILTIN, "Envelope #12",                   {0x1d74a,0x44368}, {0x0,0x0,0x1d74a,0x44368} },
-	{ SPOOLSS_FORM_BUILTIN, "Envelope #14",                   {0x1f018,0x47504}, {0x0,0x0,0x1f018,0x47504} },
-	{ SPOOLSS_FORM_BUILTIN, "Envelope #9",                    {0x18079,0x37091}, {0x0,0x0,0x18079,0x37091} },
-	{ SPOOLSS_FORM_BUILTIN, "Envelope B4",                    {0x3d090,0x562e8}, {0x0,0x0,0x3d090,0x562e8} },
-	{ SPOOLSS_FORM_BUILTIN, "Envelope B5",                    {0x2af80,0x3d090}, {0x0,0x0,0x2af80,0x3d090} },
-	{ SPOOLSS_FORM_BUILTIN, "Envelope B6",                    {0x2af80,0x1e848}, {0x0,0x0,0x2af80,0x1e848} },
-	{ SPOOLSS_FORM_BUILTIN, "Envelope C3",                    {0x4f1a0,0x6fd10}, {0x0,0x0,0x4f1a0,0x6fd10} },
-	{ SPOOLSS_FORM_BUILTIN, "Envelope C4",                    {0x37e88,0x4f1a0}, {0x0,0x0,0x37e88,0x4f1a0} },
-	{ SPOOLSS_FORM_BUILTIN, "Envelope C5",                    {0x278d0,0x37e88}, {0x0,0x0,0x278d0,0x37e88} },
-	{ SPOOLSS_FORM_BUILTIN, "Envelope C6",                    {0x1bd50,0x278d0}, {0x0,0x0,0x1bd50,0x278d0} },
-	{ SPOOLSS_FORM_BUILTIN, "Envelope C65",                   {0x1bd50,0x37e88}, {0x0,0x0,0x1bd50,0x37e88} },
-	{ SPOOLSS_FORM_BUILTIN, "Envelope DL",                    {0x1adb0,0x35b60}, {0x0,0x0,0x1adb0,0x35b60} },
-	{ SPOOLSS_FORM_BUILTIN, "Envelope Invite",                {0x35b60,0x35b60}, {0x0,0x0,0x35b60,0x35b60} },
-	{ SPOOLSS_FORM_BUILTIN, "Envelope Monarch",               {0x18079,0x2e824}, {0x0,0x0,0x18079,0x2e824} },
-	{ SPOOLSS_FORM_BUILTIN, "Envelope",                       {0x1adb0,0x38270}, {0x0,0x0,0x1adb0,0x38270} },
-	{ SPOOLSS_FORM_BUILTIN, "Executive",                      {0x2cf56,0x411cc}, {0x0,0x0,0x2cf56,0x411cc} },
-	{ SPOOLSS_FORM_BUILTIN, "Folio",                          {0x34b5c,0x509d8}, {0x0,0x0,0x34b5c,0x509d8} },
-	{ SPOOLSS_FORM_BUILTIN, "German Legal Fanfold",           {0x34b5c,0x509d8}, {0x0,0x0,0x34b5c,0x509d8} },
-	{ SPOOLSS_FORM_BUILTIN, "German Std Fanfold",             {0x34b5c,0x4a6a0}, {0x0,0x0,0x34b5c,0x4a6a0} },
-	{ SPOOLSS_FORM_BUILTIN, "Japan Envelope Chou #3 Rotated", {0x395f8,0x1d4c0}, {0x0,0x0,0x395f8,0x1d4c0} },
-	{ SPOOLSS_FORM_BUILTIN, "Japan Envelope Chou #4 Rotated", {0x320c8,0x15f90}, {0x0,0x0,0x320c8,0x15f90} },
-	{ SPOOLSS_FORM_BUILTIN, "Japan Envelope Kaku #2 Rotated", {0x510e0,0x3a980}, {0x0,0x0,0x510e0,0x3a980} },
-	{ SPOOLSS_FORM_BUILTIN, "Japan Envelope Kaku #3 Rotated", {0x43a08,0x34bc0}, {0x0,0x0,0x43a08,0x34bc0} },
-	{ SPOOLSS_FORM_BUILTIN, "Japan Envelope You #4 Rotated",  {0x395f8,0x19a28}, {0x0,0x0,0x395f8,0x19a28} },
-	{ SPOOLSS_FORM_BUILTIN, "Japan Envelope You #4",          {0x19a28,0x395f8}, {0x0,0x0,0x19a28,0x395f8} },
-	{ SPOOLSS_FORM_BUILTIN, "Japanese Double Postcard",       {0x30d40,0x24220}, {0x0,0x0,0x30d40,0x24220} },
-	{ SPOOLSS_FORM_BUILTIN, "Japanese Envelope Chou #3",      {0x1d4c0,0x395f8}, {0x0,0x0,0x1d4c0,0x395f8} },
-	{ SPOOLSS_FORM_BUILTIN, "Japanese Envelope Chou #4",      {0x15f90,0x320c8}, {0x0,0x0,0x15f90,0x320c8} },
-	{ SPOOLSS_FORM_BUILTIN, "Japanese Envelope Kaku #2",      {0x3a980,0x510e0}, {0x0,0x0,0x3a980,0x510e0} },
-	{ SPOOLSS_FORM_BUILTIN, "Japanese Envelope Kaku #3",      {0x34bc0,0x43a08}, {0x0,0x0,0x34bc0,0x43a08} },
-	{ SPOOLSS_FORM_BUILTIN, "Japanese Postcard Rotated",      {0x24220,0x186a0}, {0x0,0x0,0x24220,0x186a0} },
-	{ SPOOLSS_FORM_BUILTIN, "Japanese Postcard",              {0x186a0,0x24220}, {0x0,0x0,0x186a0,0x24220} },
-	{ SPOOLSS_FORM_BUILTIN, "Ledger",                         {0x696b8,0x44368}, {0x0,0x0,0x696b8,0x44368} },
-	{ SPOOLSS_FORM_BUILTIN, "Legal Extra",                    {0x3ae94,0x5d048}, {0x0,0x0,0x3ae94,0x5d048} },
-	{ SPOOLSS_FORM_BUILTIN, "Legal",                          {0x34b5c,0x56d10}, {0x0,0x0,0x34b5c,0x56d10} },
-	{ SPOOLSS_FORM_BUILTIN, "Letter Extra Transverse",        {0x3ae94,0x4a6a0}, {0x0,0x0,0x3ae94,0x4a6a0} },
-	{ SPOOLSS_FORM_BUILTIN, "Letter Extra",                   {0x3ae94,0x4a6a0}, {0x0,0x0,0x3ae94,0x4a6a0} },
-	{ SPOOLSS_FORM_BUILTIN, "Letter Plus",                    {0x34b5c,0x4eb16}, {0x0,0x0,0x34b5c,0x4eb16} },
-	{ SPOOLSS_FORM_BUILTIN, "Letter Rotated",                 {0x44368,0x34b5c}, {0x0,0x0,0x44368,0x34b5c} },
-	{ SPOOLSS_FORM_BUILTIN, "Letter Small",                   {0x34b5c,0x44368}, {0x0,0x0,0x34b5c,0x44368} },
-	{ SPOOLSS_FORM_BUILTIN, "Letter Transverse",              {0x34b5c,0x44368}, {0x0,0x0,0x34b5c,0x44368} },
-	{ SPOOLSS_FORM_BUILTIN, "Letter",                         {0x34b5c,0x44368}, {0x0,0x0,0x34b5c,0x44368} },
-	{ SPOOLSS_FORM_BUILTIN, "Note",                           {0x34b5c,0x44368}, {0x0,0x0,0x34b5c,0x44368} },
-	{ SPOOLSS_FORM_BUILTIN, "PRC 16K Rotated",                {0x3f7a0,0x2de60}, {0x0,0x0,0x3f7a0,0x2de60} },
-	{ SPOOLSS_FORM_BUILTIN, "PRC 16K",                        {0x2de60,0x3f7a0}, {0x0,0x0,0x2de60,0x3f7a0} },
-	{ SPOOLSS_FORM_BUILTIN, "PRC 32K Rotated",                {0x2cec0,0x1fbd0}, {0x0,0x0,0x2cec0,0x1fbd0} },
-	{ SPOOLSS_FORM_BUILTIN, "PRC 32K",                        {0x1fbd0,0x2cec0}, {0x0,0x0,0x1fbd0,0x2cec0} },
-	{ SPOOLSS_FORM_BUILTIN, "PRC 32K(Big) Rotated",           {0x318f8,0x222e0}, {0x0,0x0,0x318f8,0x222e0} },
-	{ SPOOLSS_FORM_BUILTIN, "PRC 32K(Big)",                   {0x222e0,0x318f8}, {0x0,0x0,0x222e0,0x318f8} },
-	{ SPOOLSS_FORM_BUILTIN, "PRC Envelope #1 Rotated",        {0x28488,0x18e70}, {0x0,0x0,0x28488,0x18e70} },
-	{ SPOOLSS_FORM_BUILTIN, "PRC Envelope #1",                {0x18e70,0x28488}, {0x0,0x0,0x18e70,0x28488} },
-	{ SPOOLSS_FORM_BUILTIN, "PRC Envelope #10 Rotated",       {0x6fd10,0x4f1a0}, {0x0,0x0,0x6fd10,0x4f1a0} },
-	{ SPOOLSS_FORM_BUILTIN, "PRC Envelope #10",               {0x4f1a0,0x6fd10}, {0x0,0x0,0x4f1a0,0x6fd10} },
-	{ SPOOLSS_FORM_BUILTIN, "PRC Envelope #2 Rotated",        {0x2af80,0x18e70}, {0x0,0x0,0x2af80,0x18e70} },
-	{ SPOOLSS_FORM_BUILTIN, "PRC Envelope #2",                {0x18e70,0x2af80}, {0x0,0x0,0x18e70,0x2af80} },
-	{ SPOOLSS_FORM_BUILTIN, "PRC Envelope #3 Rotated",        {0x2af80,0x1e848}, {0x0,0x0,0x2af80,0x1e848} },
-	{ SPOOLSS_FORM_BUILTIN, "PRC Envelope #3",                {0x1e848,0x2af80}, {0x0,0x0,0x1e848,0x2af80} },
-	{ SPOOLSS_FORM_BUILTIN, "PRC Envelope #4 Rotated",        {0x32c80,0x1adb0}, {0x0,0x0,0x32c80,0x1adb0} },
-	{ SPOOLSS_FORM_BUILTIN, "PRC Envelope #4",                {0x1adb0,0x32c80}, {0x0,0x0,0x1adb0,0x32c80} },
-	{ SPOOLSS_FORM_BUILTIN, "PRC Envelope #5 Rotated",        {0x35b60,0x1adb0}, {0x0,0x0,0x35b60,0x1adb0} },
-	{ SPOOLSS_FORM_BUILTIN, "PRC Envelope #5",                {0x1adb0,0x35b60}, {0x0,0x0,0x1adb0,0x35b60} },
-	{ SPOOLSS_FORM_BUILTIN, "PRC Envelope #6 Rotated",        {0x38270,0x1d4c0}, {0x0,0x0,0x38270,0x1d4c0} },
-	{ SPOOLSS_FORM_BUILTIN, "PRC Envelope #6",                {0x1d4c0,0x38270}, {0x0,0x0,0x1d4c0,0x38270} },
-	{ SPOOLSS_FORM_BUILTIN, "PRC Envelope #7 Rotated",        {0x38270,0x27100}, {0x0,0x0,0x38270,0x27100} },
-	{ SPOOLSS_FORM_BUILTIN, "PRC Envelope #7",                {0x27100,0x38270}, {0x0,0x0,0x27100,0x38270} },
-	{ SPOOLSS_FORM_BUILTIN, "PRC Envelope #8 Rotated",        {0x4b708,0x1d4c0}, {0x0,0x0,0x4b708,0x1d4c0} },
-	{ SPOOLSS_FORM_BUILTIN, "PRC Envelope #8",                {0x1d4c0,0x4b708}, {0x0,0x0,0x1d4c0,0x4b708} },
-	{ SPOOLSS_FORM_BUILTIN, "PRC Envelope #9 Rotated",        {0x4f1a0,0x37e88}, {0x0,0x0,0x4f1a0,0x37e88} },
-	{ SPOOLSS_FORM_BUILTIN, "PRC Envelope #9",                {0x37e88,0x4f1a0}, {0x0,0x0,0x37e88,0x4f1a0} },
-	{ SPOOLSS_FORM_BUILTIN, "Quarto",                         {0x347d8,0x43238}, {0x0,0x0,0x347d8,0x43238} },
-	{ SPOOLSS_FORM_BUILTIN, "Reserved48",                     {0x1,0x1},         {0x0,0x0,0x1,0x1} },
-	{ SPOOLSS_FORM_BUILTIN, "Reserved49",                     {0x1,0x1},         {0x0,0x0,0x1,0x1} },
-	{ SPOOLSS_FORM_BUILTIN, "Statement",                      {0x221b4,0x34b5c}, {0x0,0x0,0x221b4,0x34b5c} },
-	{ SPOOLSS_FORM_BUILTIN, "Super A",                        {0x376b8,0x56ea0}, {0x0,0x0,0x376b8,0x56ea0} },
-	{ SPOOLSS_FORM_BUILTIN, "Super B",                        {0x4a768,0x76e58}, {0x0,0x0,0x4a768,0x76e58} },
-	{ SPOOLSS_FORM_BUILTIN, "Tabloid Extra",                  {0x4a6a0,0x6f9f0}, {0x0,0x0,0x4a6a0,0x6f9f0} },
-	{ SPOOLSS_FORM_BUILTIN, "Tabloid",                        {0x44368,0x696b8}, {0x0,0x0,0x44368,0x696b8} },
-	{ SPOOLSS_FORM_BUILTIN, "US Std Fanfold",                 {0x5c3e1,0x44368}, {0x0,0x0,0x5c3e1,0x44368} }
+        { SPOOLSS_FORM_BUILTIN, "Letter",                         {0x34b5c,0x44368}, {0x0,0x0,0x34b5c,0x44368} },
+        { SPOOLSS_FORM_BUILTIN, "Letter Small",                   {0x34b5c,0x44368}, {0x0,0x0,0x34b5c,0x44368} },
+        { SPOOLSS_FORM_BUILTIN, "Tabloid",                        {0x44368,0x696b8}, {0x0,0x0,0x44368,0x696b8} },
+        { SPOOLSS_FORM_BUILTIN, "Ledger",                         {0x696b8,0x44368}, {0x0,0x0,0x696b8,0x44368} },
+        { SPOOLSS_FORM_BUILTIN, "Legal",                          {0x34b5c,0x56d10}, {0x0,0x0,0x34b5c,0x56d10} },
+        { SPOOLSS_FORM_BUILTIN, "Statement",                      {0x221b4,0x34b5c}, {0x0,0x0,0x221b4,0x34b5c} },
+        { SPOOLSS_FORM_BUILTIN, "Executive",                      {0x2cf56,0x411cc}, {0x0,0x0,0x2cf56,0x411cc} },
+        { SPOOLSS_FORM_BUILTIN, "A3",                             {0x48828,0x668a0}, {0x0,0x0,0x48828,0x668a0} },
+        { SPOOLSS_FORM_BUILTIN, "A4",                             {0x33450,0x48828}, {0x0,0x0,0x33450,0x48828} },
+        { SPOOLSS_FORM_BUILTIN, "A4 Small",                       {0x33450,0x48828}, {0x0,0x0,0x33450,0x48828} },
+        { SPOOLSS_FORM_BUILTIN, "A5",                             {0x24220,0x33450}, {0x0,0x0,0x24220,0x33450} },
+        { SPOOLSS_FORM_BUILTIN, "B4 (JIS)",                       {0x3ebe8,0x58de0}, {0x0,0x0,0x3ebe8,0x58de0} },
+        { SPOOLSS_FORM_BUILTIN, "B5 (JIS)",                       {0x2c6f0,0x3ebe8}, {0x0,0x0,0x2c6f0,0x3ebe8} },
+        { SPOOLSS_FORM_BUILTIN, "Folio",                          {0x34b5c,0x509d8}, {0x0,0x0,0x34b5c,0x509d8} },
+        { SPOOLSS_FORM_BUILTIN, "Quarto",                         {0x347d8,0x43238}, {0x0,0x0,0x347d8,0x43238} },
+        { SPOOLSS_FORM_BUILTIN, "10x14",                          {0x3e030,0x56d10}, {0x0,0x0,0x3e030,0x56d10} },
+        { SPOOLSS_FORM_BUILTIN, "11x17",                          {0x44368,0x696b8}, {0x0,0x0,0x44368,0x696b8} },
+        { SPOOLSS_FORM_BUILTIN, "Note",                           {0x34b5c,0x44368}, {0x0,0x0,0x34b5c,0x44368} },
+        { SPOOLSS_FORM_BUILTIN, "Envelope #9",                    {0x18079,0x37091}, {0x0,0x0,0x18079,0x37091} },
+        { SPOOLSS_FORM_BUILTIN, "Envelope #10",                   {0x19947,0x3ae94}, {0x0,0x0,0x19947,0x3ae94} },
+        { SPOOLSS_FORM_BUILTIN, "Envelope #11",                   {0x1be7c,0x40565}, {0x0,0x0,0x1be7c,0x40565} },
+        { SPOOLSS_FORM_BUILTIN, "Envelope #12",                   {0x1d74a,0x44368}, {0x0,0x0,0x1d74a,0x44368} },
+        { SPOOLSS_FORM_BUILTIN, "Envelope #14",                   {0x1f018,0x47504}, {0x0,0x0,0x1f018,0x47504} },
+        { SPOOLSS_FORM_BUILTIN, "C size sheet",                   {0x696b8,0x886d0}, {0x0,0x0,0x696b8,0x886d0} },
+        { SPOOLSS_FORM_BUILTIN, "D size sheet",                   {0x886d0,0xd2d70}, {0x0,0x0,0x886d0,0xd2d70} },
+        { SPOOLSS_FORM_BUILTIN, "E size sheet",                   {0xd2d70,0x110da0},{0x0,0x0,0xd2d70,0x110da0} },
+        { SPOOLSS_FORM_BUILTIN, "Envelope DL",                    {0x1adb0,0x35b60}, {0x0,0x0,0x1adb0,0x35b60} },
+        { SPOOLSS_FORM_BUILTIN, "Envelope C5",                    {0x278d0,0x37e88}, {0x0,0x0,0x278d0,0x37e88} },
+        { SPOOLSS_FORM_BUILTIN, "Envelope C3",                    {0x4f1a0,0x6fd10}, {0x0,0x0,0x4f1a0,0x6fd10} },
+        { SPOOLSS_FORM_BUILTIN, "Envelope C4",                    {0x37e88,0x4f1a0}, {0x0,0x0,0x37e88,0x4f1a0} },
+        { SPOOLSS_FORM_BUILTIN, "Envelope C6",                    {0x1bd50,0x278d0}, {0x0,0x0,0x1bd50,0x278d0} },
+        { SPOOLSS_FORM_BUILTIN, "Envelope C65",                   {0x1bd50,0x37e88}, {0x0,0x0,0x1bd50,0x37e88} },
+        { SPOOLSS_FORM_BUILTIN, "Envelope B4",                    {0x3d090,0x562e8}, {0x0,0x0,0x3d090,0x562e8} },
+        { SPOOLSS_FORM_BUILTIN, "Envelope B5",                    {0x2af80,0x3d090}, {0x0,0x0,0x2af80,0x3d090} },
+        { SPOOLSS_FORM_BUILTIN, "Envelope B6",                    {0x2af80,0x1e848}, {0x0,0x0,0x2af80,0x1e848} },
+        { SPOOLSS_FORM_BUILTIN, "Envelope",                       {0x1adb0,0x38270}, {0x0,0x0,0x1adb0,0x38270} },
+        { SPOOLSS_FORM_BUILTIN, "Envelope Monarch",               {0x18079,0x2e824}, {0x0,0x0,0x18079,0x2e824} },
+        { SPOOLSS_FORM_BUILTIN, "6 3/4 Envelope",                 {0x167ab,0x284ec}, {0x0,0x0,0x167ab,0x284ec} },
+        { SPOOLSS_FORM_BUILTIN, "US Std Fanfold",                 {0x5c3e1,0x44368}, {0x0,0x0,0x5c3e1,0x44368} },
+        { SPOOLSS_FORM_BUILTIN, "German Std Fanfold",             {0x34b5c,0x4a6a0}, {0x0,0x0,0x34b5c,0x4a6a0} },
+        { SPOOLSS_FORM_BUILTIN, "German Legal Fanfold",           {0x34b5c,0x509d8}, {0x0,0x0,0x34b5c,0x509d8} },
+        { SPOOLSS_FORM_BUILTIN, "B4 (ISO)",                       {0x3d090,0x562e8}, {0x0,0x0,0x3d090,0x562e8} },
+        { SPOOLSS_FORM_BUILTIN, "Japanese Postcard",              {0x186a0,0x24220}, {0x0,0x0,0x186a0,0x24220} },
+        { SPOOLSS_FORM_BUILTIN, "9x11",                           {0x37cf8,0x44368}, {0x0,0x0,0x37cf8,0x44368} },
+        { SPOOLSS_FORM_BUILTIN, "10x11",                          {0x3e030,0x44368}, {0x0,0x0,0x3e030,0x44368} },
+        { SPOOLSS_FORM_BUILTIN, "15x11",                          {0x5d048,0x44368}, {0x0,0x0,0x5d048,0x44368} },
+        { SPOOLSS_FORM_BUILTIN, "Envelope Invite",                {0x35b60,0x35b60}, {0x0,0x0,0x35b60,0x35b60} },
+        { SPOOLSS_FORM_BUILTIN, "Reserved48",                     {0x1,0x1},         {0x0,0x0,0x1,0x1} },
+        { SPOOLSS_FORM_BUILTIN, "Reserved49",                     {0x1,0x1},         {0x0,0x0,0x1,0x1} },
+        { SPOOLSS_FORM_BUILTIN, "Letter Extra",                   {0x3ae94,0x4a6a0}, {0x0,0x0,0x3ae94,0x4a6a0} },
+        { SPOOLSS_FORM_BUILTIN, "Legal Extra",                    {0x3ae94,0x5d048}, {0x0,0x0,0x3ae94,0x5d048} },
+        { SPOOLSS_FORM_BUILTIN, "Tabloid Extra",                  {0x4a6a0,0x6f9f0}, {0x0,0x0,0x4a6a0,0x6f9f0} },
+        { SPOOLSS_FORM_BUILTIN, "A4 Extra",                       {0x397c2,0x4eb16}, {0x0,0x0,0x397c2,0x4eb16} },
+        { SPOOLSS_FORM_BUILTIN, "Letter Transverse",              {0x34b5c,0x44368}, {0x0,0x0,0x34b5c,0x44368} },
+        { SPOOLSS_FORM_BUILTIN, "A4 Transverse",                  {0x33450,0x48828}, {0x0,0x0,0x33450,0x48828} },
+        { SPOOLSS_FORM_BUILTIN, "Letter Extra Transverse",        {0x3ae94,0x4a6a0}, {0x0,0x0,0x3ae94,0x4a6a0} },
+        { SPOOLSS_FORM_BUILTIN, "Super A",                        {0x376b8,0x56ea0}, {0x0,0x0,0x376b8,0x56ea0} },
+        { SPOOLSS_FORM_BUILTIN, "Super B",                        {0x4a768,0x76e58}, {0x0,0x0,0x4a768,0x76e58} },
+        { SPOOLSS_FORM_BUILTIN, "Letter Plus",                    {0x34b5c,0x4eb16}, {0x0,0x0,0x34b5c,0x4eb16} },
+        { SPOOLSS_FORM_BUILTIN, "A4 Plus",                        {0x33450,0x50910}, {0x0,0x0,0x33450,0x50910} },
+        { SPOOLSS_FORM_BUILTIN, "A5 Transverse",                  {0x24220,0x33450}, {0x0,0x0,0x24220,0x33450} },
+        { SPOOLSS_FORM_BUILTIN, "B5 (JIS) Transverse",            {0x2c6f0,0x3ebe8}, {0x0,0x0,0x2c6f0,0x3ebe8} },
+        { SPOOLSS_FORM_BUILTIN, "A3 Extra",                       {0x4e9d0,0x6ca48}, {0x0,0x0,0x4e9d0,0x6ca48} },
+        { SPOOLSS_FORM_BUILTIN, "A5 Extra",                       {0x2a7b0,0x395f8}, {0x0,0x0,0x2a7b0,0x395f8} },
+        { SPOOLSS_FORM_BUILTIN, "B5 (ISO) Extra",                 {0x31128,0x43620}, {0x0,0x0,0x31128,0x43620} },
+        { SPOOLSS_FORM_BUILTIN, "A2",                             {0x668a0,0x91050}, {0x0,0x0,0x668a0,0x91050} },
+        { SPOOLSS_FORM_BUILTIN, "A3 Transverse",                  {0x48828,0x668a0}, {0x0,0x0,0x48828,0x668a0} },
+        { SPOOLSS_FORM_BUILTIN, "A3 Extra Transverse",            {0x4e9d0,0x6ca48}, {0x0,0x0,0x4e9d0,0x6ca48} },
+        { SPOOLSS_FORM_BUILTIN, "Japanese Double Postcard",       {0x30d40,0x24220}, {0x0,0x0,0x30d40,0x24220} },
+        { SPOOLSS_FORM_BUILTIN, "A6",                             {0x19a28,0x24220}, {0x0,0x0,0x19a28,0x24220} },
+        { SPOOLSS_FORM_BUILTIN, "Japan Envelope Kaku #2 Rotated", {0x510e0,0x3a980}, {0x0,0x0,0x510e0,0x3a980} },
+        { SPOOLSS_FORM_BUILTIN, "Japan Envelope Kaku #3 Rotated", {0x43a08,0x34bc0}, {0x0,0x0,0x43a08,0x34bc0} },
+        { SPOOLSS_FORM_BUILTIN, "Japan Envelope Chou #3 Rotated", {0x395f8,0x1d4c0}, {0x0,0x0,0x395f8,0x1d4c0} },
+        { SPOOLSS_FORM_BUILTIN, "Japan Envelope Chou #4 Rotated", {0x320c8,0x15f90}, {0x0,0x0,0x320c8,0x15f90} },
+        { SPOOLSS_FORM_BUILTIN, "Letter Rotated",                 {0x44368,0x34b5c}, {0x0,0x0,0x44368,0x34b5c} },
+        { SPOOLSS_FORM_BUILTIN, "A3 Rotated",                     {0x668a0,0x48828}, {0x0,0x0,0x668a0,0x48828} },
+        { SPOOLSS_FORM_BUILTIN, "A4 Rotated",                     {0x48828,0x33450}, {0x0,0x0,0x48828,0x33450} },
+        { SPOOLSS_FORM_BUILTIN, "A5 Rotated",                     {0x33450,0x24220}, {0x0,0x0,0x33450,0x24220} },
+        { SPOOLSS_FORM_BUILTIN, "B4 (JIS) Rotated",               {0x58de0,0x3ebe8}, {0x0,0x0,0x58de0,0x3ebe8} },
+        { SPOOLSS_FORM_BUILTIN, "B5 (JIS) Rotated",               {0x3ebe8,0x2c6f0}, {0x0,0x0,0x3ebe8,0x2c6f0} },
+        { SPOOLSS_FORM_BUILTIN, "Japanese Postcard Rotated",      {0x24220,0x186a0}, {0x0,0x0,0x24220,0x186a0} },
+        { SPOOLSS_FORM_BUILTIN, "Double Japan Postcard Rotated",  {0x24220,0x30d40}, {0x0,0x0,0x24220,0x30d40} },
+        { SPOOLSS_FORM_BUILTIN, "A6 Rotated",                     {0x24220,0x19a28}, {0x0,0x0,0x24220,0x19a28} },
+        { SPOOLSS_FORM_BUILTIN, "Japanese Envelope Kaku #2",      {0x3a980,0x510e0}, {0x0,0x0,0x3a980,0x510e0} },
+        { SPOOLSS_FORM_BUILTIN, "Japanese Envelope Kaku #3",      {0x34bc0,0x43a08}, {0x0,0x0,0x34bc0,0x43a08} },
+        { SPOOLSS_FORM_BUILTIN, "Japanese Envelope Chou #3",      {0x1d4c0,0x395f8}, {0x0,0x0,0x1d4c0,0x395f8} },
+        { SPOOLSS_FORM_BUILTIN, "Japanese Envelope Chou #4",      {0x15f90,0x320c8}, {0x0,0x0,0x15f90,0x320c8} },
+        { SPOOLSS_FORM_BUILTIN, "B6 (JIS)",                       {0x1f400,0x2c6f0}, {0x0,0x0,0x1f400,0x2c6f0} },
+        { SPOOLSS_FORM_BUILTIN, "B6 (JIS) Rotated",               {0x2c6f0,0x1f400}, {0x0,0x0,0x2c6f0,0x1f400} },
+        { SPOOLSS_FORM_BUILTIN, "12x11",                          {0x4a724,0x443e1}, {0x0,0x0,0x4a724,0x443e1} },
+        { SPOOLSS_FORM_BUILTIN, "Japan Envelope You #4",          {0x19a28,0x395f8}, {0x0,0x0,0x19a28,0x395f8} },
+        { SPOOLSS_FORM_BUILTIN, "Japan Envelope You #4 Rotated",  {0x395f8,0x19a28}, {0x0,0x0,0x395f8,0x19a28} },
+        { SPOOLSS_FORM_BUILTIN, "PRC 16K",                        {0x2de60,0x3f7a0}, {0x0,0x0,0x2de60,0x3f7a0} },
+        { SPOOLSS_FORM_BUILTIN, "PRC 32K",                        {0x1fbd0,0x2cec0}, {0x0,0x0,0x1fbd0,0x2cec0} },
+        { SPOOLSS_FORM_BUILTIN, "PRC 32K(Big)",                   {0x222e0,0x318f8}, {0x0,0x0,0x222e0,0x318f8} },
+        { SPOOLSS_FORM_BUILTIN, "PRC Envelope #1",                {0x18e70,0x28488}, {0x0,0x0,0x18e70,0x28488} },
+        { SPOOLSS_FORM_BUILTIN, "PRC Envelope #2",                {0x18e70,0x2af80}, {0x0,0x0,0x18e70,0x2af80} },
+        { SPOOLSS_FORM_BUILTIN, "PRC Envelope #3",                {0x1e848,0x2af80}, {0x0,0x0,0x1e848,0x2af80} },
+        { SPOOLSS_FORM_BUILTIN, "PRC Envelope #4",                {0x1adb0,0x32c80}, {0x0,0x0,0x1adb0,0x32c80} },
+        { SPOOLSS_FORM_BUILTIN, "PRC Envelope #5",                {0x1adb0,0x35b60}, {0x0,0x0,0x1adb0,0x35b60} },
+        { SPOOLSS_FORM_BUILTIN, "PRC Envelope #6",                {0x1d4c0,0x38270}, {0x0,0x0,0x1d4c0,0x38270} },
+        { SPOOLSS_FORM_BUILTIN, "PRC Envelope #7",                {0x27100,0x38270}, {0x0,0x0,0x27100,0x38270} },
+        { SPOOLSS_FORM_BUILTIN, "PRC Envelope #8",                {0x1d4c0,0x4b708}, {0x0,0x0,0x1d4c0,0x4b708} },
+        { SPOOLSS_FORM_BUILTIN, "PRC Envelope #9",                {0x37e88,0x4f1a0}, {0x0,0x0,0x37e88,0x4f1a0} },
+        { SPOOLSS_FORM_BUILTIN, "PRC Envelope #10",               {0x4f1a0,0x6fd10}, {0x0,0x0,0x4f1a0,0x6fd10} },
+        { SPOOLSS_FORM_BUILTIN, "PRC 16K Rotated",                {0x3f7a0,0x2de60}, {0x0,0x0,0x3f7a0,0x2de60} },
+        { SPOOLSS_FORM_BUILTIN, "PRC 32K Rotated",                {0x2cec0,0x1fbd0}, {0x0,0x0,0x2cec0,0x1fbd0} },
+        { SPOOLSS_FORM_BUILTIN, "PRC 32K(Big) Rotated",           {0x318f8,0x222e0}, {0x0,0x0,0x318f8,0x222e0} },
+        { SPOOLSS_FORM_BUILTIN, "PRC Envelope #1 Rotated",        {0x28488,0x18e70}, {0x0,0x0,0x28488,0x18e70} },
+        { SPOOLSS_FORM_BUILTIN, "PRC Envelope #2 Rotated",        {0x2af80,0x18e70}, {0x0,0x0,0x2af80,0x18e70} },
+        { SPOOLSS_FORM_BUILTIN, "PRC Envelope #3 Rotated",        {0x2af80,0x1e848}, {0x0,0x0,0x2af80,0x1e848} },
+        { SPOOLSS_FORM_BUILTIN, "PRC Envelope #4 Rotated",        {0x32c80,0x1adb0}, {0x0,0x0,0x32c80,0x1adb0} },
+        { SPOOLSS_FORM_BUILTIN, "PRC Envelope #5 Rotated",        {0x35b60,0x1adb0}, {0x0,0x0,0x35b60,0x1adb0} },
+        { SPOOLSS_FORM_BUILTIN, "PRC Envelope #6 Rotated",        {0x38270,0x1d4c0}, {0x0,0x0,0x38270,0x1d4c0} },
+        { SPOOLSS_FORM_BUILTIN, "PRC Envelope #7 Rotated",        {0x38270,0x27100}, {0x0,0x0,0x38270,0x27100} },
+        { SPOOLSS_FORM_BUILTIN, "PRC Envelope #8 Rotated",        {0x4b708,0x1d4c0}, {0x0,0x0,0x4b708,0x1d4c0} },
+        { SPOOLSS_FORM_BUILTIN, "PRC Envelope #9 Rotated",        {0x4f1a0,0x37e88}, {0x0,0x0,0x4f1a0,0x37e88} },
+        { SPOOLSS_FORM_BUILTIN, "PRC Envelope #10 Rotated",       {0x6fd10,0x4f1a0}, {0x0,0x0,0x6fd10,0x4f1a0} }
 };
 
 /********************************************************************
diff --git a/source3/smbd/durable.c b/source3/smbd/durable.c
index 5953e1b..42ad18e 100644
--- a/source3/smbd/durable.c
+++ b/source3/smbd/durable.c
@@ -234,7 +234,7 @@ NTSTATUS vfs_default_durable_reconnect(struct connection_struct *conn,
 	NTSTATUS status;
 	bool ok;
 	int ret;
-	int flags;
+	int flags = 0;
 	struct file_id file_id;
 	struct smb_filename *smb_fname = NULL;
 	enum ndr_err_code ndr_err;
diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h
index 566f04d..89ad109 100644
--- a/source3/smbd/globals.h
+++ b/source3/smbd/globals.h
@@ -465,7 +465,6 @@ struct smbd_smb2_request {
 	bool do_signing;
 	bool do_encryption;
 	struct tevent_timer *async_te;
-	bool cancelled;
 	bool compound_related;
 
 	/*
@@ -485,8 +484,6 @@ struct smbd_smb2_request {
 	struct smb_request *smb1req;
 	struct files_struct *compat_chain_fsp;
 
-	NTSTATUS next_status;
-
 	/*
 	 * The sub request for async backend calls.
 	 * This is used for SMB2 Cancel.
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index c23168c..a9a9198 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -1712,6 +1712,13 @@ static NTSTATUS smbd_calculate_maximum_allowed_access(
 		return NT_STATUS_ACCESS_DENIED;
 	}
 	*p_access_mask = (access_granted | FILE_READ_ATTRIBUTES);
+
+	if (!(access_granted & DELETE_ACCESS)) {
+		if (can_delete_file_in_directory(conn, smb_fname)) {
+			*p_access_mask |= DELETE_ACCESS;
+		}
+	}
+
 	return NT_STATUS_OK;
 }
 
@@ -2777,7 +2784,7 @@ static NTSTATUS mkdir_internal(connection_struct *conn,
 	bool need_re_stat = false;
 	uint32_t access_mask = SEC_DIR_ADD_SUBDIR;
 
-	if(access_mask & ~(conn->share_access)) {
+	if (!CAN_WRITE(conn) || (access_mask & ~(conn->share_access))) {
 		DEBUG(5,("mkdir_internal: failing share access "
 			 "%s\n", lp_servicename(talloc_tos(), SNUM(conn))));
 		return NT_STATUS_ACCESS_DENIED;
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index d53b19a..90bbb62 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -752,6 +752,15 @@ static bool open_sockets_smbd(struct smbd_parent_context *parent,
 		ports = (const char **)str_list_make_v3(talloc_tos(), smb_ports, NULL);
 	}
 
+	for (j = 0; ports && ports[j]; j++) {
+		unsigned port = atoi(ports[j]);
+
+		if (port == 0 || port > 0xffff) {
+			exit_server_cleanly("Invalid port in the config or on "
+					    "the commandline specified!");
+		}
+	}
+
 	if (lp_interfaces() && lp_bind_interfaces_only()) {
 		/* We have been given an interfaces line, and been
 		   told to only bind to those interfaces. Create a
@@ -772,9 +781,6 @@ static bool open_sockets_smbd(struct smbd_parent_context *parent,
 
 			for (j = 0; ports && ports[j]; j++) {
 				unsigned port = atoi(ports[j]);
-				if (port == 0 || port > 0xffff) {
-					continue;
-				}
 
 				/* Keep the first port for mDNS service
 				 * registration.
@@ -810,11 +816,7 @@ static bool open_sockets_smbd(struct smbd_parent_context *parent,
 		     next_token_talloc(talloc_tos(), &sock_ptr, &sock_tok, " \t,"); ) {
 			for (j = 0; ports && ports[j]; j++) {
 				struct sockaddr_storage ss;
-
 				unsigned port = atoi(ports[j]);
-				if (port == 0 || port > 0xffff) {
-					continue;
-				}
 
 				/* Keep the first port for mDNS service
 				 * registration.
@@ -1529,7 +1531,10 @@ extern void build_options(bool screen);
 
 	/* do a printer update now that all messaging has been set up,
 	 * before we allow clients to start connecting */
-	printing_subsystem_update(ev_ctx, msg_ctx, false);
+	if (!lp__disable_spoolss() &&
+	    (rpc_spoolss_daemon() != RPC_DAEMON_DISABLED)) {


-- 
Samba Shared Repository


More information about the samba-cvs mailing list