Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parseRFC3659ListLine Fails to parse MLSD (List) response #105

Closed
laraoz opened this issue Sep 26, 2017 · 2 comments · Fixed by #106
Closed

parseRFC3659ListLine Fails to parse MLSD (List) response #105

laraoz opened this issue Sep 26, 2017 · 2 comments · Fixed by #106

Comments

@laraoz
Copy link

laraoz commented Sep 26, 2017

The issue lies in the parser.go file. It seems that when you issue a List command (MLSD supported), the parseRFC3659ListLine function can't work with keys where the first letter is an UpperCase. It seems to always expect a lowercase string (from line variable), which is not always the case (at least in my server). Instead of getting things like type=cdir - which expects - , it gets Type=cdir, so it fails to match that in the switch statement and sets everything to 0 or nil.

@us3r64
Copy link

us3r64 commented Sep 26, 2017

If i can make a suggestion, format the key at assign at
https://github.com/jlaffaye/ftp/blob/master/parse.go#L43

key := strings.ToLower(field[:i])

@laraoz
Copy link
Author

laraoz commented Sep 26, 2017

Yup, I did that in my local, but problem remains for others

laraoz pushed a commit to laraoz/ftp that referenced this issue Sep 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants