Patchwork chgserver: more explicit about sensitive environ variables

login
register
mail settings
Submitter Jun Wu
Date May 10, 2017, 6:56 p.m.
Message ID <f275d21ea713de70a8ca.1494442599@x1c>
Download mbox | patch
Permalink /patch/20562/
State Accepted
Headers show

Comments

Jun Wu - May 10, 2017, 6:56 p.m.
# HG changeset patch
# User Jun Wu <quark@fb.com>
# Date 1494442522 25200
#      Wed May 10 11:55:22 2017 -0700
# Node ID f275d21ea713de70a8cae521d3afc1fbe497de25
# Parent  1ada3d18e7fbc9069910f2c036992d2f2b28e058
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r f275d21ea713
chgserver: more explicit about sensitive environ variables

Environment variables like HGUSER, HGEDITOR, HGEDITFROM should not trigger
a new chgserver. This patch uses a whitelist for environ variables starting
with "HG" to reduce the number of servers.

I have went through `grep -o "[\"']HG[A-Z_0-9]*['\"]" -hR . | sort -u` so
the list should be up-to-date.
Yuya Nishihara - May 13, 2017, 11:54 a.m.
On Wed, 10 May 2017 11:56:39 -0700, Jun Wu wrote:
> # HG changeset patch
> # User Jun Wu <quark@fb.com>
> # Date 1494442522 25200
> #      Wed May 10 11:55:22 2017 -0700
> # Node ID f275d21ea713de70a8cae521d3afc1fbe497de25
> # Parent  1ada3d18e7fbc9069910f2c036992d2f2b28e058
> # Available At https://bitbucket.org/quark-zju/hg-draft
> #              hg pull https://bitbucket.org/quark-zju/hg-draft -r f275d21ea713
> chgserver: more explicit about sensitive environ variables

Queued, thanks.

Patch

diff --git a/mercurial/chgserver.py b/mercurial/chgserver.py
--- a/mercurial/chgserver.py
+++ b/mercurial/chgserver.py
@@ -76,5 +76,6 @@  def _hashlist(items):
 _envre = re.compile(r'''\A(?:
                     CHGHG
-                    |HG(?:[A-Z].*)?
+                    |HG(?:DEMANDIMPORT|EMITWARNINGS|MODULEPOLICY|PROF|RCPATH)?
+                    |HG(?:ENCODING|PLAIN).*
                     |LANG(?:UAGE)?
                     |LC_.*