MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / isSSHConfigPathAllowed

Function isSSHConfigPathAllowed

agent/app/service/ssh.go:1188–1209  ·  view source on GitHub ↗
(fileName string)

Source from the content-addressed store, hash-verified

1186}
1187
1188func isSSHConfigPathAllowed(fileName string) bool {
1189 if fileName == "" {
1190 return false
1191 }
1192 absolutePath, err := filepath.Abs(fileName)
1193 if err != nil {
1194 return false
1195 }
1196 if absolutePath == sshPath {
1197 return true
1198 }
1199 _, fileList, err := parseSSHConfigTree(sshPath)
1200 if err != nil {
1201 return false
1202 }
1203 for _, item := range fileList {
1204 if item.Path == absolutePath {
1205 return true
1206 }
1207 }
1208 return false
1209}
1210
1211type sshLogHeader struct {
1212 DateStr string

Callers 2

LoadSSHFileMethod · 0.85
UpdateByFileMethod · 0.85

Calls 1

parseSSHConfigTreeFunction · 0.85

Tested by

no test coverage detected