check for conf.UserDirEnable

This commit is contained in:
Hedy Li 2021-07-19 13:36:37 +08:00
parent 9d6cf6b28c
commit ec35ad6680
Signed by: hedy
GPG Key ID: B51B5A8D1B176372
1 changed files with 1 additions and 1 deletions

View File

@ -113,7 +113,7 @@ func handleConnection(conn io.ReadWriteCloser, conf *Config) {
func resolvePath(reqPath string, conf *Config) (path string) {
// Handle tildes
if strings.HasPrefix(reqPath, "/~") {
if conf.UserDirEnable && strings.HasPrefix(reqPath, "/~") {
bits := strings.Split(reqPath, "/")
username := bits[1][1:]
new_prefix := filepath.Join("/home/", username, conf.UserDir)