Permalink
Browse files

improved backup ownership verification

  • Loading branch information...
serghey-rodin committed Mar 28, 2014
1 parent e2d9c4b commit 3f6a2f2371712cc8f37c3f7f2e3cb7edc104e742
Showing with 3 additions and 1 deletion.
  1. +3 −1 func/main.sh
View
@@ -160,7 +160,9 @@ is_type_valid() {
# Check if backup is available for user
is_backup_available() {
if [ "$user" != "$(echo $backup | cut -f 1 -d '.')" ]; then
b_owner=$(echo $user |\
sed -e "s/\.[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9].tar//")
if [ "$user" != "$b_owner" ]; then
echo "Error: User $user don't have permission to use $backup"
log_event "$E_FORBIDEN" "$EVENT"
exit $E_FORBIDEN

0 comments on commit 3f6a2f2

Please sign in to comment.