diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2010-08-13 08:20:27 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2010-08-13 08:20:27 +0200 |
commit | e2c005b490df6762e23da3223944151c17d1de80 (patch) | |
tree | bb9619cb292a76a09eb0d6604d9871e35ebbb8ba /db-update | |
parent | af4f86808e8cd45cc171f55a1ec15bf30d858a0d (diff) | |
download | dbscripts-e2c005b490df6762e23da3223944151c17d1de80.tar.gz dbscripts-e2c005b490df6762e23da3223944151c17d1de80.tar.xz |
Check permission before any action
Added a function to check if user has permission to alter the repos
and db files.
Diffstat (limited to 'db-update')
-rwxr-xr-x | db-update | 10 |
1 files changed, 1 insertions, 9 deletions
@@ -11,15 +11,7 @@ fi reponame="$1" current_arch="" -# ensure we should be playing with this DB on this server -repos="$(get_repos_for_host)" -found=0 -for r in $repos; do - if [ "$r" = "$reponame" ]; then - found=1 - fi -done -if [ $found -ne 1 ]; then +if ! check_repo_permission "$reponame"; then echo "error: you shouldn't be updating $reponame on this server!" exit 1 fi |