reprappro / RepRapFirmware

OO C++ RepRap Firmware
Other
143 stars 120 forks source link

Issues with M550/M551 commands to set machine name and password #62

Open dc42 opened 10 years ago

dc42 commented 10 years ago
  1. If the M550 command is used in config.g to set the machine name, and there is a tab character between the machine name and the semicolon that introduces a comment (as added by some users), then the tab character is considered part of the machine name. This causes the rr_name web command to return an invalid json response.
  2. If the machine name in the M550 command contains a double-quote or backslash character, then the rr_name command returns an invalid json response.
  3. If the M551 command is used in config.g to set the password, and there is a tab character between the password and the semicolon that introduces a comment (as added by some users), then the semicolon is considered part of the password. This majes it impossible to match the password.

Fixed in dc42 fork 0.65i release, with an improved fix implemented in 0.65j.

Note: there is also an issue with using M550 or M551 with an uppercase G in the password or machine name, already logged as a different issue.

RRP-support commented 10 years ago

Thanks David. I think Adrian has worked out a way around the 'G' in names problem, though we haven't test it yet: commit 0.79 https://github.com/reprappro/RepRapFirmware/commit/3e3dda9d21b96ed10732a6c349579b7b0462bdf9 Perhaps extending this to only accept alphanumeric characters would do the job?

RepRapPro tech support

dc42 commented 10 years ago

I fixed the issues not relating to 'G' as follows:

  1. When copying a machine name in the M550 command or the password in the M551 command, stop at the first control character, then remove any trailing spaces. This covers the common case of users putting space or tab characters between the name or password and the comment, and I think it should cover other cases too.
  2. When generating the response to the rr_name command, escape any " and \ characters.

See commits https://github.com/dc42/RepRapFirmware/commit/fe2b31a550a6ec3a81b3e659b0cc0bf3829a8de5 and https://github.com/dc42/RepRapFirmware/commit/8169d96d52509822f15a5e0f8e246c4839b091a5.

David Crocker, Escher Technologies Ltd. http://www.eschertech.com Tel. +44 (0)20 8144 3265 or +44 (0)7977 211486

On 22/06/2014 11:17, RRP-support wrote:

Thanks David. I think Adrian has worked out a way around the 'G' in names problem, though we haven't test it yet: commit 0.79 3e3dda9 https://github.com/reprappro/RepRapFirmware/commit/3e3dda9d21b96ed10732a6c349579b7b0462bdf9 Perhaps extending this to only accept alphanumeric characters would do the job?

RepRapPro tech support

— Reply to this email directly or view it on GitHub https://github.com/reprappro/RepRapFirmware/issues/62#issuecomment-46777182.