[Nut-upsuser] Maximum length of password

Roger Price roger at rogerprice.org
Wed Apr 6 12:28:59 BST 2022


On Wed, 6 Apr 2022, Jim Klimov wrote:

> Also does not seem dictated in docs nor comments. De-facto it is a string 
> pointer, in some code constrained by a SMALLBUF sized character array, where 
> SMALLBUF is a macro currently defined to 512.

I decided to fix arbitrary limits in the grammar based on the principle "Be 
strict in what you send, and generous in what you accept".

  UPS name maximum characters : 15
  User name maximum characters : 15
  Password maximum characters : 31
  SET VAR <upsname> <varname> "<value>", <value> maximum characters : 63

Since the IETF's ABNF grammar rules are US-ASCII based, I added the note:

  Implementation note: The ANBF is written using the provisions of [RFC5234]
  [RFC7405] which are US-ASCII based. Implementors should be aware that NUT
  itself is Unicode based and that where the grammar specifies ALPHA = %x41-5A /
  %x61-7A ; A-Z / a-z an implementation should expect letters outside the range
  specified by ALPHA.

For example a USERNAME value may contain accented letters.

Comments, as always, are welcome.
Roger



More information about the Nut-upsuser mailing list