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

Stefan Metzmacher metze at samba.org
Tue Mar 7 11:30:03 UTC 2017


The branch, v4-5-test has been updated
       via  89f2fd3 s4:ldap_server: match windows in the error messages of failing LDAP Bind requests
       via  4f1ad9a ldb-samba: remember the error string of a failing bind in ildb_connect()
       via  f599b6f s3: smbd: Restart reading the incoming SMB2 fd when the send queue is drained.
       via  fb15055 s3:winbindd: fix endless forest trust scan
       via  72da210 vfs_fruit: enabling AAPL extensions must be a global switch
       via  9a6a9d1 vfs_fruit: only veto AppleDouble files with fruit:resource=file
       via  8d04b53 s4/torture: vfs_fruit: add stream with illegal ntfs characters to copyile test
       via  161974b vfs_fruit: use stat info from base_fsp
       via  49e8aa8 s4/torture: vfs_fruit: test invalid AFPINFO_STREAM_NAME
       via  39c71b8 vfs_fruit: ignore or delete invalid AFP_AfpInfo streams
       via  a01b976 selftest: add shares without vfs_fruit for the vfs_fruit tests
       via  af6a0f8 s4/torture: change shares in used torture_suite_add_2ns_smb2_test()
       via  5b18aea docs/vfs_fruit: document known limitations with fruit:encoding=native
       via  9b7b2c2 s4/torture: add test for AAPL find with name with illegal NTFS characters
       via  22e8146 lib/torture: add torture_assert_mem_equal_goto
       via  66ff93b s4/torture: add a vfs_fruit renaming test with open rsrc fork
       via  f5d8f58 s4/torture: vfs_fruit: test deleting a file with resource fork
       via  8795723 s4/torture: vfs_fruit: add test_null_afpinfo test
       via  44cf7cc selftest: add description to vfs_fruit testsuites
       via  9fec738 selftest: also run vfs_fruit tests with streams_depot
       via  47c0e32 selftest: run vfs_fruit tests against share with fruit:metadata=stream
       via  ef95fde selftest: move vfs_fruit tests that require "fruit:metadata=netatalk" to vfs.fruit_netatalk
       via  17c7872 selftest: reenable vfs_fruit tests
       via  abfcab1 vfs_fruit: refactor fruit_ftruncate and use new adouble API
       via  61147af vfs_fruit: use fio in fruit_fallocate
       via  1bfb932 vfs_fruit: refactor fruit_fstat and use new adouble API
       via  93815fe vfs_fruit: refactor fruit_pread and fruit_pwrite and use new adouble API
       via  e7701ed vfs_fruit: refactor fruit_open and use new adouble API
       via  6254902 vfs_fruit: rework struct adouble API
       via  f087204 selftest: disable vfs_fruit tests
       via  bc54aa8 vfs_fruit: fix fruit_check_access()
       via  5452d23 vfs_fruit: remove base_fsp name translation
       via  ad0ff00 vfs_fruit: use SMB_VFS_NEXT_OPEN in two places
       via  eb2ee5b vfs_fruit: refactor readdir_attr_macmeta() resource fork size
       via  c8fdd5f vfs_fruit: refactor fruit_ftruncate() and fix stream case
       via  296cb1e vfs_fruit: fix fruit_ntimes() for the fruit:metadata!=netatalk case
       via  a964f03 vfs_fruit: refactor fruit_streaminfo()
       via  949b8cb vfs_fruit: add fruit_stat_rsrc_xattr() implementation
       via  e1fb128 vfs_fruit: add fruit_stat_rsrc_stream() implementation
       via  b68ee54 vfs_fruit: refactor fruit_stat_rsrc()
       via  3142a7c vfs_fruit: refactor fruit_open_rsrc()
       via  e19b247 vfs_fruit: in fruit_rmdir() check ._ files before deleting them
       via  c7fdc90 vfs_fruit: fix fruit_rmdir() for the fruit:resource!=file case
       via  a79800d vfs_fruit: fix fruit_chown() for the fruit:resource!=file case
       via  6f92b8d vfs_fruit: fix fruit_chmod() for the fruit:resource!=file case
       via  62ce4a1 vfs_fruit: refactor fruit_unlink()
       via  e271fd9 vfs_fruit: fix fruit_rename() for the fruit:resource!=file case
       via  edb25c5 vfs_fruit: correct readdir_attr_meta_finderi_stream() implementation
       via  2b0d683 vfs_fruit: refactor readdir_attr_meta()
       via  f9cffd2 vfs_fruit: update_btime() is only needed for metadata=netatalk
       via  36f814b vfs_fruit: correct fruit_stat_meta_stream() implementation
       via  eee258a vfs_fruit: refactor fruit_stat_meta()
       via  5ec96fb vfs_fruit: correct fruit_open_meta_stream() implementation
       via  20acbbf vfs_fruit: refactor fruit_open_meta()
       via  1e26b65 vfs_fruit: replace unsafe ad_entry macro with a function
       via  55897bb vfs_fruit: fix fruit_pwrite() with metadata=stream
       via  8ac4a90 vfs_fruit: rename empty_finderinfo() and make it more robust
       via  74c6b42 vfs_fruit: fix fruit_ftruncate with metadata=stream
       via  dd990c3 vfs_fruit: fix fruit_pread with metadata=stream
       via  8385932 vfs_catia: add catia_(g|s)et_dos_attributes
       via  8374fde vfs_catia: add catia_readdir_attr
       via  142b11f vfs_catia: run translation on all handle based VFS functions
       via  3ad2b22 vfs_streams_xattr: use SMB_VFS_NEXT_OPEN and CLOSE
       via  5c1d645 vfs_streams_xattr: call SMB_VFS_OPEN with smb_fname_base
       via  6e77927 s3/includes: add FinderInfo offset define to MacExtensions.h
       via  6f742ed selftest: don't run vfs_fruit tests against ad_dc env
      from  c479054 dbchecker: Stop ignoring linked cases where both objects are alive

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


- Log -----------------------------------------------------------------
commit 89f2fd34003b64023a2be185835d0de5bb93358c
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Feb 24 18:30:56 2017 +0100

    s4:ldap_server: match windows in the error messages of failing LDAP Bind requests
    
    This is important for some applications to detect the
    NT_STATUS_PASSWORD_MUST_CHANGE condition correctly.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=9048
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    (cherry picked from commit 81ccdad9d045a7a6d6a569d1685bb0bf4e64d12a)
    
    Autobuild-User(v4-5-test): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(v4-5-test): Tue Mar  7 12:29:45 CET 2017 on sn-devel-144

commit 4f1ad9a8b527d50960ec8c253fbfd740eeca1448
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Mar 2 17:19:21 2017 +0100

    ldb-samba: remember the error string of a failing bind in ildb_connect()
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=9048
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    (cherry picked from commit 4738754e7d7216f6acf790827459bb5da6b0a110)

commit f599b6ff9291463f8a1627f445c9bc75d9594c5a
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Mar 2 09:13:23 2017 -0800

    s3: smbd: Restart reading the incoming SMB2 fd when the send queue is drained.
    
    When the send queue grows greater than xconn->smb2.credits.max/16,
    smbd_smb2_request_next_incoming() doesn't allocate a new request in state->req.
    
    After smbd_smb2_io_handler() is called, it marks the fd not readable as
    state->req == NULL, and never marks it readable again.
    
    Fix by calling smbd_smb2_request_next_incoming() to restart
    reads inside smbd_smb2_flush_send_queue() which drains the
    send queue.
    
    Reported by <chen.yehua at h3c.com>
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12608
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    Autobuild-User(master): Ralph Böhme <slow at samba.org>
    Autobuild-Date(master): Fri Mar  3 02:23:20 CET 2017 on sn-devel-144
    
    (cherry picked from commit 1e0c79ddb34be9a2b9fa92d35387c443c4a381ae)

commit fb15055e8bb58630adbc5cc4f1941355d060dd12
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Mar 2 08:13:57 2017 +0100

    s3:winbindd: fix endless forest trust scan
    
    Commit 0392ebcd1d48e9f472f2148b85316a77d9cc953b effectively
    disabled the enumeration of trusts in other forests.
    
    The fixes for https://bugzilla.samba.org/show_bug.cgi?id=11691
    changed the way we fill domain->domain_flags for domains
    in other forests.
    
    Commit fffefe72fcc62d9688b45f53a5327667dc0b2fe6 readded the
    ability to enumerate trusts of other forests again, in order to
    fix https://bugzilla.samba.org/show_bug.cgi?id=11830
    
    Now we have the problem that multiple domains
    (even outside of our forest) are considert to be
    our forest root, as they have the following flags:
    NETR_TRUST_FLAG_TREEROOT and NETR_TRUST_FLAG_IN_FOREST.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12605
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>
    
    Autobuild-User(master): Ralph Böhme <slow at samba.org>
    Autobuild-Date(master): Thu Mar  2 17:53:14 CET 2017 on sn-devel-144
    
    (cherry picked from commit f9aaddcdd8f9ea648c9c5ea804f56ee3ff6c4c67)

commit 72da210cac634e0eea508eddb97f7c9ddb48df84
Author: Ralph Boehme <slow at samba.org>
Date:   Tue Feb 28 09:39:37 2017 +0100

    vfs_fruit: enabling AAPL extensions must be a global switch
    
    Apple's SMB2 AAPL extension is enabled once per SMB2
    connection. Unfortunately the (per se correct) fix for bug #12541
    results in vfs_fruit checking a per tcon config state variable to
    determine whether AAPL has been negotiated. This variable will be false
    for all but the first tcon. We must make it a global variable.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12604
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    
    Autobuild-User(master): Uri Simchoni <uri at samba.org>
    Autobuild-Date(master): Thu Mar  2 04:34:10 CET 2017 on sn-devel-144
    
    (cherry picked from commit 41204a4972ea62b7b656ad81e24bd052990f7e87)

commit 9a6a9d186b26f5da60e3003a68837f645a354e79
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Jan 19 09:30:45 2017 +0100

    vfs_fruit: only veto AppleDouble files with fruit:resource=file
    
    vfs_fruit only creates AppleDouble files itself when "fruit:resource" is
    set to "file" (the default). It is only then the these AppleDouble files
    should be treated as an internal representation and should be
    inaccessible from clients.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12526>
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 708767da8c366c021d6d15a3ae71d009357c3320)

commit 8d04b53642419c3199b9f12f2441f4eabef7b68d
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Feb 17 16:35:44 2017 +0100

    s4/torture: vfs_fruit: add stream with illegal ntfs characters to copyile test
    
    This ensures a stream with illegal NTFS characters mapped to the Unicode
    private range like
    
      :foo\xef\x80\xa2bar:$DATA
    
    that is stored as an xattr name
    
      user.DosStream.foo:bar:$DATA
    
    if "fruit:encoding = native" is set, is copied by the special fruit
    copy_chunk request.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit c7a79a9b35225f41eeae961ab340882c7d49f0c4)

commit 161974b5599348c0e9a4e8ed0c513614dbc67014
Author: Ralph Boehme <slow at samba.org>
Date:   Tue Feb 7 15:01:53 2017 +0100

    vfs_fruit: use stat info from base_fsp
    
    This is also supposed to be valid in the VFS stack, so there's no need
    to re-stat here.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit ffa727f33b06e71403303b53797a068f455b22f8)

commit 49e8aa8287da089699964a5a08e922d98caee759
Author: Ralph Boehme <slow at samba.org>
Date:   Sun Dec 11 19:11:09 2016 +0100

    s4/torture: vfs_fruit: test invalid AFPINFO_STREAM_NAME
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 8b7e88f368ce793699fc57272e74d0815219a250)

commit 39c71b82a4b85c27dcd9c1f558a356ae78529fdf
Author: Ralph Boehme <slow at samba.org>
Date:   Sun Dec 11 19:10:05 2016 +0100

    vfs_fruit: ignore or delete invalid AFP_AfpInfo streams
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit a2afd61906fbf36f75b2054abfd7384f220a14e3)

commit a01b97637817e8aa85308caacb3927a0fce64ba2
Author: Ralph Boehme <slow at samba.org>
Date:   Sun Dec 11 19:06:46 2016 +0100

    selftest: add shares without vfs_fruit for the vfs_fruit tests
    
    Not used for now, but the next commit will add a test that makes use of
    this.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit bac79eac093e042f22a77fa8e468f8c92bb3c113)

commit af6a0f80cdcfb9b4f193f5874b095eaf3e0071c0
Author: Ralph Boehme <slow at samba.org>
Date:   Sun Dec 11 19:02:37 2016 +0100

    s4/torture: change shares in used torture_suite_add_2ns_smb2_test()
    
    torture_suite_add_2ns_smb2_test wan't used, change it to use the default
    share as share 1 and a second share taken from torture option
    "torture:share2".
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 08dc5b4673a955f365095824275e67b2ea8fc31e)

commit 5b18aeaab9c7374b59b9db2a88c33343a82c9ba5
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Dec 8 17:47:36 2016 +0100

    docs/vfs_fruit: document known limitations with fruit:encoding=native
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit b302444f5b0675f0cb0f26fa2ad53e298067f7ab)

commit 9b7b2c26e3ac60fbdb3a7a05697cf349c446072e
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Dec 8 15:45:12 2016 +0100

    s4/torture: add test for AAPL find with name with illegal NTFS characters
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit c8baf2760ad51a7739084a8e2617c58c287b651e)

commit 22e81466a870d0cb6c70b9fab35893dc00c46d41
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Dec 8 15:44:37 2016 +0100

    lib/torture: add torture_assert_mem_equal_goto
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 49723151b2107553559c397adadda90f7c4806f7)

commit 66ff93ba5dca7b418eb4a42ac75c548f6fc3679a
Author: Ralph Boehme <slow at samba.org>
Date:   Tue Dec 6 10:25:46 2016 +0100

    s4/torture: add a vfs_fruit renaming test with open rsrc fork
    
    Verify IO on the resource fork works after a rename of the basefile.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 8ae4539e47bcaa37d5a052eaf443a95287d851e1)

commit f5d8f58300116fd537e8ae15f319fd99529b212e
Author: Ralph Boehme <slow at samba.org>
Date:   Mon Dec 5 11:21:15 2016 +0100

    s4/torture: vfs_fruit: test deleting a file with resource fork
    
    All the other tests ignore the return value of smb2_util_unlink().
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit f555c2318eb06d1ceef32423dba9cd1a7c76f956)

commit 8795723246c41b57af99a2922ef54a680ef52cef
Author: Ralph Boehme <slow at samba.org>
Date:   Tue Nov 29 16:21:08 2016 +0100

    s4/torture: vfs_fruit: add test_null_afpinfo test
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 3227b891fcdd912b0c09398fed751fe8b53d01c9)

commit 44cf7ccaa06c91c090a8af57f85799d14b1e05ca
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Dec 8 17:41:14 2016 +0100

    selftest: add description to vfs_fruit testsuites
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 9975c7569cf5af74c25ac03985a7c409164ac2ce)

commit 9fec73821b2b92cd765e4c826baa2cba15843be2
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Dec 2 07:42:07 2016 +0100

    selftest: also run vfs_fruit tests with streams_depot
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit f7b0982826b58cfcdaf8782e15c2440f31a45ba2)

commit 47c0e3282ffd269bb69eec761e7daf9879af384f
Author: Ralph Boehme <slow at samba.org>
Date:   Tue Nov 15 15:25:14 2016 +0100

    selftest: run vfs_fruit tests against share with fruit:metadata=stream
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit d9ab40e0834c074ea26460347b035c52eb5eb0d7)

commit ef95fdecfcbc2bf841ed73e98a47934bb43d6604
Author: Ralph Boehme <slow at samba.org>
Date:   Tue Nov 15 22:31:20 2016 +0100

    selftest: move vfs_fruit tests that require "fruit:metadata=netatalk" to vfs.fruit_netatalk
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit cc885223d79a7e8eb2177a351b745dceec0c9f5a)

commit 17c78725edeace89d8cdb9580a7eec0fd0a8cf6e
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Dec 8 20:43:21 2016 +0100

    selftest: reenable vfs_fruit tests
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 51189bd4758a140bad6abf3300c931302432a687)

commit abfcab1bb9dbc9865c1d2d65f20aa7db59aa4387
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Dec 8 20:42:54 2016 +0100

    vfs_fruit: refactor fruit_ftruncate and use new adouble API
    
    Use struct fio to denote a fsp handle is for a stream we care about.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit cc88132854ed47510e056ed451ed376770ee301e)

commit 61147afcc19221f3cf075bf06c5dfdfdb72de504
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Dec 8 20:41:55 2016 +0100

    vfs_fruit: use fio in fruit_fallocate
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit b3c0f785d753b26404f67acf8061be1cafde79a9)

commit 1bfb93264ced16a7193d166ca69dbacc317a27b6
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Dec 8 20:39:38 2016 +0100

    vfs_fruit: refactor fruit_fstat and use new adouble API
    
    Use struct fio to denote a fsp handle is for a stream we care about.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit ae6199c5ef9022518a709bb9aff20b8b2d83e456)

commit 93815feca1f4f51fe5492d0368e7fb67c824b129
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Dec 8 20:38:17 2016 +0100

    vfs_fruit: refactor fruit_pread and fruit_pwrite and use new adouble API
    
    Use struct fio to denote a fsp handle is for a stream we care about.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit fcb9c840d7d082457c3136a44a23b489c98b0327)

commit e7701ed1485f6a8ee3c851a8bb8d08b016e4f671
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Dec 8 20:34:55 2016 +0100

    vfs_fruit: refactor fruit_open and use new adouble API
    
    Use struct fio to denote a fsp handle is for a stream we care about.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 6537c56de5dae8a1d193a949910296aea1cb6a4e)

commit 6254902e6b74131f325408d810139117f801ef76
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Dec 8 19:12:32 2016 +0100

    vfs_fruit: rework struct adouble API
    
    o factor out ad_open(), opens an fd to be used with IO on the metadata
      streams
    
    o rename ad_write() to ad_set() as this aligns nicely with the existing
      ad_get. This is the pathname based version used to solely set metadata
      on a file, there's also a handle based version:
    
    o add ad_fset(), a handle based version that can be used to set metadata
      and to update the AppleDouble header in a ._ AppleDouble file
    
    o remove fruit_fsp_recheck(), looking at it more closely, it is not
      needed
    
    This commit *compiles*, but all callers in the VFS ops must now be
    updated to use the new semantics, this comes next...
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (backported from commit 1d1203574328570288806fffefabb550ecc4e95d)

commit f0872043cd69f842e5dae4865f8b223fe11e6e43
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Dec 8 22:54:46 2016 +0100

    selftest: disable vfs_fruit tests
    
    The next commits will completely change handle based VFS ops. This
    couldn't be done in a piecemeal fashion, I had to wipe the slate clean.
    
    Disabling tests in order to not break git bisects.
    
    Tests will be reenabled after a few commits that apply the larger change
    in a somewhat digestible fashion.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 8703b8ef9d54c841d9da3f94b81195f247873dea)

commit bc54aa8e96a60dd8d5ef202577da3eeb62427ffe
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Dec 8 11:08:53 2016 +0100

    vfs_fruit: fix fruit_check_access()
    
    Applying fcntl read locks requires an fd opened for reading. This means
    we have to check the open flags of an fd and if the fd is not opened for
    reading, we can't use it to set shared fctnl locks.
    
    Iow we won't be applying interop locks with Netatalk for files openend
    write-only.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 41a2b2f5cdf751e17bde60e5cfbe395450e67485)

commit 5452d23372c98231e0d07a29f2a7c6d374d29dfd
Author: Ralph Boehme <slow at samba.org>
Date:   Tue Dec 6 15:07:20 2016 +0100

    vfs_fruit: remove base_fsp name translation
    
    This is now nicely done by vfs_catia for us.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit b1223520e3d35f59e0f77648e0afdf049e1c9de3)

commit ad0ff00029a6b4b7f1c22c6b9722b8785b6a8f77
Author: Ralph Boehme <slow at samba.org>
Date:   Wed Feb 8 19:15:38 2017 +0100

    vfs_fruit: use SMB_VFS_NEXT_OPEN in two places
    
    Using the SMB_VFS_OPEN leads to a logic recursion that is hard to follow
    and debug. It may be called twice for the same fsp with two different
    smb_fname's.
    
    Changing this here to use the NEXT function instead should have no
    change in behaviour otherwise, but it allows adding sane caching to
    vfs_catia to handle based VFS ops.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 3e2a7f6227204e932a8337fe77cdda22d28f85f6)

commit eb2ee5b3b93d7ee2b6cd1c708ade09683f90c3c4
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Dec 2 17:00:03 2016 +0100

    vfs_fruit: refactor readdir_attr_macmeta() resource fork size
    
    Move resource fork size calculation to helper functions.
    
    Adds correct handling for the fruit:resource=stream case in
    readdir_attr_rfork_size_stream(), this wasn't done previously.
    
    Otherwise no change in behaviour.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit ad8a3b6971945fbceeef8763613a9e5f5a475098)

commit c8fdd5f2c1d4dc6d9f3eec2a01d040c756360e79
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Dec 2 16:20:46 2016 +0100

    vfs_fruit: refactor fruit_ftruncate() and fix stream case
    
    The fruit:metadata=stream case wasn't handled previosly, this is now
    done in fruit_ftruncate_rsrc_stream(). The rest is just refactoring and
    no change in behaviour.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit a5b060fcd2c1d26bd0abfceffcd7b2c43056c78e)

commit 296cb1e940858b5c454725a28a03f226600f3d35
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Dec 2 15:57:22 2016 +0100

    vfs_fruit: fix fruit_ntimes() for the fruit:metadata!=netatalk case
    
    The following code must only be executed for the fruit:metadata=netatalk
    case. Otherwise no change in behaviour.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit b0b785b0d4b64810f6ee58b015929641246479d1)

commit a964f03515a286192e83f3ea3d2bd09f057e536f
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Dec 2 15:49:03 2016 +0100

    vfs_fruit: refactor fruit_streaminfo()
    
    Handle all settings of fruit:metadata and fruit:resource in helper
    functions.
    
    Resource fork streams of 0 bytes must be filtered out, this wasn't done
    previously for the fruit:resource=stream and xattr case.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit ef2c81eb9fe5e12d5694af665be198994e02762d)

commit 949b8cb7db0431d3ecc74c137f9104fcba74f70e
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Dec 2 11:44:53 2016 +0100

    vfs_fruit: add fruit_stat_rsrc_xattr() implementation
    
    This fixes fruit_stat_rsrc for the fruit:resource=xattr case.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 72325d946aacc1beec0eb411f4c7209e06850e91)

commit e1fb128843c81e81b8a3062041a98d95790030a7
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Dec 2 11:30:06 2016 +0100

    vfs_fruit: add fruit_stat_rsrc_stream() implementation
    
    This fixes fruit_stat_rsrc for the fruit:resource=stream case.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit cbf87b46c2ad7d0795616c517d3e39f24d827ef4)

commit b68ee54a8ff1781ed803def8584b23f4126bb138
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Dec 2 11:26:22 2016 +0100

    vfs_fruit: refactor fruit_stat_rsrc()
    
    Use helper functions for the fruit:resource cases. No change in
    behaveour.
    
    The next patch will add the proper helper functions for
    fruit:resource=xattr and fruit:resource=stream.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 5037816d28df6f1eed46abf910b0cd4c1a40ec77)

commit 3142a7c60b92c766fdc840b205ecfa5b1f303b76
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Dec 2 10:46:55 2016 +0100

    vfs_fruit: refactor fruit_open_rsrc()
    
    This just splits up fruit_open_rsrc() to use helper functions for each
    config->rsrc setting. No change in behaviour.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 22da6c82f08ed82cf7eddb3fdda2b6ab66264683)

commit e19b247c56ac69ada09dce2981cac5a596e930fc
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Dec 9 18:24:40 2016 +0100

    vfs_fruit: in fruit_rmdir() check ._ files before deleting them
    
    This ensures we only delete valid AppleDouble files whose names begin
    with "._", not just *any* file that matches "^._*".
    
    Also use proper VFS functions instead of direclty calling the C library
    functions.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit b95d2042e51ad4c2854e3b2465d55a063bc19f95)

commit c7fdc9053536fa9e7db4f65acadf3ec5ab755887
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Dec 9 18:22:49 2016 +0100

    vfs_fruit: fix fruit_rmdir() for the fruit:resource!=file case
    
    The following code must only be executed for the fruit:resource=file
    case. Otherwise no change in behaviour.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 19854072dbb7a9ba97d48f4012ea3a238721fc58)

commit a79800d7eb573d13f4acd836cce5ea27378fb14a
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Dec 2 09:04:37 2016 +0100

    vfs_fruit: fix fruit_chown() for the fruit:resource!=file case
    
    The following code must only be executed for the fruit:resource=file
    case.
    
    While at it, remove an unnecessary lstat, use the stat info from
    smb_fname.
    
    Otherwise no change in behaviour for the fruit:resource=file case (the
    default).
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 09c82a1ce192112a7264d19f6d8888bad49f6a82)

commit 6f92b8d642b007699464273ec95a20ab2808b370
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Dec 2 09:02:27 2016 +0100

    vfs_fruit: fix fruit_chmod() for the fruit:resource!=file case
    
    The following code must only be executed for the fruit:resource=file
    case.
    
    While at it, remove an unnecessary lstat, use the stat info from
    smb_fname.
    
    Otherwise no change in behaviour for the fruit:resource=file case (the
    default).
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 22b509f52ed4de0856432327b3bf78fedcde141b)

commit 62ce4a1452f4a54914d0341155bebe1861217643
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Dec 2 09:00:31 2016 +0100

    vfs_fruit: refactor fruit_unlink()
    
    Refactor fruit_unlink() addin helper functions for all fruit:metadata
    and fruit:resource settings.
    
    No change in behaviour for fruit:metadata=netatalk and
    fruit:resource=file (both the default), but fixes behaviour for the
    other cases.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 6730e1035ba740d0de413256a211937c3bd794e1)

commit e271fd96f42f479460d1e8e460e5cdff918c2728
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Dec 2 08:47:36 2016 +0100

    vfs_fruit: fix fruit_rename() for the fruit:resource!=file case
    
    o fix the config check, we must only run following code for the
      fruit:resource=file
    
    o properly call SMB_VFS_NEXT_RENAME() instead diretly calling rename()
    
    o bail out if we get an invalid stat
    
    Otherwise, no change in behaviour.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 8a9d0c541875d06254dc3a3039b20c8acac328ed)

commit edb25c56c17efe787f3d461b5f8ec9a4f1ed8b7c
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Dec 9 17:24:18 2016 +0100

    vfs_fruit: correct readdir_attr_meta_finderi_stream() implementation
    
    This gets correct behaviour in readdir_attr_meta_finderi for the
    metadata=stream case.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 604bd6bf80285db2e52266708d55215f07503c73)

commit 2b0d683803228cd98ecc3c293c2b98c5c52dacb5
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Dec 1 17:04:35 2016 +0100

    vfs_fruit: refactor readdir_attr_meta()
    
    Move the FinderInfo stuff to helper functions, no change in behaviour so
    far.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 5a466560b2811c78d731cc039c99c740ddee5ffc)

commit f9cffd2a66105e60082c82b8525d7e6c378511a0
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Dec 2 17:25:47 2016 +0100

    vfs_fruit: update_btime() is only needed for metadata=netatalk
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 79159f8dc95057187601ac167414cc49282bdabf)

commit 36f814bf1af326ae8a3ac3fa81111630be8aebaf
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Dec 2 11:12:18 2016 +0100

    vfs_fruit: correct fruit_stat_meta_stream() implementation
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit cb1121ec3268fecb7fa0f5fbb6d2dbffaea991b3)

commit eee258a8bb2355cb625964545f3f0e73b5aa038f
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Dec 2 11:05:50 2016 +0100

    vfs_fruit: refactor fruit_stat_meta()
    
    Handle config->meta in helper functions. No change in behaviour. The next step
    will add the correct implementation of fruit_stat_meta_stream().
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit aaf2ae1b2b1a2822bff6140dfd7afde1569c2548)

commit 5ec96fb66d67c93976ad1ac41211441d69073950
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Dec 9 17:01:37 2016 +0100

    vfs_fruit: correct fruit_open_meta_stream() implementation
    
    This needs to create and write a metadata blob when the stream is
    created.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit a3be9e69c3d3ff4980b47261dc0d043a0275a8c0)

commit 20acbbff0aeddb7a2306d574056fabf41371d463
Author: Ralph Boehme <slow at samba.org>
Date:   Tue Nov 29 16:56:00 2016 +0100

    vfs_fruit: refactor fruit_open_meta()
    
    Just split out the fruit:metadata=stream case into a helper function, no
    change in behaviour.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 5a072ca91c642e61b36f1670105f6c8d1e64e25c)

commit 1e26b659c870da3bb6ffd1ab3d01770cbf1dbe06
Author: Ralph Boehme <slow at samba.org>
Date:   Wed Nov 16 11:01:45 2016 +0100

    vfs_fruit: replace unsafe ad_entry macro with a function
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 3d5bf4b85f3ca120206a12b3d102aef2ead33082)

commit 55897bb8d1d56465fc78035b9ad9a51208ac0275
Author: Ralph Boehme <slow at samba.org>
Date:   Tue Nov 15 21:32:25 2016 +0100

    vfs_fruit: fix fruit_pwrite() with metadata=stream
    
    This makes the test "delete AFP_AfpInfo by writing all 0" pass with
    fruit:metadata=stream.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit b121fff1568b0365ed27655bcd600a8d82cc3489)

commit 8ac4a900ad832eb0d19404e1279b8137902be83e
Author: Ralph Boehme <slow at samba.org>
Date:   Fri Dec 9 16:25:38 2016 +0100

    vfs_fruit: rename empty_finderinfo() and make it more robust
    
    No change in behaviour, but ad_entry(ad, ADEID_FINDERI) can in theory
    return NULL.
    
    The next commit will add the same function for a AfpInfo type, so rename
    this function that works on struct adouble to ad_empty_finderinfo().
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 05d54dd71c9797e607c9fa3c5218c13755c7c652)

commit 74c6b42fe253d760ec57a25e54c6e06fc9285dd0
Author: Ralph Boehme <slow at samba.org>
Date:   Tue Nov 15 20:32:05 2016 +0100

    vfs_fruit: fix fruit_ftruncate with metadata=stream
    
    With this the test "setinfo eof AFP_AfpInfo" passed with
    fruit:metadata=stream.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 04feedb7f6e4519352fdd901356e6e53d97896d5)

commit dd990c3ee140677a38a4ed8d3d0ce3d4038a96f6
Author: Ralph Boehme <slow at samba.org>
Date:   Wed Nov 16 09:34:13 2016 +0100

    vfs_fruit: fix fruit_pread with metadata=stream
    
    This make the test "fix offset and len handling for AFP_AfpInfo stream"
    pass with fruit:metadata=stream.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit d0eed8e73ff39acc6dca70a44f00f81d8ca564fd)

commit 8385932ffa077d4ed7333ffd4697e9e0e88bcd84
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Dec 8 17:18:51 2016 +0100

    vfs_catia: add catia_(g|s)et_dos_attributes
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 633aa1ac10ba4e9d7a97fa026a407defb919ce1a)

commit 8374fdecee81232605cdaafd16547cecaf7373b1
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Dec 8 15:44:56 2016 +0100

    vfs_catia: add catia_readdir_attr
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit abe3572c59bec0f8da2a79e4ece9de43e8b5e16b)

commit 142b11f94afa7b830bb12b94c4c077c6c1816c57
Author: Ralph Boehme <slow at samba.org>
Date:   Tue Dec 6 15:00:58 2016 +0100

    vfs_catia: run translation on all handle based VFS functions
    
    Also run translation of fsp->fsp_name and optionally
    fsp->base_fsp->fsp_name if set for all handle based VFS functions.
    
    This is necessary because some modules might use the path for something
    in the handle based VFS ops.
    
    An existing example is vfs_fruit. A later commit will remove the
    translation that was done there because catia didn't before this commit.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit af3b4ea4744ab2b67b4221cd6118b6cd2774660f)

commit 3ad2b229cce9c7719efc02ef2ffda684b6feb29e
Author: Ralph Boehme <slow at samba.org>
Date:   Wed Feb 8 19:16:21 2017 +0100

    vfs_streams_xattr: use SMB_VFS_NEXT_OPEN and CLOSE
    
    Using the SMB_VFS_OPEN leads to a recursion in the VFS that is hard to
    follow and debug. It's called twice for the same fsp with two different
    smb_fname's which makes it at least hard to debug, it may even be an
    invalid usage.
    
    Changing this here to use the NEXT function instead should have no
    change in behaviour otherwise.
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=12565
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 4e2c7d0ec45adf5992446e3e05c90dd40c2fd75b)

commit 5c1d6459ace81ff99e1246bc589b127417c0ce01
Author: Ralph Boehme <slow at samba.org>
Date:   Thu Dec 1 11:17:48 2016 +0100

    vfs_streams_xattr: call SMB_VFS_OPEN with smb_fname_base
    
    In case an SMB_VFS_OPEN() on a stream basename fails with EISDIR, we
    retry the open as O_RDONLY. The retry should be done with the
    smb_fname_base as well.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 8035754c28c1a469de4fac77247ef7e5a1d8b463)

commit 6e77927d004172f2bf8341c0f1dc501dfdd94113
Author: Ralph Boehme <slow at samba.org>
Date:   Wed Nov 16 11:24:59 2016 +0100

    s3/includes: add FinderInfo offset define to MacExtensions.h
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 73a0768865a1f5e74d50e601641cbac5340f9e2d)

commit 6f742ed6cc804f808e01453fc2e380db3c0d52ec
Author: Ralph Boehme <slow at samba.org>
Date:   Tue Nov 15 13:07:12 2016 +0100

    selftest: don't run vfs_fruit tests against ad_dc env
    
    This is just redundant and didn't add test coverage.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12427
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Uri Simchoni <uri at samba.org>
    (cherry picked from commit 5e612352225e0296e3f91c8db2adcca4f098e514)

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

Summary of changes:
 docs-xml/manpages/vfs_fruit.8.xml   |   20 +-
 lib/ldb-samba/ldb_ildap.c           |    1 +
 lib/torture/torture.h               |   10 +
 selftest/target/Samba3.pm           |   24 +
 source3/include/MacExtensions.h     |    3 +
 source3/modules/vfs_catia.c         | 1355 +++++++++++++-
 source3/modules/vfs_fruit.c         | 3525 +++++++++++++++++++++++++----------
 source3/modules/vfs_streams_xattr.c |   14 +-
 source3/selftest/tests.py           |    7 +-
 source3/smbd/smb2_server.c          |   14 +-
 source3/winbindd/winbindd_ads.c     |    8 +
 source3/winbindd/winbindd_util.c    |   22 +
 source4/ldap_server/ldap_bind.c     |   37 +-
 source4/torture/vfs/fruit.c         |  409 +++-
 source4/torture/vfs/vfs.c           |   37 +-
 15 files changed, 4389 insertions(+), 1097 deletions(-)


Changeset truncated at 500 lines:

diff --git a/docs-xml/manpages/vfs_fruit.8.xml b/docs-xml/manpages/vfs_fruit.8.xml
index a0b3893..83ebb68 100644
--- a/docs-xml/manpages/vfs_fruit.8.xml
+++ b/docs-xml/manpages/vfs_fruit.8.xml
@@ -168,9 +168,13 @@
 
 	      <para>Controls how the set of illegal NTFS ASCII
 	      character, commonly used by OS X clients, are stored in
-	      the filesystem:</para>
+	      the filesystem.</para>
 
-	      <itemizedlist>
+	      <para><emphasis>Important:</emphasis> this is known to not fully
+	      work with <emphasis>fruit:metadata=stream</emphasis> or
+	      <emphasis>fruit:resource=stream</emphasis>.</para>
+
+ 	      <itemizedlist>
 
 		<listitem><para><command>private (default)</command> -
 		store characters as encoded by the OS X client: mapped
@@ -231,10 +235,14 @@
 	  <varlistentry>
 	    <term>fruit:veto_appledouble = yes | no</term>
 	    <listitem>
-	      <para>Whether ._ AppleDouble files are vetoed which
-	      prevents the client from seing and accessing internal
-	      AppleDouble files created by vfs_fruit itself for the
-	      purpose of storing a Mac resource fork.</para>
+	      <para><emphasis>Note:</emphasis> this option only applies when
+	      <parameter>fruit:resource</parameter> is set to
+	      <parameter>file</parameter> (the default).</para>
+
+	      <para>When <parameter>fruit:resource</parameter> is set to
+	      <parameter>file</parameter>, vfs_fruit may create ._ AppleDouble
+	      files. This options controls whether these ._ AppleDouble files
+	      are vetoed which prevents the client from accessing them.</para>
 	      <para>Vetoing ._ files may break some applications, eg
 	      extracting Mac ZIP archives from Mac clients failes,
 	      because they contain ._ files. Setting this option to
diff --git a/lib/ldb-samba/ldb_ildap.c b/lib/ldb-samba/ldb_ildap.c
index 65f11db..541971f 100644
--- a/lib/ldb-samba/ldb_ildap.c
+++ b/lib/ldb-samba/ldb_ildap.c
@@ -863,6 +863,7 @@ static int ildb_connect(struct ldb_context *ldb, const char *url,
 	return LDB_SUCCESS;
 
 failed:
+	ldb_set_errstring(ldb, ldap_errstr(ildb->ldap, module, status));
 	talloc_free(module);
 	if (NT_STATUS_IS_LDAP(status)) {
 		return NT_STATUS_LDAP_CODE(status);
diff --git a/lib/torture/torture.h b/lib/torture/torture.h
index 45332b2..b6d1301 100644
--- a/lib/torture/torture.h
+++ b/lib/torture/torture.h
@@ -357,6 +357,16 @@ void torture_result(struct torture_context *test,
 	} \
 	} while(0)
 
+#define torture_assert_mem_equal_goto(torture_ctx,got,expected,len,ret,label,cmt) \
+	do { const void *__got = (got), *__expected = (expected); \
+	if (memcmp(__got, __expected, len) != 0) { \
+		torture_result(torture_ctx, TORTURE_FAIL, \
+			       __location__": "#got" of len %d did not match "#expected": %s", (int)len, cmt); \
+		ret = false; \
+		goto label; \
+	} \
+	} while(0)
+
 static inline void torture_dump_data_str_cb(const char *buf, void *private_data)
 {
 	char **dump = (char **)private_data;
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index f5e63e3..938d195 100755
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -1623,6 +1623,30 @@ sub provision($$$$$$$$)
 	fruit:locking = netatalk
 	fruit:encoding = native
 
+[vfs_fruit_metadata_stream]
+	path = $shrdir
+	vfs objects = fruit streams_xattr acl_xattr
+	ea support = yes
+	fruit:resource = file
+	fruit:metadata = stream
+
+[vfs_fruit_stream_depot]
+	path = $shrdir
+	vfs objects = fruit streams_depot acl_xattr
+	ea support = yes
+	fruit:resource = stream
+	fruit:metadata = stream
+
+[vfs_wo_fruit]
+	path = $shrdir
+	vfs objects = streams_xattr acl_xattr
+	ea support = yes
+
+[vfs_wo_fruit_stream_depot]
+	path = $shrdir
+	vfs objects = streams_depot acl_xattr
+	ea support = yes
+
 [badname-tmp]
 	path = $badnames_shrdir
 	guest ok = yes
diff --git a/source3/include/MacExtensions.h b/source3/include/MacExtensions.h
index 23dcde9..e17d39b 100644
--- a/source3/include/MacExtensions.h
+++ b/source3/include/MacExtensions.h
@@ -51,6 +51,9 @@
 #define AFP_Version			0x00000100
 #define AFP_BackupTime		0x80000000
 #define AFP_FinderSize		32
+
+#define AFP_OFF_FinderInfo	16
+
 /*
 ** Orginal AFP_AfpInfo stream used by NT 
 ** We needed a way to store the create date so SAMBA
diff --git a/source3/modules/vfs_catia.c b/source3/modules/vfs_catia.c
index f4c77d9..0ee7c36 100644
--- a/source3/modules/vfs_catia.c
+++ b/source3/modules/vfs_catia.c
@@ -4,13 +4,13 @@
  * Implement a fixed mapping of forbidden NT characters in filenames that are
  * used a lot by the CAD package Catia.
  *
- * Yes, this a BAD BAD UGLY INCOMPLETE hack, but it helps quite some people
- * out there. Catia V4 on AIX uses characters like "<*$ a *lot*, all forbidden
- * under Windows...
+ * Catia V4 on AIX uses characters like "<*$ a *lot*, all forbidden under
+ * Windows...
  *
  * Copyright (C) Volker Lendecke, 2005
  * Copyright (C) Aravind Srinivasan, 2009
  * Copyright (C) Guenter Kukkukk, 2013
+ * Copyright (C) Ralph Boehme, 2017
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -29,6 +29,8 @@
 
 #include "includes.h"
 #include "smbd/smbd.h"
+#include "lib/util/tevent_unix.h"
+#include "lib/util/tevent_ntstatus.h"
 
 static int vfs_catia_debug_level = DBGC_VFS;
 
@@ -52,6 +54,15 @@ struct share_mapping_entry {
 	struct char_mappings **mappings;
 };
 
+struct catia_cache {
+	bool is_fsp_ext;
+	const struct catia_cache * const *busy;
+	char *orig_fname;
+	char *fname;
+	char *orig_base_fname;
+	char *base_fname;
+};
+
 struct share_mapping_entry *srt_head = NULL;
 
 static bool build_table(struct char_mappings **cmaps, int value)
@@ -353,30 +364,305 @@ static NTSTATUS catia_translate_name(struct vfs_handle_struct *handle,
 	return ret;
 }
 
+#define CATIA_DEBUG_CC(lvl, cc, fsp) \
+	catia_debug_cc((lvl), (cc), (fsp), __location__);
+
+static void catia_debug_cc(int lvl,
+			   struct catia_cache *cc,
+			   files_struct *fsp,
+			   const char *location)
+{
+	DEBUG(lvl, ("%s: cc [0x%p] cc->busy [0x%p] "
+		    "is_fsp_ext [%s] "
+		    "fsp [0x%p] fsp name [%s] "
+		    "orig_fname [%s] "
+		    "fname [%s] "
+		    "orig_base_fname [%s] "
+		    "base_fname [%s]\n",
+		    location,
+		    cc, cc->busy,
+		    cc->is_fsp_ext ? "yes" : "no",
+		    fsp, fsp_str_dbg(fsp),
+		    cc->orig_fname, cc->fname,
+		    cc->orig_base_fname, cc->base_fname));
+}
+
+static void catia_free_cc(struct catia_cache **_cc,
+			  vfs_handle_struct *handle,
+			  files_struct *fsp)
+{
+	struct catia_cache *cc = *_cc;
+
+	if (cc->is_fsp_ext) {
+		VFS_REMOVE_FSP_EXTENSION(handle, fsp);
+		cc = NULL;
+	} else {
+		TALLOC_FREE(cc);
+	}
+
+	*_cc = NULL;
+}
+
+static struct catia_cache *catia_validate_and_apply_cc(
+				       vfs_handle_struct *handle,
+				       files_struct *fsp,
+				       const struct catia_cache * const *busy,
+				       bool *make_tmp_cache)
+{
+	struct catia_cache *cc = NULL;
+
+	*make_tmp_cache = false;
+
+	cc = (struct catia_cache *)VFS_FETCH_FSP_EXTENSION(handle, fsp);
+	if (cc == NULL) {
+		return NULL;
+	}
+
+	if (cc->busy != NULL) {
+		if (cc->busy == busy) {
+			/* This should never happen */
+			CATIA_DEBUG_CC(0, cc, fsp);
+			smb_panic(__location__);
+		}
+
+		/*
+		 * Recursion. Validate names, the names in the fsp's should be
+		 * the translated names we had set.
+		 */
+
+		if ((cc->fname != fsp->fsp_name->base_name)
+		    ||
+		    ((fsp->base_fsp != NULL) &&
+		     (cc->base_fname != fsp->base_fsp->fsp_name->base_name)))
+		{
+			CATIA_DEBUG_CC(10, cc, fsp);
+
+			/*
+			 * Names changed. Setting don't expose the cache on the
+			 * fsp and ask the caller to create a temporary cache.
+			 */
+			*make_tmp_cache = true;
+			return NULL;
+		}
+
+		/*
+		 * Ok, a validated cache while in a recursion, just let the
+		 * caller detect that cc->busy is != busy and there's
+		 * nothing else to do.
+		 */
+		CATIA_DEBUG_CC(10, cc, fsp);
+		return cc;
+	}
+
+	/* Not in a recursion */
+
+	if ((cc->orig_fname != fsp->fsp_name->base_name)
+	    ||
+	    ((fsp->base_fsp != NULL) &&
+	     (cc->orig_base_fname != fsp->base_fsp->fsp_name->base_name)))
+	{
+		/*
+		 * fsp names changed, this can happen in an rename op.
+		 * Trigger recreation as a full fledged fsp extension.
+		 */
+
+		CATIA_DEBUG_CC(10, cc, fsp);
+		catia_free_cc(&cc, handle, fsp);
+		return NULL;
+	}
+
+
+	/*
+	 * Ok, we found a valid cache entry, no recursion. Just set translated
+	 * names from the cache and mark the cc as busy.
+	 */
+	fsp->fsp_name->base_name = cc->fname;
+	if (fsp->base_fsp != NULL) {
+		fsp->base_fsp->fsp_name->base_name = cc->base_fname;
+	}
+
+	cc->busy = busy;
+	CATIA_DEBUG_CC(10, cc, fsp);
+	return cc;
+}
+
+#define CATIA_FETCH_FSP_PRE_NEXT(mem_ctx, handle, fsp, _cc) \
+	catia_fetch_fsp_pre_next((mem_ctx), (handle), (fsp), (_cc), __func__);
+
+static int catia_fetch_fsp_pre_next(TALLOC_CTX *mem_ctx,
+				    vfs_handle_struct *handle,
+				    files_struct *fsp,
+				    struct catia_cache **_cc,
+				    const char *function)
+{
+	const struct catia_cache * const *busy =
+		(const struct catia_cache * const *)_cc;
+	struct catia_cache *cc = NULL;
+	NTSTATUS status;
+	bool make_tmp_cache = false;
+
+	*_cc = NULL;
+
+	DBG_DEBUG("Called from [%s]\n", function);
+
+	cc = catia_validate_and_apply_cc(handle,
+					 fsp,
+					 busy,
+					 &make_tmp_cache);
+	if (cc != NULL) {
+		if (cc->busy != busy) {
+			return 0;
+		}
+		*_cc = cc;
+		return 0;
+	}
+
+	if (!make_tmp_cache) {
+		cc = (struct catia_cache *)VFS_ADD_FSP_EXTENSION(
+			handle, fsp, struct catia_cache, NULL);
+		if (cc == NULL) {
+			return -1;
+		}
+		*cc = (struct catia_cache) {
+			.is_fsp_ext = true,
+		};
+
+		mem_ctx = VFS_MEMCTX_FSP_EXTENSION(handle, fsp);
+		if (mem_ctx == NULL) {
+			DBG_ERR("VFS_MEMCTX_FSP_EXTENSION failed\n");
+			catia_free_cc(&cc, handle, fsp);
+			return -1;
+		}
+	} else {
+		cc = talloc_zero(mem_ctx, struct catia_cache);
+		if (cc == NULL) {
+			return -1;
+		}
+		mem_ctx = cc;
+	}
+
+
+	status = catia_string_replace_allocate(handle->conn,
+					       fsp->fsp_name->base_name,
+					       &cc->fname,
+					       vfs_translate_to_unix);
+	if (!NT_STATUS_IS_OK(status)) {
+		catia_free_cc(&cc, handle, fsp);
+		errno = map_errno_from_nt_status(status);
+		return -1;
+	}
+	talloc_steal(mem_ctx, cc->fname);
+
+	if (fsp->base_fsp != NULL) {
+		status = catia_string_replace_allocate(
+			handle->conn,
+			fsp->base_fsp->fsp_name->base_name,
+			&cc->base_fname,
+			vfs_translate_to_unix);
+		if (!NT_STATUS_IS_OK(status)) {
+			catia_free_cc(&cc, handle, fsp);
+			errno = map_errno_from_nt_status(status);
+			return -1;
+		}
+		talloc_steal(mem_ctx, cc->base_fname);
+	}
+
+	cc->orig_fname = fsp->fsp_name->base_name;
+	fsp->fsp_name->base_name = cc->fname;
+
+	if (fsp->base_fsp != NULL) {
+		cc->orig_base_fname = fsp->base_fsp->fsp_name->base_name;
+		fsp->base_fsp->fsp_name->base_name = cc->base_fname;
+	}
+
+	cc->busy = busy;
+	CATIA_DEBUG_CC(10, cc, fsp);
+
+	*_cc = cc;
+
+	return 0;
+}
+
+#define CATIA_FETCH_FSP_POST_NEXT(_cc, fsp) do { \
+	int saved_errno = errno; \
+	catia_fetch_fsp_post_next((_cc), (fsp), __func__); \
+	errno = saved_errno; \
+} while(0)
+
+static void catia_fetch_fsp_post_next(struct catia_cache **_cc,
+				      files_struct *fsp,
+				      const char *function)
+{
+	const struct catia_cache * const *busy =
+		(const struct catia_cache * const *)_cc;
+	struct catia_cache *cc = *_cc;
+
+	DBG_DEBUG("Called from [%s]\n", function);
+
+	if (cc == NULL) {
+		/*
+		 * This can happen when recursing in the VFS on the fsp when the
+		 * pre_next func noticed the recursion and set out cc pointer to
+		 * NULL.
+		 */
+		return;
+	}
+
+	if (cc->busy != busy) {
+		CATIA_DEBUG_CC(0, cc, fsp);
+		smb_panic(__location__);
+		return;
+	}
+
+	cc->busy = NULL;
+	*_cc = NULL;
+
+	fsp->fsp_name->base_name = cc->orig_fname;
+	if (fsp->base_fsp != NULL) {
+		fsp->base_fsp->fsp_name->base_name = cc->orig_base_fname;
+	}
+
+	CATIA_DEBUG_CC(10, cc, fsp);
+
+	if (!cc->is_fsp_ext) {
+		TALLOC_FREE(cc);
+	}
+
+	return;
+}
+
 static int catia_open(vfs_handle_struct *handle,
 		      struct smb_filename *smb_fname,
 		      files_struct *fsp,
 		      int flags,
 		      mode_t mode)
 {
-	char *name_mapped = NULL;
-	char *tmp_base_name;
-	int ret;
+	struct catia_cache *cc = NULL;
+	char *orig_smb_fname = smb_fname->base_name;
+	char *mapped_smb_fname = NULL;
 	NTSTATUS status;
+	int ret;
 
-	tmp_base_name = smb_fname->base_name;
 	status = catia_string_replace_allocate(handle->conn,
-					smb_fname->base_name,
-					&name_mapped, vfs_translate_to_unix);
+					       smb_fname->base_name,
+					       &mapped_smb_fname,
+					       vfs_translate_to_unix);
 	if (!NT_STATUS_IS_OK(status)) {
-		errno = map_errno_from_nt_status(status);
 		return -1;
 	}
 
-	smb_fname->base_name = name_mapped;
+	ret = CATIA_FETCH_FSP_PRE_NEXT(talloc_tos(), handle, fsp, &cc);
+	if (ret != 0) {
+		TALLOC_FREE(mapped_smb_fname);
+		return ret;
+	}
+
+	smb_fname->base_name = mapped_smb_fname;
 	ret = SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
-	smb_fname->base_name = tmp_base_name;
-	TALLOC_FREE(name_mapped);
+	smb_fname->base_name = orig_smb_fname;
+
+	TALLOC_FREE(mapped_smb_fname);
+	CATIA_FETCH_FSP_POST_NEXT(&cc, fsp);
 
 	return ret;
 }
@@ -1114,33 +1400,1030 @@ catia_setxattr(vfs_handle_struct *handle, const char *path,
 	return ret;
 }
 
-static struct vfs_fn_pointers vfs_catia_fns = {
-	.mkdir_fn = catia_mkdir,
-	.rmdir_fn = catia_rmdir,
-	.opendir_fn = catia_opendir,
-	.open_fn = catia_open,
-	.rename_fn = catia_rename,
-	.stat_fn = catia_stat,
-	.lstat_fn = catia_lstat,
-	.unlink_fn = catia_unlink,
-	.chown_fn = catia_chown,
-	.lchown_fn = catia_lchown,
-	.chmod_fn = catia_chmod,
-	.chdir_fn = catia_chdir,


-- 
Samba Shared Repository



More information about the samba-cvs mailing list