jgit/org.eclipse.jgit
Masaya Suzuki 61f0bd54d0 Call AdvertiseRefsHook before validating wants
AdvertiseRefsHook is used to limit the visibility of the refs in Gerrit.
If this hook is not called, then all refs are treated as visible,
causing the server to serve commits reachable from branches the client
should not be able to access, if asked to via a request naming a guessed
object id.

This bug was introduced in v2.0.0.201206130900-r~123 (Modify refs in
UploadPack/ReceivePack using a hook interface, 2012-02-08).  Stateful
bidirectional transports are not affected.

Fix it by moving the AdvertiseRefsHook call to
getAdvertisedOrDefaultRefs, ensuring the hook is called in all cases.

[jn: backported to stable-4.5 by splitting out tests and the protocol v2
 specific parts]

Change-Id: I159f396216354f2eda3968d17802e166d8c8ec2d
Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
Signed-off-by: Jonathan Nieder <jrn@google.com>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2018-12-24 10:58:43 +01:00
..
.settings Fix LockFile semantics when running on NFS 2017-11-22 18:15:11 +01:00
META-INF Prepare 4.5.5-SNAPSHOT builds 2017-11-22 19:27:22 +01:00
findBugs [findBugs] Silence warning about Transport initialization 2012-09-14 00:01:47 +02:00
resources/org/eclipse/jgit Retry stale file handles on .git/config file 2018-05-10 11:13:32 +02:00
src/org/eclipse/jgit Call AdvertiseRefsHook before validating wants 2018-12-24 10:58:43 +01:00
.classpath Set minimum required Java version to Java 7 2015-02-09 14:11:50 +01:00
.fbprefs Initial JGit contribution to eclipse.org 2009-09-29 16:47:03 -07:00
.gitignore Finish removing Apache Felix maven-bundle-plugin 2010-01-12 11:46:55 -08:00
.project Revert "Hide Maven target directories from Eclipse" 2010-08-28 09:50:50 +02:00
BUCK Add HTTP status code to ServiceMayNotContinueException 2016-08-23 18:06:51 -07:00
about.html Add missing about.html files to all shipped bundles 2011-06-08 21:51:51 +02:00
build.properties Add "resources/" as a source folder 2010-06-05 14:39:27 +02:00
plugin.properties Remove incubation marker 2011-05-31 22:53:53 +02:00
pom.xml Replace Findbugs with Spotbugs in org.eclipse.jgit/pom.xml 2018-10-13 09:14:57 +09:00