[Bug 17337] Prevent running as root

wine-bugs at winehq.org wine-bugs at winehq.org
Mon Jun 18 20:19:00 CDT 2012


http://bugs.winehq.org/show_bug.cgi?id=17337

Martin Gregorie <martin at gregorie.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |martin at gregorie.org

--- Comment #3 from Martin Gregorie <martin at gregorie.org> 2012-06-18 20:19:00 CDT ---
I agree with Austin and suggest that, immediately after validating the command
line arguments[1], Wine should check the user name before doing anything else
except returning replies for --help and --version options. Something like 

    if(strcmp(getenv("USER"), "root") == 0)    

should do the trick nicely. If this check fails, display a warning message
about running wine as root (written to stderr and/or displayed as a pop-up if
Wine isn't being run from a command line) and exit with the EACCES termination
code.

This should nicely trap inadvertent attempts to run as root. If the user really
wants to run under root, let him add a command line option to override the
username check. I suggest something like an --allow_root option.

[1] Wine does not check for and reject invalid options soon enough. Although
    "wine --version" doesn't create a .wine prefix if it doesn't exist, 
    "wine -version" DOES create one before saying that it can't find 
    -version.exe. This is annoying: I stick to the one program per prefix 
    rule and would prefer that it doesn't set up default prefixes just because
    I have finger trouble on occasion. Given that even Windows programs don't
    have names starting with '-', it would be a good idea to assume that all 
    arguments before the first that is recognizable as a program name, i.e. 
    starts with 0-9a-z and ends with .exe, are Wine options and validate them
    before starting to create a prefix.

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list