官术网_书友最值得收藏!

Gitolite and the Git control flow

Conceptually, Gitolite is a very simple program. To see how it controls access to a Git repository, let us first look at how control flows from the client to the server in a normal git operation (say git fetch) when using plain ssh:

Gitolite and the Git control flow

When the user executes a git clone, fetch, or push, the Git client invokes ssh, passing it a command (either git-upload-pack or git-receive-pack, depending on whether the user is reading or writing). The local ssh client passes this to the server, and assuming authentication succeeds, that command gets executed on the server.

With Gitolite installed, the ssh daemon does not invoke the git-upload-pack or git-receive-pack directly. Instead, it calls a program called gitolite-shell, which changes the control flow as follows:

Gitolite and the Git control flow

First, notice that nothing changes on the Git client side in any way; the changes are only on the server side. In fact, unless an access violation happens and an error message needs to be sent to the user, the user may not even know that Gitolite is installed!

Second, notice the red link from Gitolite's shell program to the git-upload-pack program. This call does not happen if Gitolite determines that the user does not have the appropriate access to the repo concerned. This access check happens for both read (that is, git fetch and git clone commands) and write (git push) operations; although for writes, there are more checks that happen later.

主站蜘蛛池模板: 合江县| 巨鹿县| 招远市| 云霄县| 富宁县| 株洲县| 鄯善县| 浏阳市| 泽普县| 山阳县| 衡山县| 肇庆市| 林芝县| 红河县| 罗甸县| 从江县| 新宁县| 仙居县| 莱芜市| 灌云县| 库尔勒市| 广灵县| 双辽市| 嵊泗县| 福建省| 贡山| 渝北区| 姜堰市| 乌兰浩特市| 天津市| 伊吾县| 松江区| 赫章县| 饶阳县| 万州区| 正阳县| 平顺县| 铅山县| 昭苏县| 资溪县| 正蓝旗|