Page MenuHomeVyOS Platform

dhcp-server time-offset fails to validate
Open, Requires assessmentPublic


# set service dhcp-server shared-network-name FOO subnet time-offset 3600

  usage: [-h] [--regex REGEX] [--exec EXEC] [--value VALUE] error: argument --regex: expected one argument
  Invalid time offset value
  Value validation failed
  Set failed

Validator is regex in vyos-1x interface-definitions/dhcp-server.xml:

<leafNode name="time-offset">
    <help>Offset of the client's subnet in seconds from Coordinated Universal Time (UTC)</help>
      <description>Time offset (number, may be negative)</description>
    <constraintErrorMessage>Invalid time offset value</constraintErrorMessage>

At first I thought this may be due to my recent commit 377c04cb:

 -                        <regex>^-?[0-9]+$</regex>
+                        <regex>-?[0-9]+</regex>

It was my understanding that ^ and $ are unecessary as they are implied by default. Indeed removing them from other regexes in the same file had no negative effects. But the validator seems to be broken in some other way as it complains about expecting one argument, suggesting it gets 0 or more than 1 arguments.


Difficulty level
Unknown (require assessment)
Why the issue appeared?
Will be filled on close