Sitelet https://github.com/keybase/bot-sshca/commit/911c1163f903368975c709275f70e72405b78266
Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit 911c116

Browse files
authored
Merge pull request #60 from keybase/david/kssh-validate-bot-user-different
Have kssh validate that kssh and keybaseca cannot run as the same user
2 parents dc661a2 + d9b161a commit 911c116

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

‎VERSION‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.0
1+
1.1.0

‎src/kssh/bot.go‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,18 @@ import (
1414
func GetSignedKey(config ConfigFile, request shared.SignatureRequest) (shared.SignatureResponse, error) {
1515
empty := shared.SignatureResponse{}
1616

17+
// Start communicating with the Keybase chat API
1718
runOptions := kbchat.RunOptions{KeybaseLocation: GetKeybaseBinaryPath()}
1819
kbc, err := kbchat.Start(runOptions)
1920
if err != nil {
2021
return empty, fmt.Errorf("error starting Keybase chat: %v", err)
2122
}
2223

24+
// Validate that the bot user is different than the current user
25+
if config.BotName == kbc.GetUsername() {
26+
return empty, fmt.Errorf("cannot run kssh and keybaseca as the same user: %s", config.BotName)
27+
}
28+
2329
sub, err := kbc.ListenForNewTextMessages()
2430
if err != nil {
2531
return empty, fmt.Errorf("error subscribing to messages: %v", err)

0 commit comments

Comments
 (0)