winecheck patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

- check for root user
- silence errors

-- 
Andreas Mohr                        Stauferstr. 6, D-71272 Renningen, Germany
Determining best CVS host...
Using CVSROOT :pserver:cvs@cvs.winehq.com:/home/wine
Index: tools/winecheck
===================================================================
RCS file: /home/wine/wine/tools/winecheck,v
retrieving revision 1.10
diff -u -r1.10 winecheck
--- tools/winecheck	8 Jul 2002 20:43:21 -0000	1.10
+++ tools/winecheck	24 Oct 2002 10:37:25 -0000
@@ -74,6 +74,7 @@
 
 #--------------------------------- main program --------------------------------
 &Introduction();
+&Check_Misc();
 &Check_BaseFiles();
 &Check_ConfigFile();
 &Check_Devices();
@@ -218,6 +219,23 @@
   }
 }
 
+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 @@
                         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 @@
   {
     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 @@
   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 @@
   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);

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux