examples/go-sftp-server: add '-wr'

This commit is contained in:
powellnorma 2025-01-01 16:06:54 +01:00
parent e52de81b00
commit d8192421c2
1 changed files with 8 additions and 0 deletions

View File

@ -20,10 +20,13 @@ func main() {
var (
readOnly bool
debugStderr bool
winRoot bool
)
flag.BoolVar(&readOnly, "R", false, "read-only server")
flag.BoolVar(&debugStderr, "e", false, "debug to stderr")
flag.BoolVar(&winRoot, "wr", false, "windows root")
flag.Parse()
debugStream := io.Discard
@ -128,6 +131,11 @@ func main() {
fmt.Fprintf(debugStream, "Read write server\n")
}
if winRoot {
serverOptions = append(serverOptions, sftp.WindowsRootEnumeratesDrives())
fmt.Fprintf(debugStream, "Windows root enabled\n")
}
server, err := sftp.NewServer(
channel,
serverOptions...,