Name and user mis-set on many Unix systems?
Status: Inactive
Brought to you by:
krusch
The code starting at approximately line 503 (which
appears to be intended to run on most Unix systems)
sets $name to the userid, and leaves $user completely
unset. This appears to be incorrect; unless I am
mistaken, $user should be used as the first variable in
the group-assignment of the results of the getpwuid()
call, and $name should be extracted from the GCOS
field.
Logged In: YES
user_id=365576
Thanks for the bug report, this should be fixed in the
latest version in CVS. Please verify the fix and let me know
if you agree to close the bug report.
Logged In: YES
user_id=31939
The change made may suffice, depending on how cleanly
reporting is required to be done. As far as I can tell, the last
field returned from getpwuid() is a GCOS field, in which the
name should be the first entry in a comma-delimited list, so
assuming it is the only entry present seems incorrect.
I would suggest something roughly along the lines of:
my($passwd, $uid, $gid, $quota, $comment, $gcos);
($user, $passwd, $uid, $gid, $quota, $comment, $gcos) =
getpwuid($<);
$name = (split(/,/, $gcos))[0];
Also, the filter added for requiring names to be in [a-zA-Z0-9],
hyphen, or space seems excessively strict. I would think that
restricting it to [[:alnum:]], hyphen, and space would make
more sense (as well as working more sanely when 'use
locale' is enabled).
Logged In: YES
user_id=31939
Further comment on the filtering:
At *least* a literal '.' should be allowed, and possibly '@' as
well (for example, at least one system I use has a GCOS
name entry of 'Joel.Baker@domain.com', because it
origionates from a silly but not easily modifiable Microsoftian
LDAP authority).
Logged In: YES
user_id=31939
Kicking back to open, given the evaluation and no response
so far.