Mercurial > public > mercurial-scm > hg-stable
diff mercurial/wireproto.py @ 32764:33b7283a3828
streamclone: consider secret changesets (BC) (issue5589)
Previously, a repo containing secret changesets would be served via
stream clone, transferring those secret changesets. While secret
changesets aren't meant to imply strong security (if you really
want to keep them secret, others shouldn't have read access to the
repo), we should at least make an effort to protect secret changesets
when possible.
After this commit, we no longer serve stream clones for repos
containing secret changesets by default. This is backwards
incompatible behavior. In case anyone is relying on the behavior,
we provide a config option to opt into the old behavior.
Note that this defense is only beneficial for remote repos
accessed via the wire protocol: if a client has access to the
files backing a repo, they can get to the raw data and see secret
revisions.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Fri, 09 Jun 2017 10:41:13 -0700 |
parents | bd872f64a8ba |
children | 4c2a46f89f08 |
line wrap: on
line diff
--- a/mercurial/wireproto.py Fri Jun 09 21:33:15 2017 +0900 +++ b/mercurial/wireproto.py Fri Jun 09 10:41:13 2017 -0700 @@ -754,7 +754,7 @@ """ # copy to prevent modification of the global list caps = list(wireprotocaps) - if streamclone.allowservergeneration(repo.ui): + if streamclone.allowservergeneration(repo): if repo.ui.configbool('server', 'preferuncompressed', False): caps.append('stream-preferred') requiredformats = repo.requirements & repo.supportedformats @@ -946,7 +946,7 @@ capability with a value representing the version and flags of the repo it is serving. Client checks to see if it understands the format. ''' - if not streamclone.allowservergeneration(repo.ui): + if not streamclone.allowservergeneration(repo): return '1\n' def getstream(it):