]> git.ipfire.org Git - thirdparty/git.git/blobdiff - git-compat-util.h
Sync with 2.31.2
[thirdparty/git.git] / git-compat-util.h
index 261516231e95bcb3d234908709d59b8bf0abd6c1..c1e9cf4f739d4212a047511dec943c1ec373e779 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
 
@@ -1256,6 +1261,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