From: Ralph Boehme Date: Tue, 23 Jan 2024 11:29:36 +0000 (+0100) Subject: s3/lib: move path_to_strv() to util_path.c X-Git-Tag: tdb-1.4.11~68 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f564fcb7c1ab78af7c2e0ae0ff5b292a1058e1cc;p=thirdparty%2Fsamba.git s3/lib: move path_to_strv() to util_path.c More callers are coming. Signed-off-by: Ralph Boehme Reviewed-by: Stefan Metzmacher --- diff --git a/source3/lib/util_path.c b/source3/lib/util_path.c index a7d1a8b1328..c1a9c9ad60f 100644 --- a/source3/lib/util_path.c +++ b/source3/lib/util_path.c @@ -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; +} diff --git a/source3/lib/util_path.h b/source3/lib/util_path.h index 9dcc1dd23ca..c4cb9b130e9 100644 --- a/source3/lib/util_path.h +++ b/source3/lib/util_path.h @@ -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 diff --git a/source3/smbd/files.c b/source3/smbd/files.c index d7062cd2016..50bf9b58851 100644 --- a/source3/smbd/files.c +++ b/source3/smbd/files.c @@ -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,