This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


On May 12 23:00, Shaddy Baddah wrote:
> On 2014-05-12 22:50+1000, Corinna Vinschen wrote:
> >On May 12 14:20, Houder wrote:
> >>  - 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.
> 
> I am not sure which Edition it started in, but I believe regedit opens
> as the invoking user from Windows 8.1 at least (perhaps 8, I have a
> vague recollection).

Not on my Windows 8.1.  Here's the excerpt from regedit's manifest:

  "<trustInfo xmlns=""urn:schemas-microsoft-com:asm.v3"">\r\n"
  "    <security>\r\n"
  "        <requestedPrivileges>\r\n"
  "            <requestedExecutionLevel\r\n"
  "                level=""highestAvailable""\r\n"
  "                uiAccess=""false""\r\n"
  "            />\r\n"
  "        </requestedPrivileges>\r\n"
  "    </security>\r\n"
  "</trustInfo>\r\n"

Ok, so it's called "highestAvailable", not "MaximumAllowed", but you
get the idea.  If I call regedit from the non-elevated command line
I get:

  $ regedit
  /cygdrive/c/WINDOWS/regedit: Permission denied.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: pgpcYB6T67l4M.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]