mirror of
https://github.com/gogs/gogs.git
synced 2026-05-06 08:47:56 +02:00
ssh: make env command a passthrough (#7868)
## Describe the pull request Fixes https://github.com/gogs/gogs/security/advisories/GHSA-vm62-9jw3-c8w3
This commit is contained in:
@@ -447,8 +447,9 @@ func GetPublicKeyByID(keyID int64) (*PublicKey, error) {
|
||||
return key, nil
|
||||
}
|
||||
|
||||
// SearchPublicKeyByContent searches content as prefix (leak e-mail part)
|
||||
// and returns public key found.
|
||||
// SearchPublicKeyByContent searches a public key using the content as prefix
|
||||
// (i.e. ignore the email part). It returns ErrKeyNotExist if no such key
|
||||
// exists.
|
||||
func SearchPublicKeyByContent(content string) (*PublicKey, error) {
|
||||
key := new(PublicKey)
|
||||
has, err := x.Where("content like ?", content+"%").Get(key)
|
||||
|
||||
Reference in New Issue
Block a user