summaryrefslogtreecommitdiffstats
path: root/vendor/code.gitea.io/git/tree_entry.go
diff options
context:
space:
mode:
authorMichael Kuhn <suraia@ikkoku.de>2018-11-28 08:00:25 +0100
committerLauris BH <lauris@nix.lv>2018-11-28 09:00:25 +0200
commit0222623be9fa4a56d870213f77b92139cefc2518 (patch)
treea8a2d69feb72227bf2ee87a9868e75b492190b69 /vendor/code.gitea.io/git/tree_entry.go
parent08bf443016bae30690417b4835076709ef36e3b0 (diff)
downloadgitea-0222623be9fa4a56d870213f77b92139cefc2518.tar.gz
gitea-0222623be9fa4a56d870213f77b92139cefc2518.zip
Explicitly disable Git credential helper (#5367)
* Explicitly disable Git credential helper If the user running Gitea has configured a credential helper, Git credentials might leak out of Gitea. There are two problems with credential helpers when combined with Gitea: 1. Credentials entered by a user when doing a migration or setting up a mirror will end up in the credential store. In the worst case, this is the plain text file ~/.git-credentials. 2. Credentials in the credential store will be used for migrations and mirrors by all users. For example, if user A sets up a mirror, their credentials will be stored. If user B later sets up a mirror from the same host and does not enter any credentials, user A's credentials will be used. This PR prepends -c credential.helper= to all Git commands to clear the list of helpers. This requires at least Git version 2.9, as previous versions will try to load an empty helper instead. For more details, see https://github.com/git/git/commit/24321375cda79f141be72d1a842e930df6f41725 * Update git module
Diffstat (limited to 'vendor/code.gitea.io/git/tree_entry.go')
-rw-r--r--vendor/code.gitea.io/git/tree_entry.go15
1 files changed, 10 insertions, 5 deletions
diff --git a/vendor/code.gitea.io/git/tree_entry.go b/vendor/code.gitea.io/git/tree_entry.go
index 6201eef8fd..ead0d4f5df 100644
--- a/vendor/code.gitea.io/git/tree_entry.go
+++ b/vendor/code.gitea.io/git/tree_entry.go
@@ -18,15 +18,15 @@ type EntryMode int
// one of these.
const (
// EntryModeBlob
- EntryModeBlob EntryMode = 0100644
+ EntryModeBlob EntryMode = 0x0100644
// EntryModeExec
- EntryModeExec EntryMode = 0100755
+ EntryModeExec EntryMode = 0x0100755
// EntryModeSymlink
- EntryModeSymlink EntryMode = 0120000
+ EntryModeSymlink EntryMode = 0x0120000
// EntryModeCommit
- EntryModeCommit EntryMode = 0160000
+ EntryModeCommit EntryMode = 0x0160000
// EntryModeTree
- EntryModeTree EntryMode = 0040000
+ EntryModeTree EntryMode = 0x0040000
)
// TreeEntry the leaf in the git tree
@@ -50,6 +50,11 @@ func (te *TreeEntry) Name() string {
return te.name
}
+// Mode returns the mode of the entry
+func (te *TreeEntry) Mode() EntryMode {
+ return te.mode
+}
+
// Size returns the size of the entry
func (te *TreeEntry) Size() int64 {
if te.IsDir() {