Menu

#2 Name and user mis-set on many Unix systems?

open-fixed
None
5
2005-04-25
2005-04-12
Joel Baker
No

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.

Discussion

  • Klaus Johannes Rusch

    • assigned_to: nobody --> krusch
    • status: open --> open-fixed
     
  • Klaus Johannes Rusch

    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.

     
  • Klaus Johannes Rusch

    • status: open-fixed --> pending-fixed
     
  • Joel Baker

    Joel Baker - 2005-04-25
    • status: pending-fixed --> open-fixed
     
  • Joel Baker

    Joel Baker - 2005-04-25

    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).

     
  • Joel Baker

    Joel Baker - 2005-04-25

    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).

     
  • Joel Baker

    Joel Baker - 2005-06-08

    Logged In: YES
    user_id=31939

    Kicking back to open, given the evaluation and no response
    so far.

     

Log in to post a comment.