]> git.ipfire.org Git - thirdparty/git.git/blobdiff - git-compat-util.h
Sync with Git 2.31.6
[thirdparty/git.git] / git-compat-util.h
index ba94d9f4e80c5c717a9a150a2ea525a31863123e..955c45db987bdaa5a4be6ff6ef7f2f04383fa2b1 100644 (file)
@@ -258,6 +258,11 @@ static inline const char *precompose_argv_prefix(int argc, const char **argv, co
 {
        return prefix;
 }
+static inline const char *precompose_string_if_needed(const char *in)
+{
+       return in;
+}
+
 #define probe_utf8_pathname_composition()
 #endif
 
@@ -1320,6 +1325,13 @@ int access_or_die(const char *path, int mode, unsigned flag);
 /* Warn on an inaccessible file if errno indicates this is an error */
 int warn_on_fopen_errors(const char *path);
 
+/*
+ * Open with O_NOFOLLOW, or equivalent. Note that the fallback equivalent
+ * may be racy. Do not use this as protection against an attacker who can
+ * simultaneously create paths.
+ */
+int open_nofollow(const char *path, int flags);
+
 #if !defined(USE_PARENS_AROUND_GETTEXT_N) && defined(__GNUC__)
 #define USE_PARENS_AROUND_GETTEXT_N 1
 #endif