mirror of
https://github.com/webmin/webmin.git
synced 2026-06-09 14:30:24 +01:00
Fix to make temp dir perms message translatable
This commit is contained in:
@@ -8,6 +8,10 @@ require './webmin-lib.pl';
|
||||
|
||||
# Permissions used for newly created Webmin temp directories.
|
||||
my $advanced_temp_dir_perms = 0755;
|
||||
my $advanced_temp_dir_perms_text = sprintf("%04o", $advanced_temp_dir_perms);
|
||||
my $advanced_temp_dir_shared_perms = 01777;
|
||||
my $advanced_temp_dir_shared_perms_text =
|
||||
sprintf("%04o", $advanced_temp_dir_shared_perms);
|
||||
|
||||
# Save global temp dir setting
|
||||
if ($in{'tempdir_def'}) {
|
||||
@@ -186,7 +190,8 @@ foreach my $part (split(/\/+/, $dir)) {
|
||||
if ($final) {
|
||||
&advanced_temp_dir_perms_ok($path) ||
|
||||
&error(&text('advanced_etempperms', $path,
|
||||
&advanced_temp_dir_allowed_perms_text()));
|
||||
$advanced_temp_dir_perms_text,
|
||||
$advanced_temp_dir_shared_perms_text));
|
||||
}
|
||||
else {
|
||||
&advanced_temp_parent_dir_perms_ok($path) ||
|
||||
@@ -199,26 +204,15 @@ foreach my $part (split(/\/+/, $dir)) {
|
||||
&error(&text('advanced_etempmkdir', $path, "$!"));
|
||||
&advanced_temp_dir_perms_ok($path) ||
|
||||
&error(&text('advanced_etempchmod', $path,
|
||||
&advanced_temp_dir_perms_text(), "$!"));
|
||||
$advanced_temp_dir_perms_text, "$!"));
|
||||
}
|
||||
&advanced_temp_dir_perms_ok($dir) ||
|
||||
&error(&text('advanced_etempperms', $dir,
|
||||
&advanced_temp_dir_allowed_perms_text()));
|
||||
$advanced_temp_dir_perms_text,
|
||||
$advanced_temp_dir_shared_perms_text));
|
||||
return $dir;
|
||||
}
|
||||
|
||||
# Octal text form used in error messages.
|
||||
sub advanced_temp_dir_perms_text
|
||||
{
|
||||
return sprintf("%04o", $advanced_temp_dir_perms);
|
||||
}
|
||||
|
||||
# Existing final temp dirs may be Webmin-private, or standard shared temp dirs.
|
||||
sub advanced_temp_dir_allowed_perms_text
|
||||
{
|
||||
return "<tt>".&advanced_temp_dir_perms_text()."</tt> or <tt>1777</tt>";
|
||||
}
|
||||
|
||||
# Check the final configured temp directory. Webmin creates 0755 directories,
|
||||
# but also permits standard shared temp directories like /var/tmp.
|
||||
sub advanced_temp_dir_perms_ok
|
||||
@@ -229,7 +223,7 @@ return 0 if (!@st || !-d _);
|
||||
return 0 if ($st[4] != $<);
|
||||
my $mode = $st[2] & 07777;
|
||||
return 1 if (($mode & 0777) == $advanced_temp_dir_perms);
|
||||
return 1 if ($mode == 01777);
|
||||
return 1 if ($mode == $advanced_temp_dir_shared_perms);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -946,7 +946,7 @@ advanced_etempmkdir=Failed to create temporary files directory $1 : $2
|
||||
advanced_etempparent=Cannot create temporary files directory because $1 exists and is not a directory
|
||||
advanced_etempparentperms=Parent directory <tt>$1</tt> must be group and other executable.
|
||||
advanced_etempchmod=Failed to set permissions on temporary files directory $1 to $2 : $3
|
||||
advanced_etempperms=Temporary files directory <tt>$1</tt> already exists with incorrect ownership or permissions, and must be owned by <tt>root</tt> with mode $2 before saving.
|
||||
advanced_etempperms=Temporary files directory <tt>$1</tt> already exists with incorrect ownership or permissions, and must be owned by <tt>root</tt> with mode <tt>$2</tt> or <tt>$3</tt> before saving.
|
||||
advanced_pass_desc=Make password available to Usermin programs?
|
||||
advanced_pass_help=Does not work when session authentication is enabled
|
||||
advanced_tempmods=Per-module temporary directories
|
||||
|
||||
Reference in New Issue
Block a user