summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/include/proto.h4
-rw-r--r--source3/lib/util.c4
-rw-r--r--source3/modules/onefs_open.c6
-rw-r--r--source3/modules/vfs_acl_tdb.c5
-rw-r--r--source3/modules/vfs_acl_xattr.c5
-rw-r--r--source3/modules/vfs_default.c2
-rw-r--r--source3/smbd/file_access.c5
-rw-r--r--source3/smbd/nttrans.c2
-rw-r--r--source3/smbd/open.c6
-rw-r--r--source3/smbd/posix_acls.c5
-rw-r--r--source3/smbd/reply.c4
-rw-r--r--source3/smbd/trans2.c3
12 files changed, 17 insertions, 34 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 437a1d545a..be34bb0e65 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -1230,8 +1230,8 @@ char *modules_path(const char *name);
char *data_path(const char *name);
char *state_path(const char *name);
const char *shlib_ext(void);
-bool parent_dirname_talloc(TALLOC_CTX *mem_ctx, const char *dir,
- char **parent, const char **name);
+bool parent_dirname(TALLOC_CTX *mem_ctx, const char *dir, char **parent,
+ const char **name);
bool ms_has_wild(const char *s);
bool ms_has_wild_w(const smb_ucs2_t *s);
bool mask_match(const char *string, const char *pattern, bool is_case_sensitive);
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 2c4cd20f31..d00a764c1d 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -2334,8 +2334,8 @@ const char *shlib_ext(void)
Given a filename - get its directory name
********************************************************************/
-bool parent_dirname_talloc(TALLOC_CTX *mem_ctx, const char *dir,
- char **parent, const char **name)
+bool parent_dirname(TALLOC_CTX *mem_ctx, const char *dir, char **parent,
+ const char **name)
{
char *p;
ptrdiff_t len;
diff --git a/source3/modules/onefs_open.c b/source3/modules/onefs_open.c
index d0310d0174..a4a317d905 100644
--- a/source3/modules/onefs_open.c
+++ b/source3/modules/onefs_open.c
@@ -462,8 +462,7 @@ NTSTATUS onefs_open_file_ntcreate(connection_struct *conn,
return print_fsp_open(req, conn, fname, req->vuid, fsp);
}
- if (!parent_dirname_talloc(talloc_tos(), fname, &parent_dir,
- &newname)) {
+ if (!parent_dirname(talloc_tos(), fname, &parent_dir, &newname)) {
return NT_STATUS_NO_MEMORY;
}
@@ -1339,8 +1338,7 @@ static NTSTATUS onefs_open_directory(connection_struct *conn,
}
/* Get parent dirname */
- if (!parent_dirname_talloc(talloc_tos(), fname, &parent_dir,
- &dirname)) {
+ if (!parent_dirname(talloc_tos(), fname, &parent_dir, &dirname)) {
return NT_STATUS_NO_MEMORY;
}
diff --git a/source3/modules/vfs_acl_tdb.c b/source3/modules/vfs_acl_tdb.c
index 9cb887ae51..3d140e34c2 100644
--- a/source3/modules/vfs_acl_tdb.c
+++ b/source3/modules/vfs_acl_tdb.c
@@ -433,10 +433,7 @@ static NTSTATUS inherit_new_acl(vfs_handle_struct *handle,
size_t size;
char *parent_name;
- if (!parent_dirname_talloc(ctx,
- fname,
- &parent_name,
- NULL)) {
+ if (!parent_dirname(ctx, fname, &parent_name, NULL)) {
return NT_STATUS_NO_MEMORY;
}
diff --git a/source3/modules/vfs_acl_xattr.c b/source3/modules/vfs_acl_xattr.c
index 3c8f241ad9..7c78b506f0 100644
--- a/source3/modules/vfs_acl_xattr.c
+++ b/source3/modules/vfs_acl_xattr.c
@@ -328,10 +328,7 @@ static NTSTATUS inherit_new_acl(vfs_handle_struct *handle,
size_t size;
char *parent_name;
- if (!parent_dirname_talloc(ctx,
- fname,
- &parent_name,
- NULL)) {
+ if (!parent_dirname(ctx, fname, &parent_name, NULL)) {
return NT_STATUS_NO_MEMORY;
}
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 3171d3c5ca..61e1deb81e 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -155,7 +155,7 @@ static int vfswrap_mkdir(vfs_handle_struct *handle, const char *path, mode_t mo
START_PROFILE(syscall_mkdir);
if (lp_inherit_acls(SNUM(handle->conn))
- && parent_dirname_talloc(talloc_tos(), path, &parent, NULL)
+ && parent_dirname(talloc_tos(), path, &parent, NULL)
&& (has_dacl = directory_has_default_acl(handle->conn, parent)))
mode = 0777;
diff --git a/source3/smbd/file_access.c b/source3/smbd/file_access.c
index c535bc7fd8..d44e63a89a 100644
--- a/source3/smbd/file_access.c
+++ b/source3/smbd/file_access.c
@@ -66,10 +66,7 @@ bool can_delete_file_in_directory(connection_struct *conn, const char *fname)
}
/* Get the parent directory permission mask and owners. */
- if (!parent_dirname_talloc(ctx,
- fname,
- &dname,
- NULL)) {
+ if (!parent_dirname(ctx, fname, &dname, NULL)) {
return False;
}
if(SMB_VFS_STAT(conn, dname, &sbuf) != 0) {
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index c9874f6a48..9bfc566410 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -1256,7 +1256,7 @@ static NTSTATUS copy_internals(TALLOC_CTX *ctx,
/* Grrr. We have to do this as open_file_ntcreate adds aARCH when it
creates the file. This isn't the correct thing to do in the copy
case. JRA */
- if (!parent_dirname_talloc(talloc_tos(), newname, &parent, NULL)) {
+ if (!parent_dirname(talloc_tos(), newname, &parent, NULL)) {
return NT_STATUS_NO_MEMORY;
}
file_set_dosmode(conn, newname, fattr, &sbuf2, parent, false);
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 8fe20f9cca..03d994f083 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -1363,8 +1363,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
return print_fsp_open(req, conn, fname, req->vuid, fsp, psbuf);
}
- if (!parent_dirname_talloc(talloc_tos(), fname, &parent_dir,
- &newname)) {
+ if (!parent_dirname(talloc_tos(), fname, &parent_dir, &newname)) {
return NT_STATUS_NO_MEMORY;
}
@@ -2190,8 +2189,7 @@ static NTSTATUS mkdir_internal(connection_struct *conn,
return status;
}
- if (!parent_dirname_talloc(talloc_tos(), name, &parent_dir,
- &dirname)) {
+ if (!parent_dirname(talloc_tos(), name, &parent_dir, &dirname)) {
return NT_STATUS_NO_MEMORY;
}
diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c
index b184279259..8fe7a9abe9 100644
--- a/source3/smbd/posix_acls.c
+++ b/source3/smbd/posix_acls.c
@@ -3241,10 +3241,7 @@ NTSTATUS append_parent_acl(files_struct *fsp,
return NT_STATUS_NO_MEMORY;
}
- if (!parent_dirname_talloc(mem_ctx,
- fsp->fsp_name,
- &parent_name,
- NULL)) {
+ if (!parent_dirname(mem_ctx, fsp->fsp_name, &parent_name, NULL)) {
return NT_STATUS_NO_MEMORY;
}
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 8f9edfe0ca..2133a30dc6 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -5396,8 +5396,8 @@ static void notify_rename(connection_struct *conn, bool is_dir,
mask = is_dir ? FILE_NOTIFY_CHANGE_DIR_NAME
: FILE_NOTIFY_CHANGE_FILE_NAME;
- if (!parent_dirname_talloc(NULL, oldpath, &olddir, &oldname)
- || !parent_dirname_talloc(NULL, newpath, &newdir, &newname)) {
+ if (!parent_dirname(talloc_tos(), oldpath, &olddir, &oldname)
+ || !parent_dirname(talloc_tos(), newpath, &newdir, &newname)) {
TALLOC_FREE(olddir);
return;
}
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index abc5888ba0..5abfffd618 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -5983,8 +5983,7 @@ static NTSTATUS smb_unix_mknod(connection_struct *conn,
if (lp_inherit_perms(SNUM(conn))) {
char *parent;
- if (!parent_dirname_talloc(talloc_tos(), fname, &parent,
- NULL)) {
+ if (!parent_dirname(talloc_tos(), fname, &parent, NULL)) {
return NT_STATUS_NO_MEMORY;
}
inherit_access_posix_acl(conn, parent, fname, unixmode);