/[base]
ViewVC logotype

Revision 323332


Jump to revision: Previous Next
Author: emaste
Date: Fri Sep 8 21:02:15 2017 UTC (6 years, 9 months ago)
Changed paths: 3
Log Message:
MFC r322678: pw useradd: Validate the user name before creating the entry

Previouly it was possible to create users with spaces in the name with:
pw useradd -u 1234 -g 1234 -n 'test user'

The "-g 1234" is relevant, without it the name was already rejected
as expected:

[fk@test ~]$ sudo pw useradd -u 1234 -n 'test user'
pw: invalid character ` ' at position 4 in userid/group name

Bug unintentionally found with a salt config without explicit name entry:

test user:
  user.present:
    - uid: 1234
    - gid: 1234
    - fullname: Test user
    - shell: /usr/local/bin/bash
    - home: /home/test
    - groups:
      - wheel
      - salt

"Luckily" salt modules rarely bother with input validation either ...

PR:		221416
Submitted by:	Fabian Keil
Approved by:	re (kib)
Obtained from:	ElectroBSD


Changed paths

Path Details
Directorystable/10/ modified , props changed
Directorystable/10/usr.sbin/pw/pw_user.c modified , text changed
Directorystable/10/usr.sbin/pw/tests/pw_useradd_test.sh modified , text changed

  ViewVC Help
Powered by ViewVC 1.1.27