mirror of https://github.com/pkg/sftp.git
				
				
				
			examples/go-sftp-server: add '-wr'
This commit is contained in:
		
							parent
							
								
									e52de81b00
								
							
						
					
					
						commit
						d8192421c2
					
				|  | @ -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..., | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue