[Wine] Problems with wincfg

Martin Gregorie martin at gregorie.org
Mon Jun 18 17:27:41 CDT 2012

On Mon, 2012-06-18 at 16:40 -0500, David Bailey wrote:
> Martin Gregorie wrote:
> > On Mon, 2012-06-18 at 15:37 -0500, David Bailey wrote:
> > 
> > 
> > > I don't really understand, surely the very first line of wine's main()
> > > could contain a test for super user - just attempt to make a directory
> > > inside /etc - should do, but I am sure their are neater methods.
> > > 
> > > 
> > There's a much easier way: 
> > 
> > if (strcmp(getenv("USER"), "root") == 0)
> > if (!run_as_root_ok)
> > {
> > fprintf(stderr, "Error: wine is being run as root\n");
> > exit(EACCESS);
> > }
> > 
> > 
> > Martin
> Well yes - though I would prefer a dialog box - wine tends to spew out
> quite a few errors to the console even for working code - they tend to
> get ignored, and the program might not be interactive.
If that was in something I'd implemented, it would be executed after
validating command line parameters and before doing anything else apart
from seeing if help had been requested. The result would be an immediate
exit with the error message as shown and the exit code set to EACCES
(Permission dented) unless run_as_root is true (which I'd probably link
to a command line option, say --allow_root). Even the dimmest bulb
should be able to understand that. If the user meant to run it as root,
the solution is easy: add --allow_root to the command line and hit

> The point is, even when you know about the problem, it is so easy to
> make a mistake. For example, I use Notepad++ under wine, so I am
> invoking wine all the time.
Agreed, but given that its usually not a good idea to run wine as root
and there are remarkably few situations where its necessary, a gentle
reminder like that is a good idea.

Re Notepad++ - I'd strongly suggest you learn at least the basics of
editing files with vi/vim. Its not most peoples' idea of a friendly
editor, but there are two BIG reasons for knowing how to use it: 

1) it will work reliably in rescue situations where no other editor will
even start: you can run it from the Linux console as a full screen
editor when the system is so borked that the screen will only work as a
glass teletype (no cursor movement, only CRLF, clear screen and tab) and
arrow keys are not understood (it will use h,l,j,k as

2) it is available on almost every *NIX related system which makes it as
near to a universally available editor as you'll find. Besides, its use
of regular expressions for searching and text replacement is extremely

Normally you'd probably use gedit if you're using Gnome, XFCE or another
Gnome-related window manager - dunno what KDE or Unify prefer since I
never use them.


More information about the wine-users mailing list