commit | d02084da95e9eefccebb28b21117cdb712669bfc | [log] [tgz] |
---|---|---|
author | Saša Živkov <sasa.zivkov@sap.com> | Wed Mar 04 17:14:15 2020 +0100 |
committer | Saša Živkov <zivkov@gmail.com> | Fri Mar 06 12:16:31 2020 +0000 |
tree | 8581fcc8ed86f1dab73460124fb3b126064d8703 | |
parent | 73ac69264a29094e5220ca1722e09db14a3e5991 [diff] |
Fix the access-path for AbstractGitCommand subclasses The access path for the Receive.currentUser in the receive-pack command was wrongly set to SSH_COMMAND instead of, as intended [1], to GIT. This allowed project owners to force-update a ref using git-over-SSH without having en explicit permission for that, see [2]. Interestingly, the current SSH session in the Receive.session had properly set access-path for the associated user: Receive.session.getUser().getAccessPath() == GIT. but it wasn't used. Yet another interesting thing is that both currentUser and session fields in the Receive class are redundant: we already have current SSH session field in the base class (AbstractGitCommand) which has associated current user with properly set access path to GIT. Remove both redundant fields and use the current session from the superclass and the current user from the current session. Refactor the ForcePushIT into SshForcePushIT and HttpForcePushIT in order to test permission over both protocols. [1] https://gerrit.googlesource.com/gerrit/+/462bc1b5865ca6a5e386cb6fee95874c9d74bcb3/java/com/google/gerrit/sshd/AbstractGitCommand.java#72 [2] https://gerrit.googlesource.com/gerrit/+/462bc1b5865ca6a5e386cb6fee95874c9d74bcb3/java/com/google/gerrit/server/permissions/RefControl.java#196 Bug: Issue 12440 Change-Id: I909713411c1c576e6e63e074609d4198fd46397d
Gerrit is a code review and project management tool for Git based projects.
Gerrit makes reviews easier by showing changes in a side-by-side display, and allowing inline comments to be added by any reviewer.
Gerrit simplifies Git based project maintainership by permitting any authorized user to submit changes to the master Git repository, rather than requiring all approved changes to be merged in by hand by the project maintainer.
For information about how to install and use Gerrit, refer to the documentation.
Our canonical Git repository is located on googlesource.com. There is a mirror of the repository on Github.
Please report bugs on the issue tracker.
Gerrit is the work of hundreds of contributors. We appreciate your help!
Please read the contribution guidelines.
Note that we do not accept Pull Requests via the Github mirror.
The Developer Mailing list is repo-discuss on Google Groups.
Gerrit is provided under the Apache License 2.0.
Install Bazel and run the following:
git clone --recurse-submodules https://gerrit.googlesource.com/gerrit cd gerrit && bazel build release
The instruction how to configure GerritForge/BinTray repositories is here
On Debian/Ubuntu run:
apt-get update & apt-get install gerrit=<version>-<release>
NOTE: release is a counter that starts with 1 and indicates the number of packages that have been released with the same version of the software.
On CentOS/RedHat run:
yum clean all && yum install gerrit-<version>[-<release>]
On Fedora run:
dnf clean all && dnf install gerrit-<version>[-<release>]
Docker images of Gerrit are available on DockerHub
To run a CentOS 7 based Gerrit image:
docker run -p 8080:8080 gerritforge/gerrit-centos7[:version]
To run a Ubuntu 15.04 based Gerrit image:
docker run -p 8080:8080 gerritforge/gerrit-ubuntu15.04[:version]
NOTE: release is optional. Last released package of the version is installed if the release number is omitted.