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

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.

主站蜘蛛池模板: 台北市| 鄢陵县| 贺州市| 西乌珠穆沁旗| 砀山县| 神池县| 翼城县| 丰镇市| 龙川县| 化州市| 喀喇| 石景山区| 利辛县| 靖安县| 齐齐哈尔市| 定兴县| 洞头县| 抚松县| 海丰县| 独山县| 永平县| 新巴尔虎右旗| 呼图壁县| 桐城市| 北海市| 益阳市| 吴桥县| 汉寿县| 兰考县| 新田县| 龙川县| 卢氏县| 玉门市| 孝昌县| 文登市| 上饶市| 惠水县| 马尔康县| 连云港市| 灵川县| 云安县|