mirror of
https://github.com/1f349/orchid.git
synced 2025-02-05 22:16:42 +00:00
Does this resolve issues with fullFilePath
This commit is contained in:
parent
432c907303
commit
a23155a827
@ -221,7 +221,11 @@ func setupFakeSSH(wg *sync.WaitGroup, call func(addrPort netip.AddrPort, pubKey
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
var fullFilePath string
|
var fullFilePath *string
|
||||||
|
{
|
||||||
|
a := ""
|
||||||
|
fullFilePath = &a
|
||||||
|
}
|
||||||
|
|
||||||
// Sessions have out-of-band requests such as "shell",
|
// Sessions have out-of-band requests such as "shell",
|
||||||
// "pty-req" and "env". Here we handle only the
|
// "pty-req" and "env". Here we handle only the
|
||||||
@ -245,7 +249,7 @@ func setupFakeSSH(wg *sync.WaitGroup, call func(addrPort netip.AddrPort, pubKey
|
|||||||
}
|
}
|
||||||
filePath := cmd[len(scpStartStr) : len(cmd)-1]
|
filePath := cmd[len(scpStartStr) : len(cmd)-1]
|
||||||
fmt.Println("Writing file:", filePath)
|
fmt.Println("Writing file:", filePath)
|
||||||
fullFilePath = filePath
|
*fullFilePath = filePath
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
wg.Done()
|
wg.Done()
|
||||||
@ -284,8 +288,8 @@ func setupFakeSSH(wg *sync.WaitGroup, call func(addrPort netip.AddrPort, pubKey
|
|||||||
fileSize := must(strconv.Atoi(fileSizeStr[:len(fileSizeStr)-1]))
|
fileSize := must(strconv.Atoi(fileSizeStr[:len(fileSizeStr)-1]))
|
||||||
|
|
||||||
fileName := strings.TrimSpace(string(must(io.ReadAll(r))))
|
fileName := strings.TrimSpace(string(must(io.ReadAll(r))))
|
||||||
if fileName != filepath.Base(fullFilePath) {
|
if fileName != filepath.Base(*fullFilePath) {
|
||||||
panic(fmt.Errorf("invalid file name (expected \"%s\" from full path \"%s\" but got \"%s\")", filepath.Base(fullFilePath), fullFilePath, fileName))
|
panic(fmt.Errorf("invalid file name (expected \"%s\" from full path \"%s\" but got \"%s\")", filepath.Base(*fullFilePath), *fullFilePath, fileName))
|
||||||
}
|
}
|
||||||
|
|
||||||
if fileName != "420.cert.pem" && fileName != "420.key.pem" {
|
if fileName != "420.cert.pem" && fileName != "420.key.pem" {
|
||||||
|
Loading…
Reference in New Issue
Block a user