summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2016-03-18 22:17:30 -0700
committerJeremy Allison <jra@samba.org>2016-03-24 22:57:17 +0100
commit6ae59eb6d1d2b4a9f3a7c1094c18abe6594aace2 (patch)
tree19896312b3e9543b2f74a5631a56f830a6772a61 /source3
parent125a1b50ab2532614cb7e53b2e2979666b02702f (diff)
downloadsamba-6ae59eb6d1d2b4a9f3a7c1094c18abe6594aace2.tar.gz
s3: smbd: Modify vfs_stat_smb_basename() to take a const struct smb_filename * instead of const char *.
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/modules/nfs4_acls.c2
-rw-r--r--source3/modules/vfs_acl_common.c2
-rw-r--r--source3/modules/vfs_acl_tdb.c4
-rw-r--r--source3/modules/vfs_streams_xattr.c2
-rw-r--r--source3/modules/vfs_xattr_tdb.c2
-rw-r--r--source3/smbd/proto.h3
-rw-r--r--source3/smbd/trans2.c2
-rw-r--r--source3/smbd/vfs.c10
8 files changed, 15 insertions, 12 deletions
diff --git a/source3/modules/nfs4_acls.c b/source3/modules/nfs4_acls.c
index 349b26be186..8756285e757 100644
--- a/source3/modules/nfs4_acls.c
+++ b/source3/modules/nfs4_acls.c
@@ -274,7 +274,7 @@ static int smbacl4_GetFileOwner(struct connection_struct *conn,
ZERO_STRUCTP(psbuf);
/* Get the stat struct for the owner info. */
- if (vfs_stat_smb_basename(conn, smb_fname->base_name, psbuf) != 0)
+ if (vfs_stat_smb_basename(conn, smb_fname, psbuf) != 0)
{
DEBUG(8, ("vfs_stat_smb_basename failed with error %s\n",
strerror(errno)));
diff --git a/source3/modules/vfs_acl_common.c b/source3/modules/vfs_acl_common.c
index c907b0fdc95..98e1b8e02f7 100644
--- a/source3/modules/vfs_acl_common.c
+++ b/source3/modules/vfs_acl_common.c
@@ -641,7 +641,7 @@ static NTSTATUS get_nt_acl_internal(vfs_handle_struct *handle,
* is fully plumbed through the VFS.
*/
int ret = vfs_stat_smb_basename(handle->conn,
- smb_fname->base_name,
+ smb_fname,
&sbuf);
if (ret == -1) {
TALLOC_FREE(frame);
diff --git a/source3/modules/vfs_acl_tdb.c b/source3/modules/vfs_acl_tdb.c
index e2d0cb8f7a9..e4c84623801 100644
--- a/source3/modules/vfs_acl_tdb.c
+++ b/source3/modules/vfs_acl_tdb.c
@@ -160,7 +160,7 @@ static NTSTATUS get_acl_blob(TALLOC_CTX *ctx,
sbuf = fsp->fsp_name->st;
} else {
int ret = vfs_stat_smb_basename(handle->conn,
- smb_fname->base_name,
+ smb_fname,
&sbuf);
if (ret == -1) {
status = map_nt_error_from_unix(errno);
@@ -285,7 +285,7 @@ static int rmdir_acl_tdb(vfs_handle_struct *handle,
struct db_context *db = acl_db;
int ret = -1;
- ret = vfs_stat_smb_basename(handle->conn, smb_fname->base_name, &sbuf);
+ ret = vfs_stat_smb_basename(handle->conn, smb_fname, &sbuf);
if (ret == -1) {
return -1;
}
diff --git a/source3/modules/vfs_streams_xattr.c b/source3/modules/vfs_streams_xattr.c
index 83134648522..d9eb2e10852 100644
--- a/source3/modules/vfs_streams_xattr.c
+++ b/source3/modules/vfs_streams_xattr.c
@@ -842,7 +842,7 @@ static NTSTATUS streams_xattr_streaminfo(vfs_handle_struct *handle,
ret = SMB_VFS_FSTAT(fsp, &sbuf);
} else {
ret = vfs_stat_smb_basename(handle->conn,
- smb_fname->base_name,
+ smb_fname,
&sbuf);
}
diff --git a/source3/modules/vfs_xattr_tdb.c b/source3/modules/vfs_xattr_tdb.c
index aa3bd8279b5..c40f1e14997 100644
--- a/source3/modules/vfs_xattr_tdb.c
+++ b/source3/modules/vfs_xattr_tdb.c
@@ -416,7 +416,7 @@ static int xattr_tdb_rmdir(vfs_handle_struct *handle,
});
if (vfs_stat_smb_basename(handle->conn,
- smb_fname->base_name,
+ smb_fname,
&sbuf) == -1) {
TALLOC_FREE(frame);
return -1;
diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h
index 776e91dc8c7..6f402ab8d7a 100644
--- a/source3/smbd/proto.h
+++ b/source3/smbd/proto.h
@@ -1213,7 +1213,8 @@ NTSTATUS check_reduced_name(connection_struct *conn, const char *fname);
NTSTATUS check_reduced_name_with_privilege(connection_struct *conn,
const char *fname,
struct smb_request *smbreq);
-int vfs_stat_smb_basename(struct connection_struct *conn, const char *fname,
+int vfs_stat_smb_basename(struct connection_struct *conn,
+ const struct smb_filename *smb_fname_in,
SMB_STRUCT_STAT *psbuf);
NTSTATUS vfs_stat_fsp(files_struct *fsp);
NTSTATUS vfs_chown_fsp(files_struct *fsp, uid_t uid, gid_t gid);
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 65c2cb079aa..69276f55db1 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -69,7 +69,7 @@ static NTSTATUS refuse_symlink(connection_struct *conn,
pst = &fsp->fsp_name->st;
} else {
int ret = vfs_stat_smb_basename(conn,
- smb_fname->base_name,
+ smb_fname,
&sbuf);
if (ret == -1) {
return map_nt_error_from_unix(errno);
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index 972cea42117..b58becc360c 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -1315,15 +1315,17 @@ NTSTATUS check_reduced_name(connection_struct *conn, const char *fname)
*
* Called when we know stream name parsing has already been done.
*/
-int vfs_stat_smb_basename(struct connection_struct *conn, const char *fname,
- SMB_STRUCT_STAT *psbuf)
+int vfs_stat_smb_basename(struct connection_struct *conn,
+ const struct smb_filename *smb_fname_in,
+ SMB_STRUCT_STAT *psbuf)
{
struct smb_filename smb_fname = {
- .base_name = discard_const_p(char, fname)
+ .base_name = discard_const_p(char, smb_fname_in->base_name),
+ .flags = smb_fname_in->flags
};
int ret;
- if (lp_posix_pathnames()) {
+ if (smb_fname.flags & SMB_FILENAME_POSIX_PATH) {
ret = SMB_VFS_LSTAT(conn, &smb_fname);
} else {
ret = SMB_VFS_STAT(conn, &smb_fname);