]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3/lib: move path_to_strv() to util_path.c
authorRalph Boehme <slow@samba.org>
Tue, 23 Jan 2024 11:29:36 +0000 (12:29 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 26 Jul 2024 10:06:30 +0000 (10:06 +0000)
More callers are coming.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/lib/util_path.c
source3/lib/util_path.h
source3/smbd/files.c

index a7d1a8b132855e85554be1e9bdc724fd28bf9d10..c1a9c9ad60f07fdc71fbe6967b4a0da7cedff9e2 100644 (file)
@@ -348,3 +348,14 @@ bool subdir_of(const char *parent,
 
        return false;
 }
+
+char *path_to_strv(TALLOC_CTX *mem_ctx, const char *path)
+{
+       char *result = talloc_strdup(mem_ctx, path);
+
+       if (result == NULL) {
+               return NULL;
+       }
+       string_replace(result, '/', '\0');
+       return result;
+}
index 9dcc1dd23cac3c95422c113a6b4d965fe157c8fe..c4cb9b130e99e763f68ec99be02eeb04607573f7 100644 (file)
@@ -51,5 +51,6 @@ bool subdir_of(const char *parent,
               size_t parent_len,
               const char *subdir,
               const char **_relative);
+char *path_to_strv(TALLOC_CTX *mem_ctx, const char *path);
 
 #endif
index d7062cd20164b90612511f800cbb2d372fb1de0b..50bf9b588517059e06bce8b969514a281d88a561 100644 (file)
@@ -672,17 +672,6 @@ NTSTATUS open_stream_pathref_fsp(
        return status;
 }
 
-static char *path_to_strv(TALLOC_CTX *mem_ctx, const char *path)
-{
-       char *result = talloc_strdup(mem_ctx, path);
-
-       if (result == NULL) {
-               return NULL;
-       }
-       string_replace(result, '/', '\0');
-       return result;
-}
-
 NTSTATUS readlink_talloc(
        TALLOC_CTX *mem_ctx,
        struct files_struct *dirfsp,