Skip to content

Completely quote AppPath and CustomConf paths#12955

Merged
techknowlogick merged 5 commits into
go-gitea:masterfrom
zeripath:fix-10813-spaces-in-AppPath
Sep 29, 2020
Merged

Completely quote AppPath and CustomConf paths#12955
techknowlogick merged 5 commits into
go-gitea:masterfrom
zeripath:fix-10813-spaces-in-AppPath

Conversation

@zeripath
Copy link
Copy Markdown
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>
@zeripath zeripath force-pushed the fix-10813-spaces-in-AppPath branch from 955e80d to 8ef1190 Compare September 27, 2020 14:19
@lafriks lafriks added this to the 1.13.0 milestone Sep 28, 2020
@lafriks
Copy link
Copy Markdown
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
Copy Markdown

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.

Comment thread models/ssh_key.go
@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
Comment thread modules/util/shellquote_test.go
@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