Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix push not allowed to protected branch if commit starts with 7 zeros. #8231

Merged
merged 1 commit into from Nov 3, 2014

Conversation

4 participants
@cirosantilli
Copy link
Contributor

commented Nov 3, 2014

Fix https://github.com/gitlabhq/gitlabhq/issues/8232

This fix works because the function is only called by the internal API, which gets refs from git pre-receive-hook from gitlab shell, which always sends full SHA-1s to the stdin.

There are many other such similar problems on the APP where short 0 strings are tested for: there is even a '0' * 5, which exists in the gitlab repo: only 40 zeroes should be used everywhere: this SHA1 has not been inversed so far and would break Git: http://stackoverflow.com/questions/1902340/can-a-sha-1-hash-be-all-zeroes

@TeatroIO

This comment has been minimized.

Copy link

commented Nov 3, 2014

I've prepared a stage. Click to open.

push_master: '6f6d7e7ed 570e7b2ab refs/heads/master',
push_protected_branch: '6f6d7e7ed 570e7b2ab refs/heads/feature',
push_remove_protected_branch: '570e7b2ab 000000000 refs/heads/feature',
push_remove_protected_branch: "570e7b2ab #{Gitlab::Git::BLANK_SHA} refs/heads/feature",

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot Nov 3, 2014

Line is too long. [95/80]

@cirosantilli cirosantilli force-pushed the cirosantilli:0000 branch from 9757524 to 14e50d5 Nov 3, 2014

@cirosantilli cirosantilli changed the title Factor some 0000... blank refs [WIP] Factor some 0000... blank refs Nov 3, 2014

@cirosantilli cirosantilli force-pushed the cirosantilli:0000 branch from 14e50d5 to d4d2701 Nov 3, 2014

@cirosantilli cirosantilli changed the title [WIP] Factor some 0000... blank refs Fix push not allowed to protected branch if commit starts with 7 zeros. Nov 3, 2014

Fix push not allowed to protected branch if
commit starts with 7 zeros.

@cirosantilli cirosantilli force-pushed the cirosantilli:0000 branch from d4d2701 to 71ed0ab Nov 3, 2014

dzaporozhets added a commit that referenced this pull request Nov 3, 2014

Merge pull request #8231 from cirosantilli/0000
 Fix push not allowed to protected branch if  commit starts with 7 zeros.

@dzaporozhets dzaporozhets merged commit 11357c8 into gitlabhq:master Nov 3, 2014

1 check passed

default The build passed on Semaphore.
Details
@dzaporozhets

This comment has been minimized.

Copy link
Member

commented Nov 3, 2014

makes sense. Thanks!

@cirosantilli cirosantilli deleted the cirosantilli:0000 branch Nov 3, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.