Baffled: is it Cygwin (64-bits) or Windows that causes the invocation of regedit (from bash) to fail?

Corinna Vinschen corinna-cygwin@cygwin.com
Mon May 12 13:01:00 GMT 2014


On May 12 14:20, Houder wrote:
> Of course, it is not really a problem, that regedit cannot be invoked from Cygwin, as it can
> be invoked from the Windows interface ...
>> However, in some of the "harder" cases of using Gygwin, one needs to have a "mental" model of
> how Cygwin "integrates" with Windows (is my belief) ... and as far I understand the matter, I
> was surprised to find that I could not invoke regedit from bash.
>> Consequently, I decided to investigate why I got the denial (64-bits Cygwin) at my end.
>> First of all, some more info about my "environment":
>> - I am using Cygwin from Windows 7 ...
> - I am using Cygwin from an administrative account ...
> - furthermore, using secpol.msc, I have set the ConsentPromptBehaviorAdmin field in
>> HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System (key in registry)
>> to zero, meaning 'elevate without prompting'

Doesn't matter. The problem is that elevating is a special procedure,
requiring a special form of ShellExecuteEx function, which doesn't
integrate well with the requirements of POSIX fork/exec. Therefore
Cygwin never calls ShellExecuteEx to fork/exec an application, rather it
calls CreateProcess/CreateProcessAsUser, both of which don't provide a
way to elevate a process. Therefore, to elevate a process from a Cygwin
shell, the shell must already run elevated (e.g., right click on "Cygwin
Terminal" -> "Run as Administrator...").
What's really annoying: RegEdit's mainfest does not request "asAdmin"
rights. Rather it only requests "MaximumAllowed". One would think this
means that a CreateProcess call would simply continue with the current
permissions of the user. Not so, unfortunately.
Corinna
-- 
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20140512/058c02fa/attachment.sig>


More information about the Cygwin mailing list

AltStyle によって変換されたページ (->オリジナル) /