Index: usr.sbin/pw/pw_user.c =================================================================== --- usr.sbin/pw/pw_user.c +++ usr.sbin/pw/pw_user.c @@ -24,7 +24,7 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * + * */ #ifndef lint @@ -632,7 +632,7 @@ reject = 0; if (gecos) { /* See if the name is valid as a gecos (comment) field. */ - badchars = ":!@"; + badchars = ":"; showtype = "gecos field"; } else { /* See if the name is valid as a userid or group. */ @@ -715,7 +715,7 @@ int fd; size_t len; off_t atofs = 0; - + if ((fd = openat(conf.rootfd, "etc/opiekeys", O_RDWR)) == -1) return; @@ -1207,7 +1207,7 @@ if ((cmdcnf = calloc(1, sizeof(struct userconf))) == NULL) err(EXIT_FAILURE, "calloc()"); - cmdcnf->default_password = cmdcnf->expire_days = cmdcnf->password_days = -1; + cmdcnf->default_password = cmdcnf->expire_days = cmdcnf->password_days = -1; now = time(NULL); if (arg1 != NULL) { Index: usr.sbin/pw/tests/pw_useradd_test.sh =================================================================== --- usr.sbin/pw/tests/pw_useradd_test.sh +++ usr.sbin/pw/tests/pw_useradd_test.sh @@ -27,9 +27,9 @@ user_add_comments_body() { populate_etc_skel - atf_check -s exit:0 ${PW} useradd test -c "Test User,work,123,456" - atf_check -s exit:0 -o match:"^test:.*:Test User,work,123,456:" \ - grep "^test:.*:Test User,work,123,456:" $HOME/master.passwd + atf_check -s exit:0 ${PW} useradd test -c 'Test User,work!,123,user@example.com' + atf_check -s exit:0 -o match:'^test:.*:Test User,work!,123,user@example.com:' \ + grep '^test:.*:Test User,work!,123,user@example.com:' $HOME/master.passwd } # Test add user with comments and option -N