28 lines
584 B
Go
28 lines
584 B
Go
package handler
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/bytedream/sshoneypot/sshoneypot/info"
|
|
)
|
|
|
|
func Default(info *info.Info) {
|
|
info.Writelnf("-bash: %s: command not found", info.Command)
|
|
}
|
|
|
|
func multipleArgs(info *info.Info) bool {
|
|
if len(info.Args) == 0 {
|
|
info.Writeln(missingOperand(info))
|
|
return false
|
|
} else {
|
|
return true
|
|
}
|
|
}
|
|
|
|
func missingOperand(info *info.Info) string {
|
|
return fmt.Sprintf("%s: missing operand", info.Command)
|
|
}
|
|
|
|
func noSuchFileOrDirectory(file string, info *info.Info) string {
|
|
return fmt.Sprintf("%s: %s: No such file or directory", info.Command, file)
|
|
}
|