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

Completely quote AppPath and CustomConf paths #12955

Merged
merged 5 commits into from
Sep 29, 2020

Conversation

zeripath
Copy link
Contributor

Properly handle spaces in AppPath and CustomConf within hooks and
authorized_keys. Unfortunately here we don't seem to be able to get away
with using go-shellquote as it appears that Windows doesn't play too
well with singlequote quoting - therefore we will avoid singlequote
quoting unless we absolutely cannot get away without it, e.g. \n or !.

Fix #10813

Signed-off-by: Andrew Thornton art27@cantab.net

Properly handle spaces in AppPath and CustomConf within hooks and
authorized_keys. Unfortunately here we don't seem to be able to get away
with using go-shellquote as it appears that Windows doesn't play too
well with singlequote quoting - therefore we will avoid singlequote
quoting unless we absolutely cannot get away without it, e.g. \n or !.

Fix go-gitea#10813

Signed-off-by: Andrew Thornton <art27@cantab.net>
Signed-off-by: Andrew Thornton <art27@cantab.net>
@lafriks lafriks added this to the 1.13.0 milestone Sep 28, 2020
@lafriks
Copy link
Member

lafriks commented Sep 28, 2020

Please fix also test Test_CmdKeys/with_key

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Sep 28, 2020
Signed-off-by: Andrew Thornton <art27@cantab.net>
@codecov-commenter
Copy link

codecov-commenter commented Sep 28, 2020

Codecov Report

Merging #12955 into master will increase coverage by 0.01%.
The diff coverage is 83.87%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #12955      +/-   ##
==========================================
+ Coverage   42.63%   42.64%   +0.01%     
==========================================
  Files         669      670       +1     
  Lines       73495    73522      +27     
==========================================
+ Hits        31331    31351      +20     
+ Misses      37094    37091       -3     
- Partials     5070     5080      +10     
Impacted Files Coverage Δ
modules/util/shellquote.go 81.48% <81.48%> (ø)
models/ssh_key.go 52.38% <100.00%> (ø)
modules/repository/hooks.go 21.35% <100.00%> (ø)
modules/notification/ui/ui.go 80.55% <0.00%> (-2.78%) ⬇️
services/pull/check.go 31.53% <0.00%> (-2.31%) ⬇️
modules/queue/workerpool.go 58.77% <0.00%> (-1.23%) ⬇️
models/notification.go 65.76% <0.00%> (-0.91%) ⬇️
models/error.go 34.34% <0.00%> (-0.85%) ⬇️
modules/notification/mail/mail.go 34.48% <0.00%> (ø)
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5cfc1f5...692274c. Read the comment docs.

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Sep 28, 2020
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Sep 28, 2020
@techknowlogick techknowlogick merged commit 4c6ac08 into go-gitea:master Sep 29, 2020
@zeripath zeripath deleted the fix-10813-spaces-in-AppPath branch September 29, 2020 06:00
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generated authorized_keys does not work on Windows
6 participants