Menu

#10 Bug in argument order: -b vs -a

accepted
None
5
2015-03-01
2015-02-03
No

I ran into a bug in the order of arguments issued, between -b and -a. Documentation shows -a provided after -b, and is implemented in scripts as such. However, if -b is changed to a lower number (that is consistent with the -a argument), sshguard exits with an error that suggests that the -a value is the default of 40, and that a non-nonsensical condition exits (-b < -a). Moving the -a argument before the -b argument fixed the issue for my environment. I had to change provided rc scripts to correct this issue, but the issue is at the code level; a level at which all implementations can benefit.

I am providing a patch that moves the check outside the options loop in sshguard_options.c, allowing -a to come after -b (as in the documentation) and also to account for multiple inclusions of such arguments (although in these 2 cases, the last one specified 'wins').

1 Attachments

Discussion

  • Kevin Zheng

    Kevin Zheng - 2015-02-19

    Thanks for the analysis and patch. Committed in 66b6c56, with minor changes.

     
  • Kevin Zheng

    Kevin Zheng - 2015-02-26
    • status: open --> closed-fixed
    • assigned_to: Kevin Zheng
     
  • Kevin Zheng

    Kevin Zheng - 2015-03-01
    • Status: closed-fixed --> accepted
     

Log in to post a comment.