The branch, master has been updated
       via  a475e1c tdb: Use posix_fallocate
       via  a05debc tdb: Add an intermediate variable
       via  c721188 tdb: Truncate the file after expand failure
       via  3e7efbf tdb: Protect against EINTR
       via  ab132ba configure: Centralize check for posix_fallocate
       via  c66b214 tdb: Fix a typo
       via  a6f391b vfs_default: Fix passing of errno from async calls
       via  48815f8 acl_common: Avoid "#include vfs_acl_common.c"
       via  ce8a22d acl_common: Pass store_acl_blob_fsp through store_v3_blob
       via  81a46c0 acl_common: Pass get_acl_blob_fn as a pointer to 
get_nt_acl_internal
      from  531ef64 s3:tests: Add test for changing the local user password 
with smbpasswd

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit a475e1c4b0009987a818faa953d1be3ee9b68894
Author: Volker Lendecke <[email protected]>
Date:   Wed Aug 23 13:02:57 2017 +0200

    tdb: Use posix_fallocate
    
    This should be significantly faster than pwriting.
    
    openbsd doesn't have posix_fallocate, so we do need the fallback. Also, it
    might have weird failure modes, so we keep the old code in place except for
    posix_fallocate returning success or ENOSPC.
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Andrew Bartlett <[email protected]>
    
    Autobuild-User(master): Jeremy Allison <[email protected]>
    Autobuild-Date(master): Thu Aug 24 05:38:49 CEST 2017 on sn-devel-144

commit a05debc113847ca3fd46ea63ec05a3fa357aa8e5
Author: Volker Lendecke <[email protected]>
Date:   Wed Aug 23 12:59:19 2017 +0200

    tdb: Add an intermediate variable
    
    More README.Coding, but I need "ret" in the next commit as well :-)
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Andrew Bartlett <[email protected]>

commit c7211882a79a99ed70a1aceeafa232cd521c915d
Author: Volker Lendecke <[email protected]>
Date:   Wed Aug 23 12:48:03 2017 +0200

    tdb: Truncate the file after expand failure
    
    Without this it's very easy to create virtually huge files: ftruncate 
expands a
    file, the pwrites fail with ENOSPC, thus the write fails. The next writer 
runs
    into the same situation, and ftruncate-expands the file even further. 
tdb_check
    will then spend ages reading the 4GB of zeros byte by byte.
    
    Here we hold the freelist lock or are inside a transaction, so it is safe to
    cut the file again. Nobody can have used the space that we have tried to
    allocate, so we can't have any stray pointers corrupting the database.
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Andrew Bartlett <[email protected]>

commit 3e7efbfb36a54e99bda55a0695b645f6a09e99a3
Author: Volker Lendecke <[email protected]>
Date:   Wed Aug 23 12:00:00 2017 +0200

    tdb: Protect against EINTR
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Andrew Bartlett <[email protected]>

commit ab132ba7e503f489c04945c1b079c3b3523f8888
Author: Volker Lendecke <[email protected]>
Date:   Tue Aug 22 17:09:01 2017 +0200

    configure: Centralize check for posix_fallocate
    
    This checks for posix_fallocate unless we are sitting on an ancient glibc.
    With this we don't need HAVE_BROKEN_POSIX_FALLOCATE anymore,
    HAVE_POSIX_FALLOCATE will only be defined if we have a valid [g]libc.
    
    ./configure tested on Debian, FreeBSD (which does have posix_fallocate) and
    OpenBSD (which does not have posix_fallocate). Also tested with changing the
    not have an old-enough glibc around. All did the right thing.
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Andrew Bartlett <[email protected]>

commit c66b21453726060a7d9ae4b34c94e84a692a3941
Author: Volker Lendecke <[email protected]>
Date:   Tue Aug 22 14:51:18 2017 +0200

    tdb: Fix a typo
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Andrew Bartlett <[email protected]>

commit a6f391b8dd1fbfd1a370667dec1374284984c341
Author: Christof Schmitt <[email protected]>
Date:   Wed Aug 23 14:37:28 2017 -0700

    vfs_default: Fix passing of errno from async calls
    
    Current code assigns errno from async pthreadpool calls to the
    vfs_default internal vfswrap_*_state.  The callers of the vfs_*_recv
    functions expect the value from errno in vfs_aio_state.error.
    
    Correctly assign errno to vfs_aio_state.error and remove the unused
    internal err variable.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12983
    
    Signed-off-by: Christof Schmitt <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit 48815f8c3ed54edc418018b991c222e317302602
Author: Volker Lendecke <[email protected]>
Date:   Fri Aug 18 14:41:57 2017 +0200

    acl_common: Avoid "#include vfs_acl_common.c"
    
    This makes vfs_acl_common.c a subsystem of its own that acl_xattr and 
acl_tdb
    now link against, not #include it.
    
    This patch is a bit on the large and clumsy side, but splitting it up would
    (I believe) involve a separate intermediate copy of acl_common.c.
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit ce8a22d2963a989a9a0cf730c15a8f3cb6f0c3d7
Author: Volker Lendecke <[email protected]>
Date:   Fri Aug 18 13:52:31 2017 +0200

    acl_common: Pass store_acl_blob_fsp through store_v3_blob
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

commit 81a46c0abfc6bbcbea0e417611a3984452e180b8
Author: Volker Lendecke <[email protected]>
Date:   Fri Aug 18 13:46:14 2017 +0200

    acl_common: Pass get_acl_blob_fn as a pointer to get_nt_acl_internal
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Jeremy Allison <[email protected]>

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

Summary of changes:
 lib/replace/wscript              |  12 ++++
 lib/tdb/common/io.c              | 103 +++++++++++++++++++++++++--
 lib/tdb/common/transaction.c     |   2 +-
 source3/lib/system.c             |   2 +-
 source3/modules/vfs_acl_common.c | 145 +++++++++++++++++----------------------
 source3/modules/vfs_acl_common.h |  79 +++++++++++++++++++++
 source3/modules/vfs_acl_tdb.c    |  47 +++++++++++--
 source3/modules/vfs_acl_xattr.c  |  52 +++++++++++---
 source3/modules/vfs_default.c    |  15 ++--
 source3/modules/wscript_build    |   7 +-
 source3/wscript                  |  17 +----
 source3/wscript_build            |   1 +
 12 files changed, 353 insertions(+), 129 deletions(-)
 create mode 100644 source3/modules/vfs_acl_common.h


Changeset truncated at 500 lines:

diff --git a/lib/replace/wscript b/lib/replace/wscript
index 7c50e1d..6972f2d 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -249,6 +249,18 @@ def configure(conf):
     if conf.CONFIG_SET('HAVE_MEMALIGN'):
         conf.CHECK_DECLS('memalign', headers='malloc.h')
 
+    # glibc up to 2.3.6 had dangerously broken posix_fallocate(). DON'T USE IT.
+    if conf.CHECK_CODE('''
+#define _XOPEN_SOURCE 600
+#include <stdlib.h>
+#if defined(__GLIBC__) && ((__GLIBC__ < 2) || (__GLIBC__ == 2 && 
__GLIBC_MINOR__ < 4))
+#error probably broken posix_fallocate
+#endif
+''',
+                       '_POSIX_FALLOCATE_CAPABLE_LIBC',
+                       msg='Checking for posix_fallocate-capable libc'):
+        conf.CHECK_FUNCS('posix_fallocate')
+
     conf.CHECK_FUNCS('prctl dirname basename')
 
     # libbsd on some platforms provides strlcpy and strlcat
diff --git a/lib/tdb/common/io.c b/lib/tdb/common/io.c
index fe47d18..15ba5b7 100644
--- a/lib/tdb/common/io.c
+++ b/lib/tdb/common/io.c
@@ -52,29 +52,68 @@ static bool tdb_adjust_offset(struct tdb_context *tdb, 
off_t *off)
 static ssize_t tdb_pwrite(struct tdb_context *tdb, const void *buf,
                          size_t count, off_t offset)
 {
+       ssize_t ret;
+
        if (!tdb_adjust_offset(tdb, &offset)) {
                return -1;
        }
-       return pwrite(tdb->fd, buf, count, offset);
+
+       do {
+               ret = pwrite(tdb->fd, buf, count, offset);
+       } while ((ret == -1) && (errno == EINTR));
+
+       return ret;
 }
 
 static ssize_t tdb_pread(struct tdb_context *tdb, void *buf,
                         size_t count, off_t offset)
 {
+       ssize_t ret;
+
        if (!tdb_adjust_offset(tdb, &offset)) {
                return -1;
        }
-       return pread(tdb->fd, buf, count, offset);
+
+       do {
+               ret = pread(tdb->fd, buf, count, offset);
+       } while ((ret == -1) && (errno == EINTR));
+
+       return ret;
 }
 
 static int tdb_ftruncate(struct tdb_context *tdb, off_t length)
 {
+       ssize_t ret;
+
        if (!tdb_adjust_offset(tdb, &length)) {
                return -1;
        }
-       return ftruncate(tdb->fd, length);
+
+       do {
+               ret = ftruncate(tdb->fd, length);
+       } while ((ret == -1) && (errno == EINTR));
+
+       return ret;
 }
 
+#if HAVE_POSIX_FALLOCATE
+static int tdb_posix_fallocate(struct tdb_context *tdb, off_t offset,
+                              off_t len)
+{
+       ssize_t ret;
+
+       if (!tdb_adjust_offset(tdb, &offset)) {
+               return -1;
+       }
+
+       do {
+               ret = posix_fallocate(tdb->fd, offset, len);
+       } while ((ret == -1) && (errno == EINTR));
+
+       return ret;
+}
+#endif
+
 static int tdb_fstat(struct tdb_context *tdb, struct stat *buf)
 {
        int ret;
@@ -358,6 +397,7 @@ static int tdb_expand_file(struct tdb_context *tdb, 
tdb_off_t size, tdb_off_t ad
 {
        char buf[8192];
        tdb_off_t new_size;
+       int ret;
 
        if (tdb->read_only || tdb->traverse_read) {
                tdb->ecode = TDB_ERR_RDONLY;
@@ -373,7 +413,36 @@ static int tdb_expand_file(struct tdb_context *tdb, 
tdb_off_t size, tdb_off_t ad
                return -1;
        }
 
-       if (tdb_ftruncate(tdb, new_size) == -1) {
+#if HAVE_POSIX_FALLOCATE
+       ret = tdb_posix_fallocate(tdb, size, addition);
+       if (ret == 0) {
+               return 0;
+       }
+       if (ret == ENOSPC) {
+               /*
+                * The Linux glibc (at least as of 2.24) fallback if
+                * the file system does not support fallocate does not
+                * reset the file size back to where it was. Also, to
+                * me it is unclear from the posix spec of
+                * posix_fallocate whether this is allowed or
+                * not. Better be safe than sorry and "goto fail" but
+                * "return -1" here, leaving the EOF pointer too
+                * large.
+                */
+               goto fail;
+       }
+
+       /*
+        * Retry the "old" way. Possibly unnecessary, but looking at
+        * our configure script there seem to be weird failure modes
+        * for posix_fallocate. See commit 3264a98ff16de, which
+        * probably refers to
+        * https://sourceware.org/bugzilla/show_bug.cgi?id=1083.
+        */
+#endif
+
+       ret = tdb_ftruncate(tdb, new_size);
+       if (ret == -1) {
                char b = 0;
                ssize_t written = tdb_pwrite(tdb, &b, 1, new_size - 1);
                if (written == 0) {
@@ -409,14 +478,14 @@ static int tdb_expand_file(struct tdb_context *tdb, 
tdb_off_t size, tdb_off_t ad
                        TDB_LOG((tdb, TDB_DEBUG_FATAL, "expand_file write "
                                "returned 0 twice: giving up!\n"));
                        errno = ENOSPC;
-                       return -1;
+                       goto fail;
                }
                if (written == -1) {
                        tdb->ecode = TDB_ERR_OOM;
                        TDB_LOG((tdb, TDB_DEBUG_FATAL, "expand_file write of "
                                 "%u bytes failed (%s)\n", (int)n,
                                 strerror(errno)));
-                       return -1;
+                       goto fail;
                }
                if (written != n) {
                        TDB_LOG((tdb, TDB_DEBUG_WARNING, "expand_file: wrote "
@@ -427,6 +496,28 @@ static int tdb_expand_file(struct tdb_context *tdb, 
tdb_off_t size, tdb_off_t ad
                size += written;
        }
        return 0;
+
+fail:
+       {
+               int err = errno;
+
+               /*
+                * We're holding the freelist lock or are inside a
+                * transaction. Cutting the file is safe, the space we
+                * tried to allocate can't have been used anywhere in
+                * the meantime.
+                */
+
+               ret = tdb_ftruncate(tdb, size);
+               if (ret == -1) {
+                       TDB_LOG((tdb, TDB_DEBUG_WARNING, "expand_file: "
+                                "retruncate to %ju failed\n",
+                                (uintmax_t)size));
+               }
+               errno = err;
+       }
+
+       return -1;
 }
 
 
diff --git a/lib/tdb/common/transaction.c b/lib/tdb/common/transaction.c
index 8ec0025..7d281fc 100644
--- a/lib/tdb/common/transaction.c
+++ b/lib/tdb/common/transaction.c
@@ -43,7 +43,7 @@
     tdb_free() the old record to place it on the normal tdb freelist
     before allocating the new record
 
-  - during transactions, keep a linked list of writes all that have
+  - during transactions, keep a linked list of all writes that have
     been performed by intercepting all tdb_write() calls. The hooked
     transaction versions of tdb_read() and tdb_write() check this
     linked list and try to use the elements of the list in preference
diff --git a/source3/lib/system.c b/source3/lib/system.c
index 99462b6..70ddf6a 100644
--- a/source3/lib/system.c
+++ b/source3/lib/system.c
@@ -438,7 +438,7 @@ int sys_lstat(const char *fname,SMB_STRUCT_STAT *sbuf,
 ********************************************************************/
 int sys_posix_fallocate(int fd, off_t offset, off_t len)
 {
-#if defined(HAVE_POSIX_FALLOCATE) && !defined(HAVE_BROKEN_POSIX_FALLOCATE)
+#if defined(HAVE_POSIX_FALLOCATE)
        return posix_fallocate(fd, offset, len);
 #elif defined(F_RESVSP64)
        /* this handles XFS on IRIX */
diff --git a/source3/modules/vfs_acl_common.c b/source3/modules/vfs_acl_common.c
index 6abf1e3..c4849b6 100644
--- a/source3/modules/vfs_acl_common.c
+++ b/source3/modules/vfs_acl_common.c
@@ -20,11 +20,15 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "includes.h"
+#include "vfs_acl_common.h"
 #include "smbd/smbd.h"
 #include "system/filesys.h"
+#include "librpc/gen_ndr/ndr_xattr.h"
 #include "../libcli/security/security.h"
 #include "../librpc/gen_ndr/ndr_security.h"
 #include "../lib/util/bitmap.h"
+#include "lib/crypto/sha256.h"
 #include "passdb/lookup_sid.h"
 
 static NTSTATUS create_acl_blob(const struct security_descriptor *psd,
@@ -32,34 +36,18 @@ static NTSTATUS create_acl_blob(const struct 
security_descriptor *psd,
                        uint16_t hash_type,
                        uint8_t hash[XATTR_SD_HASH_SIZE]);
 
-static NTSTATUS get_acl_blob(TALLOC_CTX *ctx,
-                       vfs_handle_struct *handle,
-                       files_struct *fsp,
-                       const struct smb_filename *smb_fname,
-                       DATA_BLOB *pblob);
-
-static NTSTATUS store_acl_blob_fsp(vfs_handle_struct *handle,
-                       files_struct *fsp,
-                       DATA_BLOB *pblob);
-
 #define HASH_SECURITY_INFO (SECINFO_OWNER | \
                                SECINFO_GROUP | \
                                SECINFO_DACL | \
                                SECINFO_SACL)
 
-enum default_acl_style {DEFAULT_ACL_POSIX, DEFAULT_ACL_WINDOWS};
-
 static const struct enum_list default_acl_style[] = {
        {DEFAULT_ACL_POSIX,     "posix"},
        {DEFAULT_ACL_WINDOWS,   "windows"}
 };
 
-struct acl_common_config {
-       bool ignore_system_acls;
-       enum default_acl_style default_acl_style;
-};
-
-static bool init_acl_common_config(vfs_handle_struct *handle)
+bool init_acl_common_config(vfs_handle_struct *handle,
+                           const char *module_name)
 {
        struct acl_common_config *config = NULL;
 
@@ -71,11 +59,11 @@ static bool init_acl_common_config(vfs_handle_struct 
*handle)
        }
 
        config->ignore_system_acls = lp_parm_bool(SNUM(handle->conn),
-                                                 ACL_MODULE_NAME,
+                                                 module_name,
                                                  "ignore system acls",
                                                  false);
        config->default_acl_style = lp_parm_enum(SNUM(handle->conn),
-                                                ACL_MODULE_NAME,
+                                                module_name,
                                                 "default acl style",
                                                 default_acl_style,
                                                 DEFAULT_ACL_POSIX);
@@ -854,12 +842,18 @@ static NTSTATUS stat_fsp_or_smb_fname(vfs_handle_struct 
*handle,
  filesystem sd.
 *******************************************************************/
 
-static NTSTATUS get_nt_acl_internal(vfs_handle_struct *handle,
+NTSTATUS get_nt_acl_common(
+       NTSTATUS (*get_acl_blob_fn)(TALLOC_CTX *ctx,
+                                   vfs_handle_struct *handle,
                                    files_struct *fsp,
-                                   const struct smb_filename *smb_fname_in,
-                                   uint32_t security_info,
-                                   TALLOC_CTX *mem_ctx,
-                                   struct security_descriptor **ppdesc)
+                                   const struct smb_filename *smb_fname,
+                                   DATA_BLOB *pblob),
+       vfs_handle_struct *handle,
+       files_struct *fsp,
+       const struct smb_filename *smb_fname_in,
+       uint32_t security_info,
+       TALLOC_CTX *mem_ctx,
+       struct security_descriptor **ppdesc)
 {
        DATA_BLOB blob = data_blob_null;
        NTSTATUS status;
@@ -880,7 +874,7 @@ static NTSTATUS get_nt_acl_internal(vfs_handle_struct 
*handle,
 
        DBG_DEBUG("name=%s\n", smb_fname->base_name);
 
-       status = get_acl_blob(mem_ctx, handle, fsp, smb_fname, &blob);
+       status = get_acl_blob_fn(mem_ctx, handle, fsp, smb_fname, &blob);
        if (NT_STATUS_IS_OK(status)) {
                status = validate_nt_acl_blob(mem_ctx,
                                              handle,
@@ -1017,38 +1011,6 @@ fail:
 }
 
 /*********************************************************************
- Fetch a security descriptor given an fsp.
-*********************************************************************/
-
-static NTSTATUS fget_nt_acl_common(vfs_handle_struct *handle,
-                                  files_struct *fsp,
-                                  uint32_t security_info,
-                                  TALLOC_CTX *mem_ctx,
-                                  struct security_descriptor **ppdesc)
-{
-       return get_nt_acl_internal(handle, fsp,
-                                  NULL, security_info, mem_ctx, ppdesc);
-}
-
-/*********************************************************************
- Fetch a security descriptor given a pathname.
-*********************************************************************/
-
-static NTSTATUS get_nt_acl_common(vfs_handle_struct *handle,
-                                 const struct smb_filename *smb_fname,
-                                 uint32_t security_info,
-                                 TALLOC_CTX *mem_ctx,
-                                 struct security_descriptor **ppdesc)
-{
-       return get_nt_acl_internal(handle,
-                               NULL,
-                               smb_fname,
-                               security_info,
-                               mem_ctx,
-                               ppdesc);
-}
-
-/*********************************************************************
  Set the underlying ACL (e.g. POSIX ACLS, POSIX owner, etc)
 *********************************************************************/
 static NTSTATUS set_underlying_acl(vfs_handle_struct *handle, files_struct 
*fsp,
@@ -1085,10 +1047,14 @@ static NTSTATUS set_underlying_acl(vfs_handle_struct 
*handle, files_struct *fsp,
 /*********************************************************************
  Store a v3 security descriptor
 *********************************************************************/
-static NTSTATUS store_v3_blob(vfs_handle_struct *handle, files_struct *fsp,
-                             struct security_descriptor *psd,
-                             struct security_descriptor *pdesc_next,
-                             uint8_t hash[XATTR_SD_HASH_SIZE])
+static NTSTATUS store_v3_blob(
+       NTSTATUS (*store_acl_blob_fsp_fn)(vfs_handle_struct *handle,
+                                         files_struct *fsp,
+                                         DATA_BLOB *pblob),
+       vfs_handle_struct *handle, files_struct *fsp,
+       struct security_descriptor *psd,
+       struct security_descriptor *pdesc_next,
+       uint8_t hash[XATTR_SD_HASH_SIZE])
 {
        NTSTATUS status;
        DATA_BLOB blob;
@@ -1116,7 +1082,7 @@ static NTSTATUS store_v3_blob(vfs_handle_struct *handle, 
files_struct *fsp,
                return status;
        }
 
-       status = store_acl_blob_fsp(handle, fsp, &blob);
+       status = store_acl_blob_fsp_fn(handle, fsp, &blob);
        return status;
 }
 
@@ -1124,8 +1090,19 @@ static NTSTATUS store_v3_blob(vfs_handle_struct *handle, 
files_struct *fsp,
  Store a security descriptor given an fsp.
 *********************************************************************/
 
-static NTSTATUS fset_nt_acl_common(vfs_handle_struct *handle, files_struct 
*fsp,
-        uint32_t security_info_sent, const struct security_descriptor 
*orig_psd)
+NTSTATUS fset_nt_acl_common(
+       NTSTATUS (*get_acl_blob_fn)(TALLOC_CTX *ctx,
+                                   vfs_handle_struct *handle,
+                                   files_struct *fsp,
+                                   const struct smb_filename *smb_fname,
+                                   DATA_BLOB *pblob),
+       NTSTATUS (*store_acl_blob_fsp_fn)(vfs_handle_struct *handle,
+                                         files_struct *fsp,
+                                         DATA_BLOB *pblob),
+       const char *module_name,
+       vfs_handle_struct *handle, files_struct *fsp,
+       uint32_t security_info_sent,
+       const struct security_descriptor *orig_psd)
 {
        NTSTATUS status;
        int ret;
@@ -1138,7 +1115,7 @@ static NTSTATUS fset_nt_acl_common(vfs_handle_struct 
*handle, files_struct *fsp,
        char *sys_acl_description;
        TALLOC_CTX *frame = talloc_stackframe();
        bool ignore_file_system_acl = lp_parm_bool(
-           SNUM(handle->conn), ACL_MODULE_NAME, "ignore system acls", false);
+           SNUM(handle->conn), module_name, "ignore system acls", false);
 
        if (DEBUGLEVEL >= 10) {
                DBG_DEBUG("incoming sd for file %s\n", fsp_str_dbg(fsp));
@@ -1146,7 +1123,7 @@ static NTSTATUS fset_nt_acl_common(vfs_handle_struct 
*handle, files_struct *fsp,
                        discard_const_p(struct security_descriptor, orig_psd));
        }
 
-       status = get_nt_acl_internal(handle, fsp,
+       status = get_nt_acl_common(get_acl_blob_fn, handle, fsp,
                        NULL,
                        SECINFO_OWNER|SECINFO_GROUP|SECINFO_DACL|SECINFO_SACL,
                                     frame,
@@ -1205,7 +1182,8 @@ static NTSTATUS fset_nt_acl_common(vfs_handle_struct 
*handle, files_struct *fsp,
                        }
                }
                ZERO_ARRAY(hash);
-               status = store_v3_blob(handle, fsp, psd, NULL, hash);
+               status = store_v3_blob(store_acl_blob_fsp_fn, handle, fsp, psd,
+                                      NULL, hash);
 
                TALLOC_FREE(frame);
                return status;
@@ -1246,7 +1224,8 @@ static NTSTATUS fset_nt_acl_common(vfs_handle_struct 
*handle, files_struct *fsp,
        /* If we fail to get the ACL blob (for some reason) then this
         * is not fatal, we just work based on the NT ACL only */
        if (ret != 0) {
-               status = store_v3_blob(handle, fsp, psd, pdesc_next, hash);
+               status = store_v3_blob(store_acl_blob_fsp_fn, handle, fsp, psd,
+                                      pdesc_next, hash);
 
                TALLOC_FREE(frame);
                return status;
@@ -1281,7 +1260,7 @@ static NTSTATUS fset_nt_acl_common(vfs_handle_struct 
*handle, files_struct *fsp,
                return status;
        }
 
-       status = store_acl_blob_fsp(handle, fsp, &blob);
+       status = store_acl_blob_fsp_fn(handle, fsp, &blob);
 
        TALLOC_FREE(frame);
        return status;
@@ -1382,8 +1361,8 @@ static int acl_common_remove_object(vfs_handle_struct 
*handle,
        return ret;
 }
 
-static int rmdir_acl_common(struct vfs_handle_struct *handle,
-                               const struct smb_filename *smb_fname)
+int rmdir_acl_common(struct vfs_handle_struct *handle,
+                    const struct smb_filename *smb_fname)
 {
        int ret;
 
@@ -1406,7 +1385,7 @@ static int rmdir_acl_common(struct vfs_handle_struct 
*handle,
        return -1;
 }
 
-static int unlink_acl_common(struct vfs_handle_struct *handle,
+int unlink_acl_common(struct vfs_handle_struct *handle,
                        const struct smb_filename *smb_fname)
 {
        int ret;
@@ -1435,9 +1414,9 @@ static int unlink_acl_common(struct vfs_handle_struct 
*handle,
        return -1;
 }
 
-static int chmod_acl_module_common(struct vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname,
-                       mode_t mode)
+int chmod_acl_module_common(struct vfs_handle_struct *handle,
+                           const struct smb_filename *smb_fname,
+                           mode_t mode)
 {
        if (smb_fname->flags & SMB_FILENAME_POSIX_PATH) {
                /* Only allow this on POSIX pathnames. */
@@ -1446,8 +1425,8 @@ static int chmod_acl_module_common(struct 
vfs_handle_struct *handle,
        return 0;
 }
 
-static int fchmod_acl_module_common(struct vfs_handle_struct *handle,
-                       struct files_struct *fsp, mode_t mode)
+int fchmod_acl_module_common(struct vfs_handle_struct *handle,
+                            struct files_struct *fsp, mode_t mode)
 {
        if (fsp->posix_flags & FSP_POSIX_FLAGS_OPEN) {


-- 
Samba Shared Repository

Reply via email to