20 lines
898 B
Bash
20 lines
898 B
Bash
#!/usr/bin/env bash
|
|
echo "=== findmnt for hooks path ==="
|
|
findmnt -T /var/lib/gitea/data/gitea-repositories/pengyuthon/game.git/hooks/pre-receive 2>/dev/null
|
|
echo
|
|
echo "=== mounts containing noexec ==="
|
|
mount 2>/dev/null | grep -i noexec || echo "no noexec mount found"
|
|
echo
|
|
echo "=== lsattr on pre-receive ==="
|
|
lsattr /var/lib/gitea/data/gitea-repositories/pengyuthon/game.git/hooks/pre-receive 2>/dev/null || echo "lsattr unsupported/none"
|
|
echo
|
|
echo "=== copy script to /tmp and run as gitea ==="
|
|
cp /var/lib/gitea/data/gitea-repositories/pengyuthon/game.git/hooks/pre-receive /tmp/pre_test.sh
|
|
chmod 755 /tmp/pre_test.sh
|
|
runuser -u gitea -- bash -c 'echo x | /tmp/pre_test.sh'
|
|
echo "tmp_run_exit=$?"
|
|
echo
|
|
echo "=== run script in-place as gitea ==="
|
|
runuser -u gitea -- bash -c 'cd /var/lib/gitea/data/gitea-repositories/pengyuthon/game.git && echo x | ./hooks/pre-receive'
|
|
echo "inplace_exit=$?"
|