diff options
Diffstat (limited to 'Bugzilla/Install/Filesystem.pm')
-rw-r--r-- | Bugzilla/Install/Filesystem.pm | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Bugzilla/Install/Filesystem.pm b/Bugzilla/Install/Filesystem.pm index 15106dab9..c5215ecfa 100644 --- a/Bugzilla/Install/Filesystem.pm +++ b/Bugzilla/Install/Filesystem.pm @@ -46,6 +46,7 @@ our @EXPORT = qw( update_filesystem create_htaccess fix_all_file_permissions + fix_dir_permissions fix_file_permissions ); @@ -645,6 +646,26 @@ sub _update_old_charts { } } +sub fix_dir_permissions { + my ($dir) = @_; + return if ON_WINDOWS; + # Note that _get_owner_and_group is always silent here. + my ($owner_id, $group_id) = _get_owner_and_group(); + + my $perms; + my $fs = FILESYSTEM(); + if ($perms = $fs->{recurse_dirs}->{$dir}) { + _fix_perms_recursively($dir, $owner_id, $group_id, $perms); + } + elsif ($perms = $fs->{all_dirs}->{$dir}) { + _fix_perms($dir, $owner_id, $group_id, $perms); + } + else { + # Do nothing. We know nothing about this directory. + warn "Unknown directory $dir"; + } +} + sub fix_file_permissions { my ($file) = @_; return if ON_WINDOWS; @@ -843,6 +864,12 @@ Params: C<$output> - C<true> if you want this function to print Returns: nothing +=item C<fix_dir_permissions> + +Given the name of a directory, its permissions will be fixed according to +how they are supposed to be set in Bugzilla's current configuration. +If it fails to set the permissions, a warning will be printed to STDERR. + =item C<fix_file_permissions> Given the name of a file, its permissions will be fixed according to |