all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lewis Perin <perin@panix.com>
To: emacs-devel@gnu.org
Subject: Re: Windows Emacs and "VirtualStore"
Date: Mon, 19 Apr 2010 17:12:47 -0400 (EDT)	[thread overview]
Message-ID: <20100419211247.5704333CB3@panix2.panix.com> (raw)
In-Reply-To: <pc7bpdi5bdo.fsf@panix1.panix.com> (message from Lewis Perin on Sat, 17 Apr 2010 11:47:47 -0400)

A couple of days ago I wrote that running Emacs as a non-privileged
user on Vista or Windows 7 leads to some files being written silently
to places in the file system other than where Emacs (and the user)
thinks they're going.

As far as I'm concerned, I've solved part of the problem, at least
until the next time I upgrade.  Now when Emacs tries to write to a
place in the filesystem it has no right to write to, the program finds
out and complains to the user.

The fix doesn't require a change to the code of emacs, only to a
resource linked into the program: the Windows manifest, which is a
small XML script.  The manifest in the 23.1 Windows Emacs I have does
only one thing: it declares Emacs's dependence on
"Microsoft.Windows.Common-Controls".  This needs to be augmented by
some XML verbiage that tells Windows that the program is aware of
VirtualStore and prefers not to use it.  Here's the manifest I'm
using:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32"
      name="Microsoft.Windows.Common-Controls"
                        version="6.0.0.0" processorArchitecture="X86"
                        publicKeyToken="6595b64144ccf1df"
                        language="*"/>
    </dependentAssembly>
  </dependency>
  <assemblyIdentity version="1.0.0.0" processorArchitecture="X86"
  name="emacs" type="win32"/>
  <description>Mighty Emacs</description>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel level="asInvoker"/>
      </requestedPrivileges>
    </security>
  </trustInfo>
</assembly>

Obviously, I'd love it if something like this script were accepted as
part of Windows Emacs.  But until then, it can be applied to the
binary using a tool like the free-as-in-beer ResHacker.

When I said the augmented manifest was *part* of the solution, I meant
that an ideal solution would allow the user to escalate privilege by
typing an admin password for an attempt to rewrite a file when the
first write failed.  I've no idea if this would be as simple as it
sounds.  Is there someone reading this who's in a position to comment?

/Lew
---
Lew Perin | perin@acm.org | http://www.panix.com/~perin/babelcarp.html




  reply	other threads:[~2010-04-19 21:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-17 15:47 Windows Emacs and "VirtualStore" Lewis Perin
2010-04-19 21:12 ` Lewis Perin [this message]
2010-04-19 23:54   ` Chad Brown
2010-04-20 14:44     ` Lewis Perin
2010-04-20 15:47   ` Chong Yidong
2010-04-20 16:26     ` Lewis Perin
2010-04-20 17:45       ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2010-04-15 22:29 Lewis Perin
2010-04-16  5:28 ` Andreas Politz
2010-04-19 21:24   ` Lewis Perin
2010-05-04 21:22   ` Lennart Borgman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100419211247.5704333CB3@panix2.panix.com \
    --to=perin@panix.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.