summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-10-13 19:20:11 +0100
committerGitHub <noreply@github.com>2021-10-13 14:20:11 -0400
commit01b9d35f1a0188dadc1ee09f5e4dd98acc38ff09 (patch)
tree0eeb51c7bd5baa72ba07cbab71bc05448e16aa10 /modules
parent429258cff3f5ff6ef94ae33c587f2d899c40b4c1 (diff)
downloadgitea-01b9d35f1a0188dadc1ee09f5e4dd98acc38ff09.tar.gz
gitea-01b9d35f1a0188dadc1ee09f5e4dd98acc38ff09.zip
Disable core.protectNTFS (#17300)
core.protectNTFS protects NTFS from files which may be difficult to remove or interact with using the win32 api, however, it also appears to prevent such files from being entered into the git indexes - fundamentally causing breakages with PRs that affect these files. However, deliberately setting this to false may cause security issues due to the remain sparse checkout of files in the merge pipeline. The only sensible option therefore is to provide an optional setting which admins could set which would forcibly switch this off if they are affected by this issue. Fix #17092 Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'modules')
-rw-r--r--modules/git/git.go6
-rw-r--r--modules/setting/git.go1
2 files changed, 7 insertions, 0 deletions
diff --git a/modules/git/git.go b/modules/git/git.go
index 7ab11736e8..e6c34979e8 100644
--- a/modules/git/git.go
+++ b/modules/git/git.go
@@ -204,6 +204,12 @@ func Init(ctx context.Context) error {
return err
}
}
+ if setting.Git.DisableCoreProtectNTFS {
+ if err := checkAndSetConfig("core.protectntfs", "false", true); err != nil {
+ return err
+ }
+ GlobalCommandArgs = append(GlobalCommandArgs, "-c", "core.protectntfs=false")
+ }
return nil
}
diff --git a/modules/setting/git.go b/modules/setting/git.go
index aa838a8d64..aaa65ed81c 100644
--- a/modules/setting/git.go
+++ b/modules/setting/git.go
@@ -26,6 +26,7 @@ var (
EnableAutoGitWireProtocol bool
PullRequestPushMessage bool
LargeObjectThreshold int64
+ DisableCoreProtectNTFS bool
Timeout struct {
Default int
Migrate int