mirror of
https://github.com/kasmtech/KasmVNC.git
synced 2024-11-28 02:53:41 +01:00
vncserver: extract LoadSystemThenUserThenMandatoryConfigs()
This commit is contained in:
parent
efbf401c8e
commit
a6b3eb1f24
@ -88,31 +88,8 @@ my %config;
|
|||||||
|
|
||||||
# We set some reasonable defaults. Config file settings
|
# We set some reasonable defaults. Config file settings
|
||||||
# override these where present.
|
# override these where present.
|
||||||
$default_opts{desktop} = "edString($desktopName);
|
&SetReasonabeDefaults();
|
||||||
$default_opts{auth} = "edString($xauthorityFile);
|
&LoadSystemThenUserThenMandatoryConfigs();
|
||||||
$default_opts{geometry} = $geometry if ($geometry);
|
|
||||||
$default_opts{depth} = $depth if ($depth);
|
|
||||||
$default_opts{pixelformat} = $pixelformat if ($pixelformat);
|
|
||||||
$default_opts{rfbwait} = 30000;
|
|
||||||
$default_opts{rfbauth} = "$vncUserDir/passwd";
|
|
||||||
$default_opts{rfbport} = $vncPort;
|
|
||||||
$default_opts{fp} = $fontPath if ($fontPath);
|
|
||||||
$default_opts{pn} = "";
|
|
||||||
|
|
||||||
# Load user-overrideable system defaults
|
|
||||||
LoadConfig($vncSystemConfigDefaultsFile);
|
|
||||||
|
|
||||||
# Then the user's settings
|
|
||||||
LoadConfig($vncUserConfig);
|
|
||||||
|
|
||||||
# And then override anything set above if mandatory settings exist.
|
|
||||||
# WARNING: "Mandatory" is used loosely here! As the man page says,
|
|
||||||
# there is nothing stopping someone from EASILY subverting the
|
|
||||||
# settings in $vncSystemConfigMandatoryFile by simply passing
|
|
||||||
# CLI args to vncserver, which trump config files! To properly
|
|
||||||
# hard force policy in a non-subvertible way would require major
|
|
||||||
# development work that touches Xvnc itself.
|
|
||||||
LoadConfig($vncSystemConfigMandatoryFile, 1);
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Check whether VNC authentication is enabled, and if so, prompt the user to
|
# Check whether VNC authentication is enabled, and if so, prompt the user to
|
||||||
@ -954,3 +931,33 @@ sub DetectDisplayNumberFromCliArgs {
|
|||||||
&Usage();
|
&Usage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub SetReasonabeDefaults {
|
||||||
|
$default_opts{desktop} = "edString($desktopName);
|
||||||
|
$default_opts{auth} = "edString($xauthorityFile);
|
||||||
|
$default_opts{geometry} = $geometry if ($geometry);
|
||||||
|
$default_opts{depth} = $depth if ($depth);
|
||||||
|
$default_opts{pixelformat} = $pixelformat if ($pixelformat);
|
||||||
|
$default_opts{rfbwait} = 30000;
|
||||||
|
$default_opts{rfbauth} = "$vncUserDir/passwd";
|
||||||
|
$default_opts{rfbport} = $vncPort;
|
||||||
|
$default_opts{fp} = $fontPath if ($fontPath);
|
||||||
|
$default_opts{pn} = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
sub LoadSystemThenUserThenMandatoryConfigs {
|
||||||
|
# Load user-overrideable system defaults
|
||||||
|
LoadConfig($vncSystemConfigDefaultsFile);
|
||||||
|
|
||||||
|
# Then the user's settings
|
||||||
|
LoadConfig($vncUserConfig);
|
||||||
|
|
||||||
|
# And then override anything set above if mandatory settings exist.
|
||||||
|
# WARNING: "Mandatory" is used loosely here! As the man page says,
|
||||||
|
# there is nothing stopping someone from EASILY subverting the
|
||||||
|
# settings in $vncSystemConfigMandatoryFile by simply passing
|
||||||
|
# CLI args to vncserver, which trump config files! To properly
|
||||||
|
# hard force policy in a non-subvertible way would require major
|
||||||
|
# development work that touches Xvnc itself.
|
||||||
|
LoadConfig($vncSystemConfigMandatoryFile, 1);
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user