mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 10:37:42 -07:00
improved backup ownership verification
This commit is contained in:
parent
e2d9c4be2b
commit
3f6a2f2371
1 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue