Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 09 Dec 2015 13:22:51 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 205157] [patch] pw(8) does not accept 8-bit characters in a GECOS field
Message-ID:  <bug-205157-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=205157

            Bug ID: 205157
           Summary: [patch] pw(8) does not accept 8-bit characters in a
                    GECOS field
           Product: Base System
           Version: 10.2-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Keywords: patch
          Severity: Affects Many People
          Priority: ---
         Component: bin
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: orios814@gmail.com
          Keywords: patch

Created attachment 164014
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=164014&action=edit
A patch to make pw(8) accept 8-bit characters in a GECOS field.

The command pw(8) does not accept 8-bit characters in a GECOS field, though
'pw_user.c' claims at line 1238 that 8-bit characters are intended to be
allowed in a GECOS field.

[How-To-Repeat] Try the following command on your shell.
# pw useradd foobar -c '<some 8-bit characters>'

[Reason] The function 'pw_checkname' in '/usr/src/usr.sbin/pw/pw_user.c' checks
if the input string does not have characters of 0x00--0x1F at line 1233 by the
following condition:
  *ch < ' '
However, the type of 'ch' was changed from 'u_char' to 'char' (Jul. 3, 2015),
which made the above condition match also characters 0x80--0xFF. So the
condition must be the following:
  (*ch >= 0 && *ch < ' ')

The attached patch for '/usr/src/usr.sbin/pw/pw_user.c' will fix this problem.

Thank you for reading!

-- 
You are receiving this mail because:
You are the assignee for the bug.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-205157-8>