forked from forgejo/forgejo
In authorized_keys use double-quote for windows compatibility (#10841)
Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
parent
cf4f2cfa3e
commit
453f6e6e5a
2 changed files with 5 additions and 3 deletions
|
@ -36,7 +36,8 @@ import (
|
|||
|
||||
const (
|
||||
tplCommentPrefix = `# gitea public key`
|
||||
tplPublicKey = tplCommentPrefix + "\n" + `command="%s --config='%s' serv key-%d",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty %s` + "\n"
|
||||
tplCommand = "%s --config=%q serv key-%d"
|
||||
tplPublicKey = tplCommentPrefix + "\n" + `command=%q,no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty %s` + "\n"
|
||||
)
|
||||
|
||||
var sshOpLocker sync.Mutex
|
||||
|
@ -81,7 +82,7 @@ func (key *PublicKey) OmitEmail() string {
|
|||
|
||||
// AuthorizedString returns formatted public key string for authorized_keys file.
|
||||
func (key *PublicKey) AuthorizedString() string {
|
||||
return fmt.Sprintf(tplPublicKey, setting.AppPath, setting.CustomConf, key.ID, key.Content)
|
||||
return fmt.Sprintf(tplPublicKey, fmt.Sprintf(tplCommand, setting.AppPath, setting.CustomConf, key.ID), key.Content)
|
||||
}
|
||||
|
||||
func extractTypeFromBase64Key(key string) (string, error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue