summaryrefslogtreecommitdiff
path: root/source3/modules
diff options
context:
space:
mode:
Diffstat (limited to 'source3/modules')
-rw-r--r--source3/modules/posixacl_xattr.c20
-rw-r--r--source3/modules/posixacl_xattr.h2
-rw-r--r--source3/modules/vfs_aixacl.c3
-rw-r--r--source3/modules/vfs_aixacl2.c9
-rw-r--r--source3/modules/vfs_cap.c32
-rw-r--r--source3/modules/vfs_catia.c36
-rw-r--r--source3/modules/vfs_default.c6
-rw-r--r--source3/modules/vfs_fake_acls.c7
-rw-r--r--source3/modules/vfs_full_audit.c11
-rw-r--r--source3/modules/vfs_gpfs.c6
-rw-r--r--source3/modules/vfs_hpuxacl.c7
-rw-r--r--source3/modules/vfs_hpuxacl.h2
-rw-r--r--source3/modules/vfs_media_harmony.c34
-rw-r--r--source3/modules/vfs_nfs4acl_xattr.c6
-rw-r--r--source3/modules/vfs_posixacl.c8
-rw-r--r--source3/modules/vfs_posixacl.h2
-rw-r--r--source3/modules/vfs_solarisacl.c6
-rw-r--r--source3/modules/vfs_solarisacl.h6
-rw-r--r--source3/modules/vfs_time_audit.c12
-rw-r--r--source3/modules/vfs_tru64acl.c8
-rw-r--r--source3/modules/vfs_tru64acl.h4
-rw-r--r--source3/modules/vfs_unityed_media.c32
-rw-r--r--source3/modules/vfs_vxfs.c15
-rw-r--r--source3/modules/vfs_zfsacl.c6
24 files changed, 173 insertions, 107 deletions
diff --git a/source3/modules/posixacl_xattr.c b/source3/modules/posixacl_xattr.c
index 871aa669f1a..ded16a0bfba 100644
--- a/source3/modules/posixacl_xattr.c
+++ b/source3/modules/posixacl_xattr.c
@@ -336,7 +336,7 @@ static int smb_acl_to_posixacl_xattr(SMB_ACL_T theacl, char *buf, size_t len)
}
SMB_ACL_T posixacl_xattr_acl_get_file(vfs_handle_struct *handle,
- const char *path_p,
+ const struct smb_filename *smb_fname,
SMB_ACL_TYPE_T type,
TALLOC_CTX *mem_ctx)
{
@@ -360,16 +360,18 @@ SMB_ACL_T posixacl_xattr_acl_get_file(vfs_handle_struct *handle,
return NULL;
}
- ret = SMB_VFS_GETXATTR(handle->conn, path_p, name, buf, size);
+ ret = SMB_VFS_GETXATTR(handle->conn, smb_fname->base_name,
+ name, buf, size);
if (ret < 0 && errno == ERANGE) {
- size = SMB_VFS_GETXATTR(handle->conn, path_p, name,
- NULL, 0);
+ size = SMB_VFS_GETXATTR(handle->conn, smb_fname->base_name,
+ name, NULL, 0);
if (size > 0) {
buf = alloca(size);
if (!buf) {
return NULL;
}
- ret = SMB_VFS_GETXATTR(handle->conn, path_p, name,
+ ret = SMB_VFS_GETXATTR(handle->conn,
+ smb_fname->base_name, name,
buf, size);
}
}
@@ -380,15 +382,15 @@ SMB_ACL_T posixacl_xattr_acl_get_file(vfs_handle_struct *handle,
if (ret == 0 || errno == ENOATTR || errno == ENODATA) {
mode_t mode = 0;
TALLOC_CTX *frame = talloc_stackframe();
- struct smb_filename *smb_fname =
- synthetic_smb_fname(frame, path_p, NULL, NULL, 0);
+ struct smb_filename *smb_fname_tmp =
+ cp_smb_filename_nostream(frame, smb_fname);
if (smb_fname == NULL) {
errno = ENOMEM;
ret = -1;
} else {
- ret = SMB_VFS_STAT(handle->conn, smb_fname);
+ ret = SMB_VFS_STAT(handle->conn, smb_fname_tmp);
if (ret == 0) {
- mode = smb_fname->st.st_ex_mode;
+ mode = smb_fname_tmp->st.st_ex_mode;
}
}
TALLOC_FREE(frame);
diff --git a/source3/modules/posixacl_xattr.h b/source3/modules/posixacl_xattr.h
index 6f6316ae453..8751692f571 100644
--- a/source3/modules/posixacl_xattr.h
+++ b/source3/modules/posixacl_xattr.h
@@ -22,7 +22,7 @@
#define __POSIXACL_XATTR_H__
SMB_ACL_T posixacl_xattr_acl_get_file(vfs_handle_struct *handle,
- const char *path_p,
+ const struct smb_filename *smb_fname,
SMB_ACL_TYPE_T type,
TALLOC_CTX *mem_ctx);
diff --git a/source3/modules/vfs_aixacl.c b/source3/modules/vfs_aixacl.c
index c25c249a6f5..024c9aa2691 100644
--- a/source3/modules/vfs_aixacl.c
+++ b/source3/modules/vfs_aixacl.c
@@ -23,10 +23,11 @@
#include "vfs_aixacl_util.h"
SMB_ACL_T aixacl_sys_acl_get_file(vfs_handle_struct *handle,
- const char *path_p,
+ const struct smb_filename *smb_fname,
SMB_ACL_TYPE_T type,
TALLOC_CTX *mem_ctx)
{
+ const char *path_p = smb_fname->base_name;
struct acl *file_acl = (struct acl *)NULL;
struct smb_acl_t *result = (struct smb_acl_t *)NULL;
diff --git a/source3/modules/vfs_aixacl2.c b/source3/modules/vfs_aixacl2.c
index e46e5026215..de5b333423b 100644
--- a/source3/modules/vfs_aixacl2.c
+++ b/source3/modules/vfs_aixacl2.c
@@ -291,9 +291,9 @@ static SMB_ACL_T aixjfs2_get_posix_acl(const char *path, acl_type_t type, TALLOC
}
SMB_ACL_T aixjfs2_sys_acl_get_file(vfs_handle_struct *handle,
- const char *path_p,
- SMB_ACL_TYPE_T type,
- TALLOC_CTX *mem_ctx)
+ const struct smb_filename *smb_fname,
+ SMB_ACL_TYPE_T type,
+ TALLOC_CTX *mem_ctx)
{
acl_type_t aixjfs2_type;
@@ -309,7 +309,8 @@ SMB_ACL_T aixjfs2_sys_acl_get_file(vfs_handle_struct *handle,
smb_panic("exiting");
}
- return aixjfs2_get_posix_acl(path_p, aixjfs2_type, mem_ctx);
+ return aixjfs2_get_posix_acl(smb_fname->base_name,
+ aixjfs2_type, mem_ctx);
}
SMB_ACL_T aixjfs2_sys_acl_get_fd(vfs_handle_struct *handle,
diff --git a/source3/modules/vfs_cap.c b/source3/modules/vfs_cap.c
index 41799262675..8aba4314fcb 100644
--- a/source3/modules/vfs_cap.c
+++ b/source3/modules/vfs_cap.c
@@ -545,16 +545,40 @@ static int cap_chmod_acl(vfs_handle_struct *handle,
}
static SMB_ACL_T cap_sys_acl_get_file(vfs_handle_struct *handle,
- const char *path, SMB_ACL_TYPE_T type,
- TALLOC_CTX *mem_ctx)
+ const struct smb_filename *smb_fname,
+ SMB_ACL_TYPE_T type,
+ TALLOC_CTX *mem_ctx)
{
- char *cappath = capencode(talloc_tos(), path);
+ struct smb_filename *cap_smb_fname = NULL;
+ char *cappath = capencode(talloc_tos(), smb_fname->base_name);
+ SMB_ACL_T ret;
+ int saved_errno = 0;
if (!cappath) {
errno = ENOMEM;
return (SMB_ACL_T)NULL;
}
- return SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, cappath, type, mem_ctx);
+ cap_smb_fname = synthetic_smb_fname(talloc_tos(),
+ cappath,
+ NULL,
+ NULL,
+ smb_fname->flags);
+ if (cap_smb_fname == NULL) {
+ TALLOC_FREE(cappath);
+ errno = ENOMEM;
+ return (SMB_ACL_T)NULL;
+ }
+ ret = SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, cap_smb_fname,
+ type, mem_ctx);
+ if (ret == NULL) {
+ saved_errno = errno;
+ }
+ TALLOC_FREE(cappath);
+ TALLOC_FREE(cap_smb_fname);
+ if (saved_errno != 0) {
+ errno = saved_errno;
+ }
+ return ret;
}
static int cap_sys_acl_set_file(vfs_handle_struct *handle, const char *path, SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl)
diff --git a/source3/modules/vfs_catia.c b/source3/modules/vfs_catia.c
index 7ed531ac0a3..18dbc80cd87 100644
--- a/source3/modules/vfs_catia.c
+++ b/source3/modules/vfs_catia.c
@@ -1246,24 +1246,46 @@ catia_chmod_acl(vfs_handle_struct *handle,
static SMB_ACL_T
catia_sys_acl_get_file(vfs_handle_struct *handle,
- const char *path,
- SMB_ACL_TYPE_T type,
- TALLOC_CTX *mem_ctx)
+ const struct smb_filename *smb_fname,
+ SMB_ACL_TYPE_T type,
+ TALLOC_CTX *mem_ctx)
{
char *mapped_name = NULL;
+ struct smb_filename *mapped_smb_fname = NULL;
NTSTATUS status;
SMB_ACL_T ret;
+ int saved_errno = 0;
status = catia_string_replace_allocate(handle->conn,
- path, &mapped_name, vfs_translate_to_unix);
+ smb_fname->base_name,
+ &mapped_name,
+ vfs_translate_to_unix);
if (!NT_STATUS_IS_OK(status)) {
errno = map_errno_from_nt_status(status);
- return NULL;
+ return (SMB_ACL_T)NULL;
}
- ret = SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, mapped_name, type, mem_ctx);
- TALLOC_FREE(mapped_name);
+ mapped_smb_fname = synthetic_smb_fname(talloc_tos(),
+ mapped_name,
+ NULL,
+ NULL,
+ smb_fname->flags);
+ if (mapped_smb_fname == NULL) {
+ TALLOC_FREE(mapped_name);
+ errno = ENOMEM;
+ return (SMB_ACL_T)NULL;
+ }
+ ret = SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, mapped_smb_fname,
+ type, mem_ctx);
+ if (ret == (SMB_ACL_T)NULL) {
+ saved_errno = errno;
+ }
+ TALLOC_FREE(mapped_smb_fname);
+ TALLOC_FREE(mapped_name);
+ if (saved_errno != 0) {
+ errno = saved_errno;
+ }
return ret;
}
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 19b6925a3a4..c3de3d7572d 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -2688,7 +2688,7 @@ static int vfswrap_chmod_acl(vfs_handle_struct *handle,
int result;
START_PROFILE(chmod_acl);
- result = chmod_acl(handle->conn, smb_fname->base_name, mode);
+ result = chmod_acl(handle->conn, smb_fname, mode);
END_PROFILE(chmod_acl);
return result;
#endif
@@ -2710,11 +2710,11 @@ static int vfswrap_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, mode
}
static SMB_ACL_T vfswrap_sys_acl_get_file(vfs_handle_struct *handle,
- const char *path_p,
+ const struct smb_filename *smb_fname,
SMB_ACL_TYPE_T type,
TALLOC_CTX *mem_ctx)
{
- return sys_acl_get_file(handle, path_p, type, mem_ctx);
+ return sys_acl_get_file(handle, smb_fname, type, mem_ctx);
}
static SMB_ACL_T vfswrap_sys_acl_get_fd(vfs_handle_struct *handle,
diff --git a/source3/modules/vfs_fake_acls.c b/source3/modules/vfs_fake_acls.c
index fae8014f78e..cb8d12395cc 100644
--- a/source3/modules/vfs_fake_acls.c
+++ b/source3/modules/vfs_fake_acls.c
@@ -242,14 +242,15 @@ static DATA_BLOB fake_acls_acl2blob(TALLOC_CTX *mem_ctx, SMB_ACL_T acl)
}
static SMB_ACL_T fake_acls_sys_acl_get_file(struct vfs_handle_struct *handle,
- const char *path,
- SMB_ACL_TYPE_T type,
- TALLOC_CTX *mem_ctx)
+ const struct smb_filename *smb_fname,
+ SMB_ACL_TYPE_T type,
+ TALLOC_CTX *mem_ctx)
{
DATA_BLOB blob = data_blob_null;
ssize_t length;
const char *name = NULL;
struct smb_acl_t *acl = NULL;
+ const char *path = smb_fname->base_name;
TALLOC_CTX *frame = talloc_stackframe();
switch (type) {
case SMB_ACL_TYPE_ACCESS:
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index e6ee5770afe..932dbf803a6 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -2152,16 +2152,17 @@ static int smb_full_audit_fchmod_acl(vfs_handle_struct *handle, files_struct *fs
}
static SMB_ACL_T smb_full_audit_sys_acl_get_file(vfs_handle_struct *handle,
- const char *path_p,
- SMB_ACL_TYPE_T type,
- TALLOC_CTX *mem_ctx)
+ const struct smb_filename *smb_fname,
+ SMB_ACL_TYPE_T type,
+ TALLOC_CTX *mem_ctx)
{
SMB_ACL_T result;
- result = SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, path_p, type, mem_ctx);
+ result = SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, smb_fname,
+ type, mem_ctx);
do_log(SMB_VFS_OP_SYS_ACL_GET_FILE, (result != NULL), handle,
- "%s", path_p);
+ "%s", smb_fname->base_name);
return result;
}
diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c
index fa2664e8d07..37568ab6efe 100644
--- a/source3/modules/vfs_gpfs.c
+++ b/source3/modules/vfs_gpfs.c
@@ -961,7 +961,7 @@ static SMB_ACL_T gpfsacl_get_posix_acl(const char *path, gpfs_aclType_t type,
}
static SMB_ACL_T gpfsacl_sys_acl_get_file(vfs_handle_struct *handle,
- const char *path_p,
+ const struct smb_filename *smb_fname,
SMB_ACL_TYPE_T type,
TALLOC_CTX *mem_ctx)
{
@@ -973,7 +973,7 @@ static SMB_ACL_T gpfsacl_sys_acl_get_file(vfs_handle_struct *handle,
return NULL);
if (!config->acl) {
- return SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, path_p,
+ return SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, smb_fname,
type, mem_ctx);
}
@@ -989,7 +989,7 @@ static SMB_ACL_T gpfsacl_sys_acl_get_file(vfs_handle_struct *handle,
smb_panic("exiting");
}
- return gpfsacl_get_posix_acl(path_p, gpfs_type, mem_ctx);
+ return gpfsacl_get_posix_acl(smb_fname->base_name, gpfs_type, mem_ctx);
}
static SMB_ACL_T gpfsacl_sys_acl_get_fd(vfs_handle_struct *handle,
diff --git a/source3/modules/vfs_hpuxacl.c b/source3/modules/vfs_hpuxacl.c
index f666a5eceb5..c344cb95fde 100644
--- a/source3/modules/vfs_hpuxacl.c
+++ b/source3/modules/vfs_hpuxacl.c
@@ -139,13 +139,14 @@ static bool hpux_aclsort_call_present(void);
/* public functions - the api */
SMB_ACL_T hpuxacl_sys_acl_get_file(vfs_handle_struct *handle,
- const char *path_p,
- SMB_ACL_TYPE_T type,
- TALLOC_CTX *mem_ctx)
+ const struct smb_filename *smb_fname,
+ SMB_ACL_TYPE_T type,
+ TALLOC_CTX *mem_ctx)
{
SMB_ACL_T result = NULL;
int count;
HPUX_ACL_T hpux_acl = NULL;
+ const char *path_p = smb_fname->base_name;
DEBUG(10, ("hpuxacl_sys_acl_get_file called for file '%s'.\n",
path_p));
diff --git a/source3/modules/vfs_hpuxacl.h b/source3/modules/vfs_hpuxacl.h
index df30e17f51b..b629c7d0b7f 100644
--- a/source3/modules/vfs_hpuxacl.h
+++ b/source3/modules/vfs_hpuxacl.h
@@ -34,7 +34,7 @@
#define __VFS_HPUXACL_H__
SMB_ACL_T hpuxacl_sys_acl_get_file(vfs_handle_struct *handle,
- const char *path_p,
+ const struct smb_filename *smb_fname,
SMB_ACL_TYPE_T type);
SMB_ACL_T hpuxacl_sys_acl_get_fd(vfs_handle_struct *handle,
diff --git a/source3/modules/vfs_media_harmony.c b/source3/modules/vfs_media_harmony.c
index 9a5b99db8e3..cad3d9fcfe8 100644
--- a/source3/modules/vfs_media_harmony.c
+++ b/source3/modules/vfs_media_harmony.c
@@ -2101,35 +2101,33 @@ out:
* Failure: set errno, return NULL
*/
static SMB_ACL_T mh_sys_acl_get_file(vfs_handle_struct *handle,
- const char *path_p,
- SMB_ACL_TYPE_T type,
- TALLOC_CTX *mem_ctx)
+ const struct smb_filename *smb_fname,
+ SMB_ACL_TYPE_T type,
+ TALLOC_CTX *mem_ctx)
{
SMB_ACL_T ret;
- char *clientPath;
- TALLOC_CTX *ctx;
+ int status;
+ struct smb_filename *clientFname = NULL;
DEBUG(MH_INFO_DEBUG, ("Entering mh_sys_acl_get_file\n"));
- if (!is_in_media_files(path_p))
- {
- ret = SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, path_p, type, mem_ctx);
+ if (!is_in_media_files(smb_fname->base_name)) {
+ ret = SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, smb_fname,
+ type, mem_ctx);
goto out;
}
- clientPath = NULL;
- ctx = talloc_tos();
-
- if (alloc_get_client_path(handle, ctx,
- path_p,
- &clientPath))
- {
- ret = NULL;
+ status = alloc_get_client_smb_fname(handle,
+ talloc_tos(),
+ smb_fname,
+ &clientFname);
+ if (status != 0) {
+ ret = (SMB_ACL_T)NULL;
goto err;
}
- ret = SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, clientPath, type, mem_ctx);
+ ret = SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, clientFname, type, mem_ctx);
err:
- TALLOC_FREE(clientPath);
+ TALLOC_FREE(clientFname);
out:
return ret;
}
diff --git a/source3/modules/vfs_nfs4acl_xattr.c b/source3/modules/vfs_nfs4acl_xattr.c
index cae3e7bea65..3975f80a941 100644
--- a/source3/modules/vfs_nfs4acl_xattr.c
+++ b/source3/modules/vfs_nfs4acl_xattr.c
@@ -585,9 +585,9 @@ static NTSTATUS nfs4acl_xattr_fset_nt_acl(vfs_handle_struct *handle,
*/
static SMB_ACL_T nfs4acl_xattr_fail__sys_acl_get_file(vfs_handle_struct *handle,
- const char *path_p,
- SMB_ACL_TYPE_T type,
- TALLOC_CTX *mem_ctx)
+ const struct smb_filename *smb_fname,
+ SMB_ACL_TYPE_T type,
+ TALLOC_CTX *mem_ctx)
{
return (SMB_ACL_T)NULL;
}
diff --git a/source3/modules/vfs_posixacl.c b/source3/modules/vfs_posixacl.c
index ed8f1bae8f0..d99f538524c 100644
--- a/source3/modules/vfs_posixacl.c
+++ b/source3/modules/vfs_posixacl.c
@@ -34,9 +34,9 @@ static acl_t smb_acl_to_posix(const struct smb_acl_t *acl);
/* public functions - the api */
SMB_ACL_T posixacl_sys_acl_get_file(vfs_handle_struct *handle,
- const char *path_p,
- SMB_ACL_TYPE_T type,
- TALLOC_CTX *mem_ctx)
+ const struct smb_filename *smb_fname,
+ SMB_ACL_TYPE_T type,
+ TALLOC_CTX *mem_ctx)
{
struct smb_acl_t *result;
acl_type_t acl_type;
@@ -54,7 +54,7 @@ SMB_ACL_T posixacl_sys_acl_get_file(vfs_handle_struct *handle,
return NULL;
}
- acl = acl_get_file(path_p, acl_type);
+ acl = acl_get_file(smb_fname->base_name, acl_type);
if (acl == NULL) {
return NULL;
diff --git a/source3/modules/vfs_posixacl.h b/source3/modules/vfs_posixacl.h
index b64bdb280ab..8dd138e632d 100644
--- a/source3/modules/vfs_posixacl.h
+++ b/source3/modules/vfs_posixacl.h
@@ -22,7 +22,7 @@
#define __VFS_POSIXACL_H__
SMB_ACL_T posixacl_sys_acl_get_file(vfs_handle_struct *handle,
- const char *path_p,
+ const struct smb_filename *smb_fname,
SMB_ACL_TYPE_T type,
TALLOC_CTX *mem_ctx);
diff --git a/source3/modules/vfs_solarisacl.c b/source3/modules/vfs_solarisacl.c
index 48305c50180..4506274a99c 100644
--- a/source3/modules/vfs_solarisacl.c
+++ b/source3/modules/vfs_solarisacl.c
@@ -63,12 +63,14 @@ static bool solaris_acl_check(SOLARIS_ACL_T solaris_acl, int count);
/* public functions - the api */
SMB_ACL_T solarisacl_sys_acl_get_file(vfs_handle_struct *handle,
- const char *path_p,
- SMB_ACL_TYPE_T type, TALLOC_CTX *mem_ctx)
+ const struct smb_filename *smb_fname,
+ SMB_ACL_TYPE_T type,
+ TALLOC_CTX *mem_ctx)
{
SMB_ACL_T result = NULL;
int count;
SOLARIS_ACL_T solaris_acl = NULL;
+ const char *path_p = smb_fname->base_name;
DEBUG(10, ("solarisacl_sys_acl_get_file called for file '%s'.\n",
path_p));
diff --git a/source3/modules/vfs_solarisacl.h b/source3/modules/vfs_solarisacl.h
index 941f7669155..0ee4fa3131c 100644
--- a/source3/modules/vfs_solarisacl.h
+++ b/source3/modules/vfs_solarisacl.h
@@ -21,9 +21,9 @@
#define __VFS_SOLARISACL_H__
SMB_ACL_T solarisacl_sys_acl_get_file(vfs_handle_struct *handle,
- const char *path_p,
- SMB_ACL_TYPE_T type,
- TALLOC_CTX *mem_ctx);
+ const struct smb_filename *smb_fname,
+ SMB_ACL_TYPE_T type,
+ TALLOC_CTX *mem_ctx);
SMB_ACL_T solarisacl_sys_acl_get_fd(vfs_handle_struct *handle,
files_struct *fsp,
diff --git a/source3/modules/vfs_time_audit.c b/source3/modules/vfs_time_audit.c
index c86f0dfc181..033dabe4671 100644
--- a/source3/modules/vfs_time_audit.c
+++ b/source3/modules/vfs_time_audit.c
@@ -2169,21 +2169,23 @@ static int smb_time_audit_fchmod_acl(vfs_handle_struct *handle,
}
static SMB_ACL_T smb_time_audit_sys_acl_get_file(vfs_handle_struct *handle,
- const char *path_p,
- SMB_ACL_TYPE_T type,
- TALLOC_CTX *mem_ctx)
+ const struct smb_filename *smb_fname,
+ SMB_ACL_TYPE_T type,
+ TALLOC_CTX *mem_ctx)
{
SMB_ACL_T result;
struct timespec ts1,ts2;
double timediff;
clock_gettime_mono(&ts1);
- result = SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, path_p, type, mem_ctx);
+ result = SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, smb_fname,
+ type, mem_ctx);
clock_gettime_mono(&ts2);
timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
if (timediff > audit_timeout) {
- smb_time_audit_log_fname("sys_acl_get_file", timediff, path_p);
+ smb_time_audit_log_fname("sys_acl_get_file", timediff,
+ smb_fname->base_name);
}
return result;
diff --git a/source3/modules/vfs_tru64acl.c b/source3/modules/vfs_tru64acl.c
index 83f3289deb0..69e5dfcaec4 100644
--- a/source3/modules/vfs_tru64acl.c
+++ b/source3/modules/vfs_tru64acl.c
@@ -38,9 +38,9 @@ static SMB_ACL_PERM_T tru64_permset_to_smb(const acl_perm_t tru64_permset);
/* public functions - the api */
SMB_ACL_T tru64acl_sys_acl_get_file(vfs_handle_struct *handle,
- const char *path_p,
- SMB_ACL_TYPE_T type,
- TALLOC_CTX *mem_ctx)
+ const struct smb_filename *smb_fname,
+ SMB_ACL_TYPE_T type,
+ TALLOC_CTX *mem_ctx)
{
struct smb_acl_t *result;
acl_type_t the_acl_type;
@@ -60,7 +60,7 @@ SMB_ACL_T tru64acl_sys_acl_get_file(vfs_handle_struct *handle,
return NULL;
}
- tru64_acl = acl_get_file((char *)path_p, the_acl_type);
+ tru64_acl = acl_get_file((char *)smb_fname->base_name, the_acl_type);
if (tru64_acl == NULL) {
return NULL;
diff --git a/source3/modules/vfs_tru64acl.h b/source3/modules/vfs_tru64acl.h
index 3825be08a26..0af0930b004 100644
--- a/source3/modules/vfs_tru64acl.h
+++ b/source3/modules/vfs_tru64acl.h
@@ -21,8 +21,8 @@
#define __VFS_TRU64ACL_H__
SMB_ACL_T tru64acl_sys_acl_get_file(vfs_handle_struct *handle,
- const char *path_p,
- SMB_ACL_TYPE_T type);
+ const struct smb_filename *smb_fname,
+ SMB_ACL_TYPE_T type);
SMB_ACL_T tru64acl_sys_acl_get_fd(vfs_handle_struct *handle,
files_struct *fsp);
diff --git a/source3/modules/vfs_unityed_media.c b/source3/modules/vfs_unityed_media.c
index bbccb66c5cc..93d9ce68755 100644
--- a/source3/modules/vfs_unityed_media.c
+++ b/source3/modules/vfs_unityed_media.c
@@ -1609,32 +1609,42 @@ err:
}
static SMB_ACL_T um_sys_acl_get_file(vfs_handle_struct *handle,
- const char *path_p,
- SMB_ACL_TYPE_T type,
- TALLOC_CTX *mem_ctx)
+ const struct smb_filename *smb_fname,
+ SMB_ACL_TYPE_T type,
+ TALLOC_CTX *mem_ctx)
{
SMB_ACL_T ret;
- char *client_path = NULL;
+ int saved_errno = 0;
+ struct smb_filename *client_fname = NULL;
int status;
DEBUG(10, ("Entering um_sys_acl_get_file\n"));
- if (!is_in_media_files(path_p)) {
- return SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, path_p,
+ if (!is_in_media_files(smb_fname->base_name)) {
+ return SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, smb_fname,
type, mem_ctx);
}
- status = alloc_get_client_path(handle, talloc_tos(),
- path_p, &client_path);
+ status = alloc_get_client_smb_fname(handle,
+ talloc_tos(),
+ smb_fname,
+ &client_fname);
if (status != 0) {
- ret = NULL;
+ ret = (SMB_ACL_T)NULL;
goto err;
}
- ret = SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, client_path, type, mem_ctx);
+ ret = SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, client_fname,
+ type, mem_ctx);
err:
- TALLOC_FREE(client_path);
+ if (ret == (SMB_ACL_T)NULL) {
+ saved_errno = errno;
+ }
+ TALLOC_FREE(client_fname);
+ if (saved_errno != 0) {
+ errno = saved_errno;
+ }
return ret;
}
diff --git a/source3/modules/vfs_vxfs.c b/source3/modules/vfs_vxfs.c
index f8b0dfa82c5..658649406e3 100644
--- a/source3/modules/vfs_vxfs.c
+++ b/source3/modules/vfs_vxfs.c
@@ -408,7 +408,14 @@ static bool vxfs_compare(connection_struct *conn, char *name, SMB_ACL_T the_acl,
int status;
DEBUG(10, ("vfs_vxfs: Getting existing ACL for %s\n", name));
- existing_acl = SMB_VFS_SYS_ACL_GET_FILE(conn, name, the_acl_type,
+
+ smb_fname = synthetic_smb_fname(mem_ctx, name, NULL, NULL, 0);
+ if (smb_fname == NULL) {
+ DEBUG(10, ("vfs_vxfs: Failed to create smb_fname\n"));
+ goto out;
+ }
+
+ existing_acl = SMB_VFS_SYS_ACL_GET_FILE(conn, smb_fname, the_acl_type,
mem_ctx);
if (existing_acl == NULL) {
DEBUG(10, ("vfs_vxfs: Failed to get ACL\n"));
@@ -423,12 +430,6 @@ static bool vxfs_compare(connection_struct *conn, char *name, SMB_ACL_T the_acl,
goto out;
}
- smb_fname = synthetic_smb_fname(mem_ctx, name, NULL, NULL, 0);
- if (smb_fname == NULL) {
- DEBUG(10, ("vfs_vxfs: Failed to create smb_fname\n"));
- goto out;
- }
-
status = SMB_VFS_STAT(conn, smb_fname);
if (status == -1) {
DEBUG(10, ("vfs_vxfs: stat failed!\n"));
diff --git a/source3/modules/vfs_zfsacl.c b/source3/modules/vfs_zfsacl.c
index c59a9106260..57e4182aff7 100644
--- a/source3/modules/vfs_zfsacl.c
+++ b/source3/modules/vfs_zfsacl.c
@@ -284,9 +284,9 @@ static NTSTATUS zfsacl_fset_nt_acl(vfs_handle_struct *handle,
*/
static SMB_ACL_T zfsacl_fail__sys_acl_get_file(vfs_handle_struct *handle,
- const char *path_p,
- SMB_ACL_TYPE_T type,
- TALLOC_CTX *mem_ctx)
+ const struct smb_filename *smb_fname,
+ SMB_ACL_TYPE_T type,
+ TALLOC_CTX *mem_ctx)
{
return (SMB_ACL_T)NULL;
}