Don't allow deletion of access root directories

This commit is contained in:
Jamie Cameron
2007-10-12 00:38:21 +00:00
parent 415df5525a
commit 1a7c0c4dc1
2 changed files with 5 additions and 0 deletions

View File

@ -11,6 +11,10 @@ if ($access{'ro'} || !&can_access($in{'file'})) {
print &text('delete_eaccess', $in{'file'}),"\n";
exit;
}
if (&indexof($in{'file'}, @allowed_roots) >= 0) {
print &text('delete_eroot', $in{'file'}),"\n";
exit;
}
if (-r &unmake_chroot($in{'file'}) && !-d &unmake_chroot($in{'file'})) {
&switch_acl_uid_and_chroot();
$rv = unlink($in{'file'});

View File

@ -219,6 +219,7 @@ copy_eto=You are not allowed to copy to '$1'
copy_elink=symlink failed : $1
delete_eaccess=You are not allowed to delete '$1'
delete_eroot=The directory '$1' is one of those that you are limited to, and so cannot be deleted
list_eaccess=You are not allowed to access this directory
list_edir=Failed to list $1 : $2