- check for root user

- silence errors
This commit is contained in:
Andreas Mohr 2002-10-25 03:11:33 +00:00 committed by Alexandre Julliard
parent ac4704842f
commit 0739ed720e

View file

@ -74,6 +74,7 @@ select(STDOUT); $| = 1; # make unbuffered
#--------------------------------- main program --------------------------------
&Introduction();
&Check_Misc();
&Check_BaseFiles();
&Check_ConfigFile();
&Check_Devices();
@ -218,6 +219,23 @@ sub Introduction {
}
}
sub Check_Misc {
Do_PrintHeader("checking miscellaneous stuff");
Do_Check("for root user");
$level = $is_ok;
if (`whoami` =~ /^root$/)
{
$level = $is_bad;
$reason = "running as root might be insecure/problematic.";
$advice = "don\'t run Wine as root unless you know what you\'re doing";
}
Do_PrintResult($level, $reason, $advice);
}
sub Check_BaseFiles {
my $line;
@ -395,7 +413,7 @@ PERMCHECK:
if (! $device)
{
$level = $is_critical;
$reason = "no Device option found -> CD-ROM labels can''t be read";
$reason = "no Device option found -> CD-ROM labels can\'t be read";
$advice = "add Device option and make sure the device given is accessible by you";
}
last;
@ -506,7 +524,7 @@ sub Check_ConfigFile {
{
if (!-e $config) {
$reason = $config." does not exist";
$advice = "it is ok in case you have ~/.winerc. If you don''t, then you''re in trouble !";
$advice = "it is ok in case you have ~/.winerc. If you don\'t, then you\'re in trouble";
}
elsif (!-r $config) {
$reason = $config." not readable";
@ -564,7 +582,7 @@ sub Do_CheckDevice {
if (($mode & $dev_open) && (!open(DEVICE, ">$dev")))
{
$level = $err_level;
$reason = "no kernel driver for ".$dev."?";
$reason = "no kernel driver for ".$dev."or used by other program?";
$advice = "module loading problems ? Read /usr/src/linux/Documentation/modules.txt";
goto FAILED;
}
@ -594,21 +612,21 @@ sub Check_Registry {
Do_PrintHeader("checking registry configuration");
Do_Check("availability of winedefault.reg entries");
push (@entries, `grep "SHAREDMEMLOCATION" $regfile`);
push (@entries, `grep "SHAREDMEMLOCATION" $regfile 2>/dev/null`);
if (@entries)
{
Do_PrintResult($is_ok);
}
else
{
Do_PrintResult($is_critical, "entry \"SHAREDMEMLOCATION\" not found in system.reg registry file", "file winedefault.reg doesn't seem to have been applied using regapi");
Do_PrintResult($is_critical, "entry \"SHAREDMEMLOCATION\" not found in system.reg registry file", "file winedefault.reg, the most basic wine registry environment, doesn't seem to have been applied using regapi");
}
@entries = ();
Do_Check("availability of windows registry entries");
# FIXME: use a different key for check if Wine adds this one to its
# default registry.
push (@entries, `grep "Default Taskbar" $regfile`);
push (@entries, `grep "Default Taskbar" $regfile 2>/dev/null`);
if (@entries)
{
Do_PrintResult($is_ok);