Regex doesn't handle username with dashes, parsing "alpha-user" and "beta-user" both as "user". When this happens logging is done, and if "aplha-user" has a different home directory than "beta-user" than rouster crashes because of incorrect number of arguments to sprintf. Producing a backtrace such as:
/home/centos/rouster/lib/rouster/deltas.rb:788:in `sprintf'
/home/centos/rouster/lib/rouster/deltas.rb:788:in `block (2 levels) in get_users'
/home/centos/rouster/lib/rouster/deltas.rb:774:in `each'
/home/centos/rouster/lib/rouster/deltas.rb:774:in `block in get_users'
/home/centos/rouster/lib/rouster/deltas.rb:772:in `each'
/home/centos/rouster/lib/rouster/deltas.rb:772:in `get_users'
/home/centos/rouster/lib/rouster/testing.rb:722:in `validate_user'
The proposed change explicitly allows dashes and fixes the logging statements to prevent crashing.
Regex doesn't handle username with dashes, parsing "alpha-user" and "beta-user" both as "user". When this happens logging is done, and if "aplha-user" has a different home directory than "beta-user" than rouster crashes because of incorrect number of arguments to sprintf. Producing a backtrace such as:
The proposed change explicitly allows dashes and fixes the logging statements to prevent crashing.