]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
util-path: remove dead code
authorLukas Sismis <lsismis@oisf.net>
Wed, 24 Jul 2024 20:45:20 +0000 (22:45 +0200)
committerVictor Julien <victor@inliniac.net>
Sat, 29 Mar 2025 05:38:02 +0000 (06:38 +0100)
src/util-path.c
src/util-path.h

index 34c4cc75ca79f3434fcd01799e2afeaee219b276..356c4a7727b9edd322c7bab8ae843a0286beee6c 100644 (file)
@@ -117,42 +117,6 @@ char *PathMergeAlloc(const char *const dir, const char *const fname)
     return ret;
 }
 
-/**
- * \brief Wrapper to join a directory and filename and resolve using realpath
- *   _fullpath is used for WIN32
- *
- * \param out_buf output buffer.  Up to PATH_MAX will be written.  Unchanged on exit failure.
- * \param buf_size length of output buffer, must be PATH_MAX
- * \param dir the directory
- * \param fname the filename
- *
- * \retval 0 on success
- * \retval -1 on failure
- */
-int PathJoin(char *out_buf, size_t buf_size, const char *const dir, const char *const fname)
-{
-    SCEnter();
-    if (buf_size != PATH_MAX) {
-        return -1;
-    }
-    if (PathMerge(out_buf, buf_size, dir, fname) != 0) {
-        SCLogError("Could not join filename to path");
-        return -1;
-    }
-    char *tmp_buf = SCRealPath(out_buf, NULL);
-    if (tmp_buf == NULL) {
-        SCLogError("Error resolving path: %s", strerror(errno));
-        return -1;
-    }
-    memset(out_buf, 0, buf_size);
-    size_t ret = strlcpy(out_buf, tmp_buf, buf_size);
-    free(tmp_buf);
-    if (ret >= buf_size) {
-        return -1;
-    }
-    return 0;
-}
-
 /**
  * \brief Wrapper around SCMkDir with default mode arguments.
  */
index fee58eabd3c4ffb04c5546266c7ece7962d5b034..b2b2624908ddd8c1b1051f610163f418a2666378 100644 (file)
@@ -51,7 +51,6 @@ int PathIsAbsolute(const char *);
 int PathIsRelative(const char *);
 int PathMerge(char *out_buf, size_t buf_size, const char *const dir, const char *const fname);
 char *PathMergeAlloc(const char *const dir, const char *const fname);
-int PathJoin(char *out_buf, size_t buf_len, const char *const dir, const char *const fname);
 int SCDefaultMkDir(const char *path);
 int SCCreateDirectoryTree(const char *path, const bool final);
 bool SCPathExists(const char *path);