Problems with wincfg
-
- Level 2
- Posts: 14
- Joined: Thu Jun 02, 2011 11:11 am
Problems with wincfg
This is a long tale - most of which is probably not relevant.
1) I installed wine on Fedora 17 and encountered a problem which turned out to be because wine now includes 64-bit EXE execution capabilities. I therefore deleted .wine, and set up a wineprefix restricted to 32 bits - as advised here. This worked nicely.
2) At some point I accidentally ran wine as super user
3) I wanted to add a drive to wine so I ran winecfg, which gave the message L"C:\\windows\\system32\\wineboot.exe" although the GUI then appeared.
4) When I clicked on the Drives tab, I got the message: Failed to connect to the mount manager.
I tried deleting .wine, uninstalling wine and reinstalling, but I can't fix winecfg
Can anyone help me to get winecfg working, or maybe point out a file where the drive information is stored?
Also, if wine is not to be used as super user, why doesn't it check for that eventuality and stop with an error message before any damage is done?
David
1) I installed wine on Fedora 17 and encountered a problem which turned out to be because wine now includes 64-bit EXE execution capabilities. I therefore deleted .wine, and set up a wineprefix restricted to 32 bits - as advised here. This worked nicely.
2) At some point I accidentally ran wine as super user
3) I wanted to add a drive to wine so I ran winecfg, which gave the message L"C:\\windows\\system32\\wineboot.exe" although the GUI then appeared.
4) When I clicked on the Drives tab, I got the message: Failed to connect to the mount manager.
I tried deleting .wine, uninstalling wine and reinstalling, but I can't fix winecfg
Can anyone help me to get winecfg working, or maybe point out a file where the drive information is stored?
Also, if wine is not to be used as super user, why doesn't it check for that eventuality and stop with an error message before any damage is done?
David
Re: Problems with wincfg
http://wiki.winehq.org/FAQ#head-8b89c92 ... 96093e1484David Bailey wrote:2) At some point I accidentally ran wine as super user
Sounds like you didn't install all the necessary 32 bit parts of Wine. I believe Fedora splits Wine into lots of different packages; make sure you have all the ones you need.4) When I clicked on the Drives tab, I got the message: Failed to connect to the mount manager.
It's not recommended, but ultimately it's the user's choice.Also, if wine is not to be used as super user, why doesn't it check for that eventuality and stop with an error message before any damage is done?
-
- Level 2
- Posts: 14
- Joined: Thu Jun 02, 2011 11:11 am
Re: Problems with wincfg
Do you know where to find this list - or better, which one contains wineboot.exe .dimesio wrote: Sounds like you didn't install all the necessary 32 bit parts of Wine. I believe Fedora splits Wine into lots of different packages; make sure you have all the ones you need.
Clearly the downside to spitting wine into many packages, is that it is messy to completely reinstall.
Still it would be nice if you got an error message unless you configured it otherwise.It's not recommended, but ultimately it's the user's choice.
David
Re: Problems with wincfg
Shouldn't your package manager be able to tell you what's available? I don't use Fedora, so I can't tell you the exact command.David Bailey wrote: Do you know where to find this list - or better, which one contains wineboot.exe .
Clearly the downside to spitting wine into many packages, is that it is messy to completely reinstall.
Wine would have to be actually running show an error message, and by then the damage is already done.Still it would be nice if you got an error message unless you configured it otherwise.
Problems with wincfg
On Mon, 2012-06-18 at 11:09 -0500, dimesio wrote:
yum list 'wine*'
it doesn't seem to respond to "wine --version" without first creating a
prefix, which rather goes against the UNIX philosophy: a program should
always respond to the command line -?/--help, -v/--version options and
report any invalid arguments and options before it does anything else.
Martin
This does it:David Bailey wrote:Shouldn't your package manager be able to tell you what's available? I don't use Fedora, so I can't tell you the exact command.Do you know where to find this list - or better, which one contains wineboot.exe .
Clearly the downside to spitting wine into many packages, is that it is messy to completely reinstall.
yum list 'wine*'
Wine does some stuff rather later than you'd expect. For instance,Wine would have to be actually running show an error message, and by
then the damage is already done.
it doesn't seem to respond to "wine --version" without first creating a
prefix, which rather goes against the UNIX philosophy: a program should
always respond to the command line -?/--help, -v/--version options and
report any invalid arguments and options before it does anything else.
Martin
Re: Problems with wincfg
The "wine" metapackage installs all the required subpackages.
It exists in both 64 and 32 bits versions.
It exists in both 64 and 32 bits versions.
David Bailey wrote:Do you know where to find this list - or better, which one contains wineboot.exe .dimesio wrote: Sounds like you didn't install all the necessary 32 bit parts of Wine. I believe Fedora splits Wine into lots of different packages; make sure you have all the ones you need.
Clearly the downside to spitting wine into many packages, is that it is messy to completely reinstall.Still it would be nice if you got an error message unless you configured it otherwise.It's not recommended, but ultimately it's the user's choice.
David
-
- Level 2
- Posts: 14
- Joined: Thu Jun 02, 2011 11:11 am
Re: Problems with wincfg
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. A simple Gnome dialog box would do.dimesio wrote: Wine would have to be actually running show an error message, and by then the damage is already done.
David
Problems with wincfg
On Mon, 2012-06-18 at 15:37 -0500, David Bailey wrote:
if (strcmp(getenv("USER"), "root") == 0)
if (!run_as_root_ok)
{
fprintf(stderr, "Error: wine is being run as root\n");
exit(EACCESS);
}
Martin
There's a much easier way: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.
if (strcmp(getenv("USER"), "root") == 0)
if (!run_as_root_ok)
{
fprintf(stderr, "Error: wine is being run as root\n");
exit(EACCESS);
}
Martin
-
- Level 2
- Posts: 14
- Joined: Thu Jun 02, 2011 11:11 am
Re: Problems with wincfg
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.Martin Gregorie wrote:On Mon, 2012-06-18 at 15:37 -0500, David Bailey wrote:
There's a much easier way: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.
if (strcmp(getenv("USER"), "root") == 0)
if (!run_as_root_ok)
{
fprintf(stderr, "Error: wine is being run as root\n");
exit(EACCESS);
}
Martin
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.
David
Problems with wincfg
On Mon, 2012-06-18 at 16:40 -0500, David Bailey wrote:
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
RETURN.
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
left,right,down,up).
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
powerful.
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.
Martin
If that was in something I'd implemented, it would be executed afterMartin Gregorie wrote:Well yes - though I would prefer a dialog box - wine tends to spew outOn Mon, 2012-06-18 at 15:37 -0500, David Bailey wrote:
There's a much easier way: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.
if (strcmp(getenv("USER"), "root") == 0)
if (!run_as_root_ok)
{
fprintf(stderr, "Error: wine is being run as root\n");
exit(EACCESS);
}
Martin
quite a few errors to the console even for working code - they tend to
get ignored, and the program might not be interactive.
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
RETURN.
Agreed, but given that its usually not a good idea to run wine as rootThe 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.
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
left,right,down,up).
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
powerful.
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.
Martin
You both might want to add comments to http://bugs.winehq.org/show_bug.cgi?id=17337.
Problems with wincfg
On Mon, 2012-06-18 at 19:19 -0500, dimesio wrote:
Martin
Done.You both might want to add comments to http://bugs.winehq.org/show_bug.cgi?id=17337.
Martin
-
- Level 2
- Posts: 14
- Joined: Thu Jun 02, 2011 11:11 am
Problems with wincfg
On Tue, 2012-06-19 at 13:59 -0500, David Bailey wrote:
value is substituted for the variable name. In your example substitution
will occur when bash parses the command line, i.e. 'dave' was substituted
for $USER before sudo was executed. OTOH, if the substitution done is inside
a simple script which is run under the control of sudo, then the substitution
takes place within the environment established by sudo. Here you go:
$ cat test
#!/bin/bash
echo $USER
$ ./test
kiwi
$ sudo ./test
root
$
What happens is that this time no substitution happens when the command
is parsed. Instead, sudo changes user to root and spawns a shell under
that user. This shell executes the script by spawning a second shell (by
executing #!/bin/bash as 'root') and this evaluates $USER and does the
substitution.
Of course, much the same applies if the value of USER is retrieved
within a C program by calling getenv(): again, its a delayed evaluation
that would happen after sudo has done its thing. Finally, take a look at
the next version of my script and think about what it does:
$ cat ./test
#!/bin/bash
if [ -n "$1" ]
then
echo $1
else
echo $USER
fi
echo "Local USER is $USER"
$ sudo ./test $USER
kiwi
Local USER is root
$ sudo ./test
root
Local USER is root
Martin
This depends on when $USER is evaluated and (in a bash session) when theI'm having difficulty getting my password back for the bugs website, but I wanted to add that testing for USER == root doesn't seem to handle sudo:
sudo echo $USER
returns 'dave' for me.
value is substituted for the variable name. In your example substitution
will occur when bash parses the command line, i.e. 'dave' was substituted
for $USER before sudo was executed. OTOH, if the substitution done is inside
a simple script which is run under the control of sudo, then the substitution
takes place within the environment established by sudo. Here you go:
$ cat test
#!/bin/bash
echo $USER
$ ./test
kiwi
$ sudo ./test
root
$
What happens is that this time no substitution happens when the command
is parsed. Instead, sudo changes user to root and spawns a shell under
that user. This shell executes the script by spawning a second shell (by
executing #!/bin/bash as 'root') and this evaluates $USER and does the
substitution.
Of course, much the same applies if the value of USER is retrieved
within a C program by calling getenv(): again, its a delayed evaluation
that would happen after sudo has done its thing. Finally, take a look at
the next version of my script and think about what it does:
$ cat ./test
#!/bin/bash
if [ -n "$1" ]
then
echo $1
else
echo $USER
fi
echo "Local USER is $USER"
$ sudo ./test $USER
kiwi
Local USER is root
$ sudo ./test
root
Local USER is root
Martin
Problems with wincfg
On Tue, Jun 19, 2012 at 4:42 PM, Martin Gregorie <[email protected]> wrote:
good and old user id checking:
if(geteuid()==0 || getuid()==0) exit(EACCESS);
Best wishes,
Bruno
I'm not sure if it was already discussed or not but what about theOf course, much the same applies if the value of USER is retrieved
within a C program by calling getenv(): again, its a delayed evaluation
that would happen after sudo has done its thing.
good and old user id checking:
if(geteuid()==0 || getuid()==0) exit(EACCESS);
Best wishes,
Bruno