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

Karolin Seeger kseeger at samba.org
Wed Jan 6 12:15:03 UTC 2016


The branch, v4-3-test has been updated
       via  234861b password_lockout: test creds.get_kerberos_state()
       via  7870c0c auth: keep track of lastLogon and lastLogonTimestamp
       via  5e60671 password_lockout tests: add assertLoginFailure()
       via  fe51036 auth: increase resolution for password grace period calculation
       via  ca7cd60 pycredentials: add get_kerberos_state() method
       via  7c50b7a smbd: do not disable "store dos attributes" on-the-fly
       via  6be8237 s3:smbd: fix a corner case of the symlink verification
       via  1ae26f8 s3: libsmb: Correctly initialize the list head when keeping a list of primary followed by DFS connections.
       via  9d43c74 vfs_streams_xattr: fix and simplify streams_xattr_get_name()
       via  deec633 vfs_fruit: hide the Netatalk metadata xattr in streaminfo
       via  535812d vfs_fruit: add and use define for the Netatalk metadata xattr
       via  48bce69 s4:torture:vfs_fruit: add test test_read_afpinfo
       via  dad33c3 s4:torture:vfs_fruit: add tests for AFP_Resource delete-on-close and eof
       via  4c00711 vfs_fruit: ignore delete on the AFP_Resource stream
       via  093575e s4:torture:vfs_fruit: update AFP_AfpInfo IO tests
       via  de829e6 vfs_fruit: fix offset and len handling for AFP_AfpInfo stream
       via  f8bc71f s4:torture:vfs_fruit: test nulling out AFP_AfpInfo stream
       via  89f4adb vfs_fruit: writing all 0 to AFP_AfpInfo stream
       via  3a31406 s4:torture:vfs_fruit: add tests for AFP_AfpInfo delete-on-close and eof
       via  f85e4e6 vfs_fruit: handling of ftruncate() on AFP_AfpInfo stream
       via  a52778b s4:torture:vfs_fruit: file without AFP_AfpInfo
       via  a0d3a3a vfs_fruit: stat AFP_AfpInfo must fail when it doesn't exist
       via  2482f7a vfs_fruit: fix some debug messages
       via  e150a70 s3:lib/errmap_unix: map EOVERFLOW to NT_STATUS_ALLOTTED_SPACE_EXCEEDED
       via  a9d4091 s4:torture:vfs_fruit: fix flakey test_write_atalk_rfork_io with OS X
       via  ba97d85 s4:torture:vfs_fruit: fix test_rename_dir_openfile() to work with OS X
       via  adbe3fd s4:torture:vfs_fruit: fix test_aapl() to work with OS X
       via  7ed3a98 s4:torture:vfs_fruit: skip test_stream_names() without "localdir"
       via  33851cb s4:torture:vfs_fruit: skip test_adouble_conversion() without "localdir"
       via  2d9ddc1 s4:torture:vfs_fruit: skip test test_read_atalk_metadata() without "localdir" and rename it
       via  8acd795 s4:torture:vfs_fruit: add explicit cleanup of testfiles
       via  9aefc7d s4:torture:vfs_fruit: add --option=torture:osx for enable_aapl()
       via  86b653b s4:torture:vfs_fruit: enhance check_stream
       via  eb5df33 s4:torture:vfs_fruit: use AFPINFO_STREAM_NAME
       via  7fb8371 s4:torture:vfs_fruit: tweak check_stream_list()
       via  a985c92 s4:torture:vfs_fruit: rename tree1 -> tree
       via  9215fc8 s4:torture:vfs_fruit: remove unused tree2
      from  a1774eb docs: Fix typos in man vfs_gpfs.

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-3-test


- Log -----------------------------------------------------------------
commit 234861b0bfac63ea463bfc5c872eb73ee8115f5c
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Tue Dec 1 13:48:59 2015 +1300

    password_lockout: test creds.get_kerberos_state()
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Garming Sam <garming at catalyst.net.nz>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    Autobuild-User(master): Garming Sam <garming at samba.org>
    Autobuild-Date(master): Tue Dec 15 03:17:52 CET 2015 on sn-devel-104
    
    (cherry picked from commit ab1ebb1d1c650396841e4ba4a18b3c08689d4f52)
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11659
    lastLogon and lastLogonTimestamp are not updated
    
    Autobuild-User(v4-3-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-3-test): Wed Jan  6 13:14:21 CET 2016 on sn-devel-104

commit 7870c0ca4c6a8010ea85fe4ad001746840b6a88d
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Fri Oct 23 16:57:56 2015 +1300

    auth: keep track of lastLogon and lastLogonTimestamp
    
    lastLogon is supposed to be updated for every interactive or kerberos
    login, and (according to testing against Windows2012r2) when the bad
    password count is non-zero but the lockout time is zero. It is not
    replicated.
    
    lastLogonTimestamp is updated if the old value is more than 14 -
    random.choice([0, 1, 2, 3, 4, 5]) days old, and it is replicated. The
    14 in this calculation is the default, stored as
    "msDS-LogonTimeSyncInterval", which we offer no interface for
    changing.
    
    The authsam_zero_bad_pwd_count() function is a convenient place to
    update these values, as it is called upon a successful logon however
    that logon is performed. That makes the function's name inaccurate, so
    we rename it authsam_logon_success_accounting(). It also needs to be
    told whet5her the login is interactive.
    
    The password_lockout tests are extended to test lastLogon and
    lasLogonTimestamp.
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Garming Sam <garming at catalyst.net.nz>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    (cherry picked from commit 795f4729ca94029fcee750fbebbe9bc3ea43a214)
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11659
    lastLogon and lastLogonTimestamp are not updated

commit 5e60671e10d8aadbe4477cb47ab5a4ab4a643304
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Thu Oct 22 16:54:19 2015 +1300

    password_lockout tests: add assertLoginFailure()
    
    In a few places where a login should fail in a particular way, an
    actual login success would not have triggered a test failure -- only
    the wrong kind of login failure was caught.
    
    This makes a helper function to deal with them all.
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Garming Sam <garming at catalyst.net.nz>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    (cherry picked from commit 909ebe0191a409c107904df658dc9111dd5de669)
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11659
    lastLogon and lastLogonTimestamp are not updated

commit fe5103643052ffb563f6865664b7bc5f8c8465e6
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Thu Oct 22 09:45:26 2015 +1300

    auth: increase resolution for password grace period calculation
    
    This changes the resolution of "now" from 1s to 100ns.
    
    It should have little effect in practice, unless users are in the
    habit of playing chicken with the grace period.
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Garming Sam <garming at catalyst.net.nz>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    (cherry picked from commit d097e813fff3aaed261a18d8066e6bd11f12abad)
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11659
    lastLogon and lastLogonTimestamp are not updated

commit ca7cd608ebdc9dfd557181a8c34f4756702feb50
Author: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
Date:   Tue Dec 1 13:17:18 2015 +1300

    pycredentials: add get_kerberos_state() method
    
    Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
    Reviewed-by: Garming Sam <garming at catalyst.net.nz>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    (cherry picked from commit 8b26559aeb6d1c2c12e2ea374c30e4082ece7ec3)
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11659
    lastLogon and lastLogonTimestamp are not updated

commit 7c50b7a54bb3061cb9541cfd84711f92058ffc5a
Author: Uri Simchoni <uri at samba.org>
Date:   Thu Dec 24 08:10:11 2015 +0200

    smbd: do not disable "store dos attributes" on-the-fly
    
    Smbd would disable "store dos attributes" on-the-fly if the
    attempt to set/get user.DOSATTRIB fails with ENOTSUP or ENOSYS.
    The rationale behind it was that the file system does not support
    extended attributes, so there's no need to fill up the log with
    failure messages.
    
    However, a "wide symlink" could point to a spot that doesn't support
    extended attributes. Even with the default banned wide links, we
    currenly allow stat'ing those files and follow the symlink, and this
    in turn would disable "store dos attributes" for the whole share.
    The user.DOSATTRIB attribute also stores file creation time,
    so that is also affected.
    
    Another case where this behavior would turn storage of DOS attributes
    off is that of the ".." entry at the root of the share, if the parent
    folder for the share's root path does not support extended attributes.
    
    On the other hand, the information on the file system and its support
    of extended attributes is readily available, so the fix for explosion
    of the log should be not to configure "store dos attributes" on
    such a share.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11649
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    
    Autobuild-User(master): Volker Lendecke <vl at samba.org>
    Autobuild-Date(master): Fri Dec 25 13:20:58 CET 2015 on sn-devel-144
    
    (cherry picked from commit d4c2395e6428312854b8570064bddab3a7f188ff)

commit 6be823764870a7f65d4023216e3391b6d47bf40e
Author: Michael Adam <obnox at samba.org>
Date:   Wed Dec 23 18:01:23 2015 +0100

    s3:smbd: fix a corner case of the symlink verification
    
    Commit 7606c0db257b3f9d84da5b2bf5fbb4034cc8d77d fixes the
    path checks in check_reduced_name[_with_privilege]() to
    prevent unintended access via wide links.
    
    The fix fails to correctly treat a corner case where the share
    path is "/". This case is important for some real world
    scenarios, notably the use of the glusterfs VFS module:
    
    For the share path "/", the newly introduced checks deny all
    operations in the share.
    
    This change fixes the checks for the corner case.
    The point is that the assumptions on which the original
    checks are based are not true for the rootdir "/" case.
    This is the case where the rootdir starts _and ends_ with
    a slash. Hence a subdirectory does not continue with a
    slash after the rootdir, since the candidate path has
    been normalized.
    
    This fix just omits the string comparison and the
    next character checks in the case of rootdir "/",
    which is correct because we know that the candidate
    path is normalized and hence starts with a '/'.
    
    The patch is fairly minimal, but changes indentation,
    hence best viewed with 'git show -w'.
    
    A side effect is that the rootdir="/" case needs
    one strncmp less.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11647
    
    Pair-Programmed-With: Jose A. Rivera <jarrpa at samba.org>
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    Signed-off-by: Jose A. Rivera <jarrpa at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Michael Adam <obnox at samba.org>
    Autobuild-Date(master): Thu Dec 24 00:57:31 CET 2015 on sn-devel-144
    
    (cherry picked from commit ada59ec7b3a5ed0478d11da2fe0c90991d137288)

commit 1ae26f884dac23aa37a069b8c801efab5c35b5df
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Dec 16 11:04:20 2015 -0800

    s3: libsmb: Correctly initialize the list head when keeping a list of primary followed by DFS connections.
    
    Greatly helped by <shargagan at novell.com> to
    track down this issue.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11624
    
    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): Fri Dec 18 01:02:55 CET 2015 on sn-devel-144
    
    (cherry picked from commit d7feb1879ee711598540049c2c5eccc80fd6f1e5)

commit 9d43c74e24646147589c44c46542de325859b6dc
Author: Ralph Boehme <slow at samba.org>
Date:   Mon Aug 24 17:45:14 2015 +0200

    vfs_streams_xattr: fix and simplify streams_xattr_get_name()
    
    streams_xattr_get_name() fails to chop off the stream type in case
    config->store_stream_type is false and the passed stream name contains a
    stream type.
    
    Eg when the passed in stream name is ":mystream:$DATA", but
    config->store_stream_type is false, we must generate a xattr name of
    "mystream" or "user.mystream".
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11466
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Fri Oct 16 23:27:01 CEST 2015 on sn-devel-104
    
    (cherry picked from commit 2881679e3ecbaf07cdd82ba65af8d55e5e3be800)

commit deec633f5b7176f32a5856a498f04759bc82c60b
Author: Ralph Boehme <slow at samba.org>
Date:   Mon Aug 24 17:43:40 2015 +0200

    vfs_fruit: hide the Netatalk metadata xattr in streaminfo
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11466
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit fedd09662c889fb796135d86836c160171fac68d)

commit 535812dc574634a2d3d15423ee13890e186edf63
Author: Ralph Boehme <slow at samba.org>
Date:   Mon Aug 24 17:42:35 2015 +0200

    vfs_fruit: add and use define for the Netatalk metadata xattr
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11466
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit c8ee1a059b4484575b03ac76b469df85cdabdd9a)

commit 48bce69f8a72b61742b2ce74cbd42a6e25e9c658
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Dec 18 17:14:41 2015 +0100

    s4:torture:vfs_fruit: add test test_read_afpinfo
    
    This works against any SMB server and test basic IO on the AFP_AfpInfo
    stream.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit b165d520374cc2ae77acfd813b528e55acfc2f7e)

commit dad33c32933bec1435dfd81f2328896a388594ba
Author: Ralph Boehme <slow at samba.org>
Date:   Sat Dec 19 18:44:18 2015 +0100

    s4:torture:vfs_fruit: add tests for AFP_Resource delete-on-close and eof
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 21d4b5cea8e4dec729912915d60922edaea0f418)

commit 4c0071126b61b77e3b51258297b913a1c9e7fb85
Author: Ralph Boehme <slow at samba.org>
Date:   Sat Dec 19 18:27:06 2015 +0100

    vfs_fruit: ignore delete on the AFP_Resource stream
    
    OS X ignores deletes on the AFP_Resource stream. This was discovered by
    torture tests against OS X SMB server.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit ee431fc5254dc735662d152dd19a81d439ca5e44)

commit 093575e403f89e1e2b4d72ad6b9e94ace5111a79
Author: Ralph Boehme <slow at samba.org>
Date:   Sat Dec 19 11:10:54 2015 +0100

    s4:torture:vfs_fruit: update AFP_AfpInfo IO tests
    
    When reading from the AFP_AfpInfo stream, OS X ignores the offset from
    the request and always reads from offset=0.
    
    The offset bounds check has a off-by-1 bug in OS X, so a request
    offset=60 (AFP_AfpInfo stream has a ficed size of 60 bytes), len=1
    returns 1 byte from offset 0 insteaf of returning 0.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit decde0b4812eba5f80b717fd2ae868558a022753)

commit de829e60680be236ae06dfba3edfd9fef149036d
Author: Ralph Boehme <slow at samba.org>
Date:   Sat Dec 19 11:06:19 2015 +0100

    vfs_fruit: fix offset and len handling for AFP_AfpInfo stream
    
    When reading from the AFP_AfpInfo stream, OS X ignores the offset from
    the request and always reads from offset=0.
    
    The offset bounds check has a off-by-1 bug in OS X, so a request
    offset=60 (AFP_AfpInfo stream has a ficed size of 60 bytes), len=1
    returns 1 byte from offset 0 insteaf of returning 0.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit f569fd5e44300ab41aa7298b3efdcac99cd330f2)

commit f8bc71f657238616a353907f13a8e80bd5084c2e
Author: Ralph Boehme <slow at samba.org>
Date:   Sun Dec 20 19:55:06 2015 +0100

    s4:torture:vfs_fruit: test nulling out AFP_AfpInfo stream
    
    This must delete the stream.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 666a55b7060542ef78ff5f22d368f2ebc4c3318f)

commit 89f4adb298472b0dbca467d3df6039467def5a21
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Dec 17 20:08:35 2015 +0100

    vfs_fruit: writing all 0 to AFP_AfpInfo stream
    
    When writing all 0 to AFP_AfpInfo stream we can remove the underlying
    storage object. This beaviour of OS X SMB server was found with a
    torture test.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit e94b17715ea8049df8819b472178170b8e987946)

commit 3a31406c3502b749bc28877ac8e9fc77dea796a7
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Dec 17 19:47:18 2015 +0100

    s4:torture:vfs_fruit: add tests for AFP_AfpInfo delete-on-close and eof
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit e5588b463ee77aac3b396774e68c10b13a9f6f04)

commit f85e4e6402bfe31bea610c8accd503b2bf65e4d9
Author: Ralph Boehme <slow at samba.org>
Date:   Mon Dec 14 16:09:54 2015 +0100

    vfs_fruit: handling of ftruncate() on AFP_AfpInfo stream
    
    With help of some torture tests I verified the following behaviour of OS
    X SMB server:
    
    * ftruncate AFP_AfpInfo stream > 60 bytes results in an error
      NT_STATUS_ALLOTTED_SPACE_EXCEEDED
    
    * ftruncate AFP_AfpInfo stream <=60 returns success but has no effect
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 4024153894a07b7b1115dbe1699cba94fee13f23)

commit a52778ba42a4c2392c15ba0cefe380c701d78cb0
Author: Ralph Boehme <slow at samba.org>
Date:   Sun Dec 20 18:42:23 2015 +0100

    s4:torture:vfs_fruit: file without AFP_AfpInfo
    
    Opening the AFP_AfpInfo on a file that doesn't have that stream must
    return ENOENT.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 6f8c188dfc81a6d22bd54f248327b787e0b48f09)

commit a0d3a3abd43ea5780777cc6bdfa5367529bd766b
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Dec 17 20:05:04 2015 +0100

    vfs_fruit: stat AFP_AfpInfo must fail when it doesn't exist
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 0af7bf4249419ff7c88c5beece915db0a3697b72)

commit 2482f7af4d07211bb09e86b20eb7731d60d99033
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Dec 11 17:27:50 2015 +0100

    vfs_fruit: fix some debug messages
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 748adea77f95d7d6114f96b7850f384b77d6f7d2)

commit e150a702fe5261fce2731c24966e64241960ba0a
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Dec 17 19:16:43 2015 +0100

    s3:lib/errmap_unix: map EOVERFLOW to NT_STATUS_ALLOTTED_SPACE_EXCEEDED
    
    vfs_fruit returns the correct error NT_STATUS_ALLOTTED_SPACE_EXCEEDED
    when an attempt is made to extend the AFP_AfpInfo stream beyond 60
    bytes.
    
    This will be used in a subsequent commit in vfs_fruit.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 1650e793edb42b07501d7467aa64c80eacf33eb6)

commit a9d4091c89c2b8d65c0e61154b32d430fb907ca8
Author: Ralph Boehme <slow at samba.org>
Date:   Sat Dec 19 18:56:24 2015 +0100

    s4:torture:vfs_fruit: fix flakey test_write_atalk_rfork_io with OS X
    
    Adjust desired_access to prevent flaky test with OS X SMB server.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit ba00884e8a67420cf8d6c2530a778b9cee6e86b8)

commit ba97d852e30621bf4ad8e1c251c69f76cad66407
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Dec 18 17:25:07 2015 +0100

    s4:torture:vfs_fruit: fix test_rename_dir_openfile() to work with OS X
    
    OS X allows renaming of directories with open files regardless of AAPL
    negotiation. Samba will only allow this after negotiating AAPL.
    
    The first check in this test is that renaming fails without AAPL, so
    skip this test if the server is OS X.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 363260983f7ec85ecd3a2b35e6b07eeb5416bdc5)

commit adbe3fd01e8bd412c8f7aa628b966bf95f69860c
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Dec 18 17:23:40 2015 +0100

    s4:torture:vfs_fruit: fix test_aapl() to work with OS X
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 0fc2ed8f01f2e510ee58ad2ea9209d2fec10fd3f)

commit 7ed3a9855dc86eb052a78a2b3849213b74864542
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Dec 18 17:24:12 2015 +0100

    s4:torture:vfs_fruit: skip test_stream_names() without "localdir"
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 56bf27667cc8f2fad0cad96d796bdd2f172326a8)

commit 33851cb6b2147fbe81e37659103e34fe57134562
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Dec 18 17:22:32 2015 +0100

    s4:torture:vfs_fruit: skip test_adouble_conversion() without "localdir"
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 987e12b7a7518e498c47dd8dfee32aed148f8cd7)

commit 2d9ddc1a3baa6ccad59789bd79e839b0a90f86c8
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Dec 18 17:10:18 2015 +0100

    s4:torture:vfs_fruit: skip test test_read_atalk_metadata() without "localdir" and rename it
    
    The test is Netatalk specific. Skip the test if "localdir" is not
    specified.
    
    Use torture_assert() to check the result from check_stream().
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 0a9a7c21073227c539fc1ced331e837c1c1f4bc4)

commit 8acd7957a2f53e39a5a39608b30aab17322baab0
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Dec 18 17:18:41 2015 +0100

    s4:torture:vfs_fruit: add explicit cleanup of testfiles
    
    smb2_deltree() doesn't work with OS X (looks like OS X doesn't handle
    FILE_NON_DIRECTORY_FILE correctly). As a workaround, use explicit
    cleanup of all testfiles and directories.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 155397e83173e13baebfc507ad9659d0ed213b5b)

commit 9aefc7d466f919cfc647d660760a5674d86585a0
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Dec 18 17:08:32 2015 +0100

    s4:torture:vfs_fruit: add --option=torture:osx for enable_aapl()
    
    Check if the server is OS X and don't check the AAPL context size if it
    is.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 3c0ac9b3899aa06315e592253c858f31d4bd2ae3)

commit 86b653b19d037b799e0407e4fe25923f72cb7ce3
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Dec 17 19:22:12 2015 +0100

    s4:torture:vfs_fruit: enhance check_stream
    
    Don't sleep when create fails and use torture_ macros.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit fdf937e77da29ec47002855db69d9e3f95005479)

commit eb5df33210d0f0aaff9bf5bda53706d679e892af
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Dec 17 16:51:10 2015 +0100

    s4:torture:vfs_fruit: use AFPINFO_STREAM_NAME
    
    I got erratic results from OS X SMB server with AFPINFO_STREAM
    (":AFP_AfpInfo:$DATA") in some tests. Using AFPINFO_STREAM_NAME
    (just the ":AFP_AfpInfo" part) instead fixed this.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 8694da43442abe3ae6ac3b6a16c524e455ae1a65)

commit 7fb83716ea362f99d9a297cdeea58bb6f6c9e1ba
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Dec 17 13:31:12 2015 +0100

    s4:torture:vfs_fruit: tweak check_stream_list()
    
    Modify check_stream_list() to open the basefile (or directory) itself
    insteaf of having the callers pass in a filehandle. Removes some code
    duplication in the callers.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 8e0cf77ee230c0eaef01a2dc2316fc65aabd5a59)

commit a985c9274cfef1fea676c78adefe19c0ec3fbd7d
Author: Ralph Boehme <slow at samba.org>
Date:   Sun Dec 20 10:18:31 2015 +0100

    s4:torture:vfs_fruit: rename tree1 -> tree
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 1d13744547474592285eacab84d1217af46e0086)

commit 9215fc85541b82c870dfbe38777fbf96757a698f
Author: Ralph Boehme <slow at samba.org>
Date:   Sun Dec 20 10:16:25 2015 +0100

    s4:torture:vfs_fruit: remove unused tree2
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 9d28f82484e8b34c8d8f35f596fdb63614b103d2)

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

Summary of changes:
 auth/credentials/pycredentials.c              |    8 +
 source3/include/proto.h                       |    1 -
 source3/lib/errmap_unix.c                     |    3 +
 source3/libsmb/libsmb_server.c                |    4 +-
 source3/modules/vfs_fruit.c                   |  152 ++-
 source3/modules/vfs_streams_xattr.c           |   39 +-
 source3/param/loadparm.c                      |   11 -
 source3/selftest/tests.py                     |    4 +-
 source3/smbd/dosmode.c                        |   30 +-
 source3/smbd/vfs.c                            |   78 +-
 source4/auth/ntlm/auth_sam.c                  |    9 +-
 source4/auth/sam.c                            |  158 +++-
 source4/dsdb/tests/python/password_lockout.py |  359 ++++++-
 source4/kdc/hdb-samba4.c                      |    7 +-
 source4/torture/vfs/fruit.c                   | 1252 ++++++++++++++++++++-----
 15 files changed, 1686 insertions(+), 429 deletions(-)


Changeset truncated at 500 lines:

diff --git a/auth/credentials/pycredentials.c b/auth/credentials/pycredentials.c
index e32d9a9..5fc2a70 100644
--- a/auth/credentials/pycredentials.c
+++ b/auth/credentials/pycredentials.c
@@ -209,6 +209,12 @@ static PyObject *py_creds_get_nt_hash(pytalloc_Object *self)
 	return PyString_FromStringAndSize(discard_const_p(char, ntpw->hash), 16);
 }
 
+static PyObject *py_creds_get_kerberos_state(pytalloc_Object *self)
+{
+	int state = cli_credentials_get_kerberos_state(PyCredentials_AsCliCredentials(self));
+	return PyInt_FromLong(state);
+}
+
 static PyObject *py_creds_set_kerberos_state(pytalloc_Object *self, PyObject *args)
 {
 	int state;
@@ -452,6 +458,8 @@ static PyMethodDef py_creds_methods[] = {
 		"Parse credentials string." },
 	{ "get_nt_hash", (PyCFunction)py_creds_get_nt_hash, METH_NOARGS,
 		NULL },
+	{ "get_kerberos_state", (PyCFunction)py_creds_get_kerberos_state, METH_NOARGS,
+		NULL },
 	{ "set_kerberos_state", (PyCFunction)py_creds_set_kerberos_state, METH_VARARGS,
 		NULL },
 	{ "set_krb_forwardable", (PyCFunction)py_creds_set_krb_forwardable, METH_VARARGS,
diff --git a/source3/include/proto.h b/source3/include/proto.h
index b8f4a67..4b86db0 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -1094,7 +1094,6 @@ uint32_t lp_get_spoolss_state( void );
 struct smb_signing_state;
 bool lp_use_sendfile(int snum, struct smb_signing_state *signing_state);
 void set_use_sendfile(int snum, bool val);
-void set_store_dos_attributes(int snum, bool val);
 void lp_set_mangling_method(const char *new_method);
 bool lp_posix_pathnames(void);
 void lp_set_posix_pathnames(void);
diff --git a/source3/lib/errmap_unix.c b/source3/lib/errmap_unix.c
index 56d3f00..f572b99 100644
--- a/source3/lib/errmap_unix.c
+++ b/source3/lib/errmap_unix.c
@@ -115,6 +115,9 @@ static const struct {
 #ifdef ETXTBSY
 	{ ETXTBSY,      NT_STATUS_SHARING_VIOLATION },
 #endif
+#ifdef EOVERFLOW
+	{ EOVERFLOW,      NT_STATUS_ALLOTTED_SPACE_EXCEEDED },
+#endif
 };
 
 /*********************************************************************
diff --git a/source3/libsmb/libsmb_server.c b/source3/libsmb/libsmb_server.c
index 2abd37e..06c0211 100644
--- a/source3/libsmb/libsmb_server.c
+++ b/source3/libsmb/libsmb_server.c
@@ -620,7 +620,7 @@ SMBC_server_internal(TALLOC_CTX *ctx,
 	}
 
 	ZERO_STRUCTP(srv);
-	srv->cli = c;
+	DLIST_ADD(srv->cli, c);
 	srv->dev = (dev_t)(str_checksum(server) ^ str_checksum(share));
         srv->no_pathinfo = False;
         srv->no_pathinfo2 = False;
@@ -816,7 +816,7 @@ SMBC_attr_server(TALLOC_CTX *ctx,
                 }
 
                 ZERO_STRUCTP(ipc_srv);
-                ipc_srv->cli = ipc_cli;
+                DLIST_ADD(ipc_srv->cli, ipc_cli);
 
                 nt_status = cli_rpc_pipe_open_noauth(
 			ipc_srv->cli, &ndr_table_lsarpc, &pipe_hnd);
diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c
index 610a690..d87afa6 100644
--- a/source3/modules/vfs_fruit.c
+++ b/source3/modules/vfs_fruit.c
@@ -104,11 +104,12 @@ static int vfs_fruit_debug_level = DBGC_VFS;
  * REVIEW:
  * This is hokey, but what else can we do?
  */
+#define NETATALK_META_XATTR "org.netatalk.Metadata"
 #if defined(HAVE_ATTROPEN) || defined(FREEBSD)
-#define AFPINFO_EA_NETATALK "org.netatalk.Metadata"
+#define AFPINFO_EA_NETATALK NETATALK_META_XATTR
 #define AFPRESOURCE_EA_NETATALK "org.netatalk.ResourceFork"
 #else
-#define AFPINFO_EA_NETATALK "user.org.netatalk.Metadata"
+#define AFPINFO_EA_NETATALK "user." NETATALK_META_XATTR
 #define AFPRESOURCE_EA_NETATALK "user.org.netatalk.ResourceFork"
 #endif
 
@@ -1523,6 +1524,37 @@ static bool add_fruit_stream(TALLOC_CTX *mem_ctx, unsigned int *num_streams,
 	return true;
 }
 
+static bool del_fruit_stream(TALLOC_CTX *mem_ctx, unsigned int *num_streams,
+			     struct stream_struct **streams,
+			     const char *name)
+{
+	struct stream_struct *tmp = *streams;
+	int i;
+
+	if (*num_streams == 0) {
+		return true;
+	}
+
+	for (i = 0; i < *num_streams; i++) {
+		if (strequal_m(tmp[i].name, name)) {
+			break;
+		}
+	}
+
+	if (i == *num_streams) {
+		return true;
+	}
+
+	TALLOC_FREE(tmp[i].name);
+	if (*num_streams - 1 > i) {
+		memmove(&tmp[i], &tmp[i+1],
+			(*num_streams - i - 1) * sizeof(struct stream_struct));
+	}
+
+	*num_streams -= 1;
+	return true;
+}
+
 static bool empty_finderinfo(const struct adouble *ad)
 {
 
@@ -2423,7 +2455,7 @@ static int fruit_unlink(vfs_handle_struct *handle,
 		}
 
 		/* FIXME: direct unlink(), missing smb_fname */
-		DEBUG(1,("fruit_unlink: %s\n", adp));
+		DBG_DEBUG("fruit_unlink: %s\n", adp);
 		rc = unlink(adp);
 		if ((rc == -1) && (errno == ENOENT)) {
 			rc = 0;
@@ -2446,27 +2478,8 @@ static int fruit_unlink(vfs_handle_struct *handle,
 	}
 
 	if (is_afpresource_stream(smb_fname)) {
-		if (config->rsrc == FRUIT_RSRC_ADFILE) {
-			char *adp = NULL;
-
-			rc = adouble_path(talloc_tos(),
-					  smb_fname->base_name, &adp);
-			if (rc != 0) {
-				return -1;
-			}
-			/* FIXME: direct unlink(), missing smb_fname */
-			rc = unlink(adp);
-			if ((rc == -1) && (errno == ENOENT)) {
-				rc = 0;
-			}
-			TALLOC_FREE(adp);
-		} else {
-			rc = SMB_VFS_REMOVEXATTR(handle->conn,
-						 smb_fname->base_name,
-						 AFPRESOURCE_EA_NETATALK);
-		}
-
-		return rc;
+		/* OS X ignores deletes on the AFP_Resource stream */
+		return 0;
 	}
 
 	return SMB_VFS_NEXT_UNLINK(handle, smb_fname);
@@ -2668,13 +2681,19 @@ static ssize_t fruit_pread(vfs_handle_struct *handle,
 		char afpinfo_buf[AFP_INFO_SIZE];
 		size_t to_return;
 
-		if ((offset < 0) || (offset >= AFP_INFO_SIZE)) {
+		/*
+		 * OS X has a off-by-1 error in the offset calculation, so we're
+		 * bug compatible here. It won't hurt, as any relevant real
+		 * world read requests from the AFP_AfpInfo stream will be
+		 * offset=0 n=60. offset is ignored anyway, see below.
+		 */
+		if ((offset < 0) || (offset >= AFP_INFO_SIZE + 1)) {
 			len = 0;
 			rc = 0;
 			goto exit;
 		}
 
-		to_return = AFP_INFO_SIZE - offset;
+		to_return = MIN(n, AFP_INFO_SIZE);
 
 		ai = afpinfo_new(talloc_tos());
 		if (ai == NULL) {
@@ -2697,7 +2716,10 @@ static ssize_t fruit_pread(vfs_handle_struct *handle,
 			goto exit;
 		}
 
-		memcpy(data, afpinfo_buf + offset, to_return);
+		/*
+		 * OS X ignores offset when reading from AFP_AfpInfo stream!
+		 */
+		memcpy(data, afpinfo_buf, to_return);
 		len = to_return;
 	} else {
 		len = SMB_VFS_NEXT_PREAD(
@@ -2788,6 +2810,23 @@ static ssize_t fruit_pwrite(vfs_handle_struct *handle,
 		}
 		memcpy(ad_entry(ad, ADEID_FINDERI),
 		       &ai->afpi_FinderInfo[0], ADEDLEN_FINDERI);
+		if (empty_finderinfo(ad)) {
+			/* Discard metadata */
+			if (config->meta == FRUIT_META_STREAM) {
+				rc = SMB_VFS_FTRUNCATE(fsp, 0);
+			} else {
+				rc = SMB_VFS_REMOVEXATTR(handle->conn,
+							 fsp->fsp_name->base_name,
+							 AFPINFO_EA_NETATALK);
+			}
+			if (rc != 0 && errno != ENOENT && errno != ENOATTR) {
+				DBG_WARNING("Can't delete metadata for %s: %s\n",
+					    fsp->fsp_name->base_name, strerror(errno));
+				goto exit;
+			}
+			rc = 0;
+			goto exit;
+		}
 		rc = ad_write(ad, name);
 	} else {
 		len = SMB_VFS_NEXT_PWRITE(handle, fsp, data, n,
@@ -2846,6 +2885,17 @@ static int fruit_stat_meta(vfs_handle_struct *handle,
 			   struct smb_filename *smb_fname,
 			   bool follow_links)
 {
+	struct adouble *ad = NULL;
+
+	ad = ad_get(talloc_tos(), handle, smb_fname->base_name, ADOUBLE_META);
+	if (ad == NULL) {
+		DBG_INFO("fruit_stat_meta %s: %s\n",
+			 smb_fname_str_dbg(smb_fname), strerror(errno));
+		errno = ENOENT;
+		return -1;
+	}
+	TALLOC_FREE(ad);
+
 	/* Populate the stat struct with info from the base file. */
 	if (fruit_stat_base(handle, smb_fname, follow_links) == -1) {
 		return -1;
@@ -3099,6 +3149,7 @@ static NTSTATUS fruit_streaminfo(vfs_handle_struct *handle,
 	struct fruit_config_data *config = NULL;
 	struct smb_filename *smb_fname = NULL;
 	struct adouble *ad = NULL;
+	NTSTATUS status;
 
 	SMB_VFS_HANDLE_GET_DATA(handle, config, struct fruit_config_data,
 				return NT_STATUS_UNSUCCESSFUL);
@@ -3147,8 +3198,23 @@ static NTSTATUS fruit_streaminfo(vfs_handle_struct *handle,
 
 	TALLOC_FREE(smb_fname);
 
-	return SMB_VFS_NEXT_STREAMINFO(handle, fsp, fname, mem_ctx,
-				       pnum_streams, pstreams);
+	status = SMB_VFS_NEXT_STREAMINFO(handle, fsp, fname, mem_ctx,
+					 pnum_streams, pstreams);
+	if (!NT_STATUS_IS_OK(status)) {
+		return status;
+	}
+
+	if (config->meta == FRUIT_META_NETATALK) {
+		/* Remove the Netatalk xattr from the list */
+		if (!del_fruit_stream(mem_ctx, pnum_streams, pstreams,
+				      ":" NETATALK_META_XATTR ":$DATA")) {
+				TALLOC_FREE(ad);
+				TALLOC_FREE(smb_fname);
+				return NT_STATUS_NO_MEMORY;
+		}
+	}
+
+	return NT_STATUS_OK;
 }
 
 static int fruit_ntimes(vfs_handle_struct *handle,
@@ -3212,19 +3278,23 @@ static int fruit_ftruncate_meta(struct vfs_handle_struct *handle,
 				off_t offset,
 				struct adouble *ad)
 {
-	/*
-	 * As this request hasn't been seen in the wild,
-	 * the only sensible use I can imagine is the client
-	 * truncating the stream to 0 bytes size.
-	 * We simply remove the metadata on such a request.
-	 */
-	if (offset != 0) {
+	struct fruit_config_data *config;
+
+	SMB_VFS_HANDLE_GET_DATA(handle, config,
+				struct fruit_config_data, return -1);
+
+	if (offset > 60) {
 		DBG_WARNING("ftruncate %s to %jd",
 			    fsp_str_dbg(fsp), (intmax_t)offset);
+		/* OS X returns NT_STATUS_ALLOTTED_SPACE_EXCEEDED  */
+		errno = EOVERFLOW;
 		return -1;
 	}
 
-	return SMB_VFS_FREMOVEXATTR(fsp, AFPRESOURCE_EA_NETATALK);
+	DBG_WARNING("ignoring ftruncate %s to %jd",
+		    fsp_str_dbg(fsp), (intmax_t)offset);
+	/* OS X returns success but does nothing  */
+	return 0;
 }
 
 static int fruit_ftruncate_rsrc(struct vfs_handle_struct *handle,
@@ -3271,8 +3341,8 @@ static int fruit_ftruncate(struct vfs_handle_struct *handle,
         struct adouble *ad =
 		(struct adouble *)VFS_FETCH_FSP_EXTENSION(handle, fsp);
 
-	DEBUG(10, ("streams_xattr_ftruncate called for file %s offset %.0f\n",
-		   fsp_str_dbg(fsp), (double)offset));
+	DBG_DEBUG("fruit_ftruncate called for file %s offset %.0f\n",
+		   fsp_str_dbg(fsp), (double)offset);
 
 	if (ad == NULL) {
 		return SMB_VFS_NEXT_FTRUNCATE(handle, fsp, offset);
@@ -3553,7 +3623,7 @@ static NTSTATUS fruit_fset_nt_acl(vfs_handle_struct *handle,
 	mode_t ms_nfs_mode;
 	int result;
 
-	DEBUG(1, ("fruit_fset_nt_acl: %s\n", fsp_str_dbg(fsp)));
+	DBG_DEBUG("fruit_fset_nt_acl: %s\n", fsp_str_dbg(fsp));
 
 	status = check_ms_nfs(handle, fsp, psd, &ms_nfs_mode, &do_chmod);
 	if (!NT_STATUS_IS_OK(status)) {
@@ -3569,10 +3639,8 @@ static NTSTATUS fruit_fset_nt_acl(vfs_handle_struct *handle,
 
 	if (do_chmod) {
 		if (fsp->fh->fd != -1) {
-			DEBUG(1, ("fchmod: %s\n", fsp_str_dbg(fsp)));
 			result = SMB_VFS_FCHMOD(fsp, ms_nfs_mode);
 		} else {
-			DEBUG(1, ("chmod: %s\n", fsp_str_dbg(fsp)));
 			result = SMB_VFS_CHMOD(fsp->conn,
 					       fsp->fsp_name->base_name,
 					       ms_nfs_mode);
diff --git a/source3/modules/vfs_streams_xattr.c b/source3/modules/vfs_streams_xattr.c
index 92bd1c9..b54809f 100644
--- a/source3/modules/vfs_streams_xattr.c
+++ b/source3/modules/vfs_streams_xattr.c
@@ -106,12 +106,18 @@ static NTSTATUS streams_xattr_get_name(vfs_handle_struct *handle,
 				       const char *stream_name,
 				       char **xattr_name)
 {
+	char *sname;
 	char *stype;
 	struct streams_xattr_config *config;
 
 	SMB_VFS_HANDLE_GET_DATA(handle, config, struct streams_xattr_config,
 				return NT_STATUS_UNSUCCESSFUL);
 
+	sname = talloc_strdup(ctx, stream_name + 1);
+	if (sname == NULL) {
+		return NT_STATUS_NO_MEMORY;
+	}
+
 	/*
 	 * With vfs_fruit option "fruit:encoding = native" we're
 	 * already converting stream names that contain illegal NTFS
@@ -126,41 +132,34 @@ static NTSTATUS streams_xattr_get_name(vfs_handle_struct *handle,
 	 * In check_path_syntax() we've already ensured the streamname
 	 * we got from the client is valid.
 	 */
-	stype = strrchr_m(stream_name + 1, ':');
+	stype = strrchr_m(sname, ':');
 
 	if (stype) {
+		/*
+		 * We only support one stream type: "$DATA"
+		 */
 		if (strcasecmp_m(stype, ":$DATA") != 0) {
+			talloc_free(sname);
 			return NT_STATUS_INVALID_PARAMETER;
 		}
+
+		/* Split name and type */
+		stype[0] = '\0';
 	}
 
-	*xattr_name = talloc_asprintf(ctx, "%s%s",
+	*xattr_name = talloc_asprintf(ctx, "%s%s%s",
 				      config->prefix,
-				      stream_name + 1);
+				      sname,
+				      config->store_stream_type ? ":$DATA" : "");
 	if (*xattr_name == NULL) {
+		talloc_free(sname);
 		return NT_STATUS_NO_MEMORY;
 	}
 
-	if (stype != NULL) {
-		/* Normalize the stream type to upercase. */
-		if (!strupper_m(strrchr_m(*xattr_name, ':') + 1)) {
-			return NT_STATUS_INVALID_PARAMETER;
-		}
-	} else if (config->store_stream_type) {
-		/*
-		 * Append an explicit stream type if one wasn't
-		 * specified.
-		 */
-		*xattr_name = talloc_asprintf(ctx, "%s%s",
-					      *xattr_name, ":$DATA");
-		if (*xattr_name == NULL) {
-			return NT_STATUS_NO_MEMORY;
-		}
-	}
-
 	DEBUG(10, ("xattr_name: %s, stream_name: %s\n", *xattr_name,
 		   stream_name));
 
+	talloc_free(sname);
 	return NT_STATUS_OK;
 }
 
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 6258bcc..aee7ed7 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -4285,17 +4285,6 @@ void set_use_sendfile(int snum, bool val)
 		sDefault._use_sendfile = val;
 }
 
-/*******************************************************************
- Turn off storing DOS attributes if this share doesn't support it.
-********************************************************************/
-
-void set_store_dos_attributes(int snum, bool val)
-{
-	if (!LP_SNUM_OK(snum))
-		return;
-	ServicePtrs[(snum)]->store_dos_attributes = val;
-}
-
 void lp_set_mangling_method(const char *new_method)
 {
 	lpcfg_string_set(Globals.ctx, &Globals.mangling_method, new_method);
diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py
index 630927b..5727844 100755
--- a/source3/selftest/tests.py
+++ b/source3/selftest/tests.py
@@ -380,8 +380,8 @@ for t in tests:
         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmpsort -U$USERNAME%$PASSWORD')
         plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
     elif t == "vfs.fruit":
-        plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD --option=torture:share1=vfs_fruit --option=torture:share2=tmp --option=torture:localdir=$SELFTEST_PREFIX/nt4_dc/share')
-        plansmbtorture4testsuite(t, "ad_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD --option=torture:share1=vfs_fruit --option=torture:share2=tmp --option=torture:localdir=$SELFTEST_PREFIX/ad_dc/share')
+        plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/vfs_fruit -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/nt4_dc/share')
+        plansmbtorture4testsuite(t, "ad_dc", '//$SERVER_IP/vfs_fruit -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/ad_dc/share')
     elif t == "rpc.schannel_anon_setpw":
         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$%', description="anonymous password set")
         plansmbtorture4testsuite(t, "nt4_dc_schannel", '//$SERVER_IP/tmp -U$%', description="anonymous password set (schannel enforced server-side)")
diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c
index 6265242..907f3f9 100644
--- a/source3/smbd/dosmode.c
+++ b/source3/smbd/dosmode.c
@@ -279,18 +279,9 @@ static bool get_ea_dos_attribute(connection_struct *conn,
 				   SAMBA_XATTR_DOS_ATTRIB, attrstr,
 				   sizeof(attrstr));
 	if (sizeret == -1) {
-		if (errno == ENOSYS
-#if defined(ENOTSUP)
-			|| errno == ENOTSUP) {
-#else
-				) {
-#endif
-			DEBUG(1,("get_ea_dos_attribute: Cannot get attribute "
-				 "from EA on file %s: Error = %s\n",
-				 smb_fname_str_dbg(smb_fname),
-				 strerror(errno)));
-			set_store_dos_attributes(SNUM(conn), False);
-		}
+		DBG_INFO("get_ea_dos_attribute: Cannot get attribute "
+			 "from EA on file %s: Error = %s\n",
+			 smb_fname_str_dbg(smb_fname), strerror(errno));
 		return False;
 	}
 
@@ -430,18 +421,9 @@ static bool set_ea_dos_attribute(connection_struct *conn,
 		files_struct *fsp = NULL;
 
 		if((errno != EPERM) && (errno != EACCES)) {
-			if (errno == ENOSYS
-#if defined(ENOTSUP)
-				|| errno == ENOTSUP) {
-#else
-				) {
-#endif
-				DEBUG(1,("set_ea_dos_attributes: Cannot set "
-					 "attribute EA on file %s: Error = %s\n",
-					 smb_fname_str_dbg(smb_fname),
-					 strerror(errno) ));
-				set_store_dos_attributes(SNUM(conn), False);
-			}


-- 
Samba Shared Repository



More information about the samba-cvs mailing list