xyzzy1@hotpop.com
2005-Nov-12 04:25 UTC
[Wine] [third try] How to masquerade as Administrator?
My original thread got taken off-topic and seems to not want to get back on-topic. Does anybody have any ideas about my question? Here's the original text of my question. Thanks for any help. Wine 0.9 installation. I installed Internet Explorer using the manual procedure in the applications database. I then changed the version reporting to Windows 2000 using winecfg and then went to http://v4.windowsupdate.microsoft.com which went ok until I got a "Must be Administrator". I notice that there is a stub that is IsNTAdmin that seems to be returning 0. Is there any way to be administrator on my own box with an installation that is under my home directory (~/.wine)? Perhaps some sort of "runas" command?
xyzzy1@hotpop.com wrote:> Wine 0.9 installation. I installed Internet Explorer using the manual > procedure in the applications database. > > I then changed the version reporting to Windows 2000 using winecfg and then > went to http://v4.windowsupdate.microsoft.com which went ok until I got a > "Must be Administrator". > > I notice that there is a stub that is IsNTAdmin that seems to be returning 0.Have you tried modifying the stub to just return 1? In my imagination, nobody really runs as a non-privileged user account, even though the docs says to do so. I've run a non-privileged user account for perhaps a month, and that was a couple of years ago. Hated it so much I've not run as anything but root ever since. If that's what everybody does, maybe just returning 1 is sane :-). You could also modify IsNTAdmin to do something intelligent, eg. similar to: grep -E "^`whoami`:" /etc/passwd | awk -F: '{print $4}' == 0 (check that user's current group is 'root'). It might be useful in various scenarios to fake Windows Administrator rights, even though one is not logged in as root. So the best solution of all might be to just have IsNTAdmin read the value from the registry. The wineprefixcreate application could set the initial value in the ~/.wine registry depending on above 'is-user-root' calculation.