diff options
author | Vasil Mikhalenya <bazilek@gmail.com> | 2020-04-04 19:29:58 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-04 11:29:58 -0500 |
commit | 240258a3e5de1330a91f80f4b8cad0cbe9efd862 (patch) | |
tree | 4667901c6919a648b17fb04240c333579f422a0f /integrations/gitea-repositories-meta | |
parent | 2a06d3a59064eba9fd74832fd138df50924b0d13 (diff) | |
download | gitea-240258a3e5de1330a91f80f4b8cad0cbe9efd862.tar.gz gitea-240258a3e5de1330a91f80f4b8cad0cbe9efd862.zip |
Avoiding directory execution on hook (#10954) (#10955)
* test -x is not enough https://stackoverflow.com/a/39489087
Diffstat (limited to 'integrations/gitea-repositories-meta')
6 files changed, 6 insertions, 6 deletions
diff --git a/integrations/gitea-repositories-meta/user2/repo20.git/hooks/post-receive b/integrations/gitea-repositories-meta/user2/repo20.git/hooks/post-receive index 1733c16a37..f1f2709ddd 100755 --- a/integrations/gitea-repositories-meta/user2/repo20.git/hooks/post-receive +++ b/integrations/gitea-repositories-meta/user2/repo20.git/hooks/post-receive @@ -5,7 +5,7 @@ hookname=$(basename $0) GIT_DIR=${GIT_DIR:-$(dirname $0)} for hook in ${GIT_DIR}/hooks/${hookname}.d/*; do -test -x "${hook}" || continue +test -x "${hook}" && test -f "${hook}" || continue echo "${data}" | "${hook}" exitcodes="${exitcodes} $?" done diff --git a/integrations/gitea-repositories-meta/user2/repo20.git/hooks/pre-receive b/integrations/gitea-repositories-meta/user2/repo20.git/hooks/pre-receive index 1733c16a37..f1f2709ddd 100755 --- a/integrations/gitea-repositories-meta/user2/repo20.git/hooks/pre-receive +++ b/integrations/gitea-repositories-meta/user2/repo20.git/hooks/pre-receive @@ -5,7 +5,7 @@ hookname=$(basename $0) GIT_DIR=${GIT_DIR:-$(dirname $0)} for hook in ${GIT_DIR}/hooks/${hookname}.d/*; do -test -x "${hook}" || continue +test -x "${hook}" && test -f "${hook}" || continue echo "${data}" | "${hook}" exitcodes="${exitcodes} $?" done diff --git a/integrations/gitea-repositories-meta/user2/repo20.git/hooks/update b/integrations/gitea-repositories-meta/user2/repo20.git/hooks/update index 2918ffb7eb..df5bd27f10 100755 --- a/integrations/gitea-repositories-meta/user2/repo20.git/hooks/update +++ b/integrations/gitea-repositories-meta/user2/repo20.git/hooks/update @@ -4,7 +4,7 @@ hookname=$(basename $0) GIT_DIR=${GIT_DIR:-$(dirname $0)} for hook in ${GIT_DIR}/hooks/${hookname}.d/*; do -test -x "${hook}" || continue +test -x "${hook}" && test -f "${hook}" || continue "${hook}" $1 $2 $3 exitcodes="${exitcodes} $?" done diff --git a/integrations/gitea-repositories-meta/user27/template1.git/hooks/post-receive b/integrations/gitea-repositories-meta/user27/template1.git/hooks/post-receive index 1733c16a37..f1f2709ddd 100644 --- a/integrations/gitea-repositories-meta/user27/template1.git/hooks/post-receive +++ b/integrations/gitea-repositories-meta/user27/template1.git/hooks/post-receive @@ -5,7 +5,7 @@ hookname=$(basename $0) GIT_DIR=${GIT_DIR:-$(dirname $0)} for hook in ${GIT_DIR}/hooks/${hookname}.d/*; do -test -x "${hook}" || continue +test -x "${hook}" && test -f "${hook}" || continue echo "${data}" | "${hook}" exitcodes="${exitcodes} $?" done diff --git a/integrations/gitea-repositories-meta/user27/template1.git/hooks/pre-receive b/integrations/gitea-repositories-meta/user27/template1.git/hooks/pre-receive index 1733c16a37..f1f2709ddd 100644 --- a/integrations/gitea-repositories-meta/user27/template1.git/hooks/pre-receive +++ b/integrations/gitea-repositories-meta/user27/template1.git/hooks/pre-receive @@ -5,7 +5,7 @@ hookname=$(basename $0) GIT_DIR=${GIT_DIR:-$(dirname $0)} for hook in ${GIT_DIR}/hooks/${hookname}.d/*; do -test -x "${hook}" || continue +test -x "${hook}" && test -f "${hook}" || continue echo "${data}" | "${hook}" exitcodes="${exitcodes} $?" done diff --git a/integrations/gitea-repositories-meta/user27/template1.git/hooks/update b/integrations/gitea-repositories-meta/user27/template1.git/hooks/update index 2918ffb7eb..df5bd27f10 100644 --- a/integrations/gitea-repositories-meta/user27/template1.git/hooks/update +++ b/integrations/gitea-repositories-meta/user27/template1.git/hooks/update @@ -4,7 +4,7 @@ hookname=$(basename $0) GIT_DIR=${GIT_DIR:-$(dirname $0)} for hook in ${GIT_DIR}/hooks/${hookname}.d/*; do -test -x "${hook}" || continue +test -x "${hook}" && test -f "${hook}" || continue "${hook}" $1 $2 $3 exitcodes="${exitcodes} $?" done |