ntdll: add a warning about running wine as root (try 3)

Austin English austinenglish at gmail.com
Mon Feb 2 21:55:58 CST 2009


Been seeing it quite a bit recently in the forums. While the patches
to break using sudo/su have helped a bit, seems some users are
convinced they need to run wine as root. This adds a non fatal
message, so no functionality is lost for those that _do_ need to run
as root.

Try 2:
Made warning a bit more verbose. Changed geteuid to getuid, since we
already check for that function, and geteuid is a bit is superfluous,
since sudo should already be prevented.

Try 3:
Clean patch that applies to git master.
-- 
-Austin
-------------- next part --------------
diff --git a/dlls/ntdll/server.c b/dlls/ntdll/server.c
index 145540f..17e685e 100644
--- a/dlls/ntdll/server.c
+++ b/dlls/ntdll/server.c
@@ -832,6 +832,13 @@ static int server_connect(void)
         if (chdir( serverdir ) == -1) fatal_perror( "chdir to %s", serverdir );
     }
 
+    /* warn about running Wine as root */
+    if (getuid() == 0)
+    {
+        MESSAGE("You are running Wine as root. You risk damaging your system by giving windows applications full access to your system!\n");
+        MESSAGE("You should run your applications as a regular user unless root permissions are absolutely needed.\n");
+    }
+
     /* make sure we are at the right place */
     if (stat( ".", &st ) == -1) fatal_perror( "stat %s", serverdir );
     if (st.st_uid != getuid()) fatal_error( "'%s' is not owned by you\n", serverdir );


More information about the wine-patches mailing list