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

Function expandSSHIncludePaths

agent/app/service/ssh.go:961–976  ·  view source on GitHub ↗
(baseFile, value string)

Source from the content-addressed store, hash-verified

959}
960
961func expandSSHIncludePaths(baseFile, value string) []string {
962 var includeFiles []string
963 for _, item := range strings.Fields(strings.ReplaceAll(value, "\"", "")) {
964 pattern := item
965 if !filepath.IsAbs(pattern) {
966 pattern = filepath.Join(filepath.Dir(baseFile), pattern)
967 }
968 matches, err := filepath.Glob(pattern)
969 if err != nil {
970 continue
971 }
972 sort.Strings(matches)
973 includeFiles = append(includeFiles, matches...)
974 }
975 return includeFiles
976}
977
978func normalizeSSHDirectiveValue(key, value string) string {
979 if strings.EqualFold(key, "PermitRootLogin") && value == "prohibit-password" {

Callers 1

parseSSHConfigFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected