[comp.unix.questions] long userids

pete@wvus.wciu.edu (Pete Gregory) (01/15/91)

Hi -

Are there any deadly implications to using long (>8 chars) userid names
in /etc/passwd?  Management wants to inflict an archaic userid convention
on me (okay with me, as long as UNIX likes it) that will sometimes result in
user names longer than 8 (sometimes 14) characters long.

* I've conducted a test with three long user names (1st 12 chars identical),
    and the system seems to be able to differentiate them okay (including
	who owns files).

* everyone will have to use 'n' option with 'ls', so that duplicate ownership
    will not be suspected.

* I have not conducted any network tests (telnet, NFS, etc.)

* we are using Unisys 6000/80 (Sequent S81) hardware, PTX (SysV.3) software.

Comments welcome and appreciated, especially from anyone who tried this and
ran into problems.
 
Pete Gregory, UNIX SA  |  pete@wvus.wciu.edu                  |
World Vision USA/ISD   |  wciu!wvus!pete                   ___|___
919 W. Huntingon Dr.   |  Voice: 818/357-7979 x3347           |
Monrovia, CA  91016    |  FAX:   818/303-6212                 |
                                                              |
Romanian orphans need our help!  Call 1-800-777-1229

epeterso@houligan.encore.com (Eric Peterson) (01/15/91)

pete@wvus.wciu.edu (Pete Gregory) writes:

| Are there any deadly implications to using long (>8 chars) userid names
| in /etc/passwd?  Management wants to inflict an archaic userid convention
| on me (okay with me, as long as UNIX likes it) that will sometimes result in
| user names longer than 8 (sometimes 14) characters long.

I ran into this problem just yesterday on a System V machine.  I found
that with a long user ID, I was unable to change my password with
/bin/passwd.  I was unable to use FTP, since somewhere, either in the
client or the server, my ID was being truncated to 8 characters.

| * I've conducted a test with three long user names (1st 12 chars identical),
|     and the system seems to be able to differentiate them okay (including
| 	who owns files).

That's because ownership is determined by user ID number, not the
login name.

| * everyone will have to use 'n' option with 'ls', so that duplicate ownership
|     will not be suspected.

Good luck enforcing this, other than by hacking ls and possibly
breaking any scripts or other software that depends upon the lack of
the -n option.

Why does your management want to support such long ID names,
especially ones of varying length?  Perhaps it's something similar to
what we do here at Encore ...

Someone decided that it would be nice to be able to send mail to
anyone in the company by merely sending mail to an address consisting
of their first initial followed by their complete last name.  To do
this, the file /usr/lib/aliases maps everyone's first initial and full
last name into a real user ID at a real machine location.  Some people
have IDs that fit this pattern, truncated to 8 characters.  Others
have only their first name or their initials.  But the aliases file
takes care of all of these special cases.

This may not be what your superiors want necessarily.  But there
should be some way to accomodate their needs without resorting to long
user IDs.

Eric
--
       Eric Peterson <> epeterson@encore.com <> uunet!encore!epeterson
   Encore Computer Corp. * Ft. Lauderdale, Florida * (305) 587-2900 x 5208
Why did Constantinople get the works? Gung'f abobql'f ohfvarff ohg gur Ghexf.

les@chinet.chi.il.us (Leslie Mikesell) (01/16/91)

In article <70DsV1w163w@wvus.wciu.edu> pete@wvus.wciu.edu (Pete Gregory) writes:
>Hi -
>
>Are there any deadly implications to using long (>8 chars) userid names
>in /etc/passwd?  Management wants to inflict an archaic userid convention
>on me (okay with me, as long as UNIX likes it) that will sometimes result in
>user names longer than 8 (sometimes 14) characters long.

SysV (as of r3 anyway) mail will deliver anything that matches 8 characters
of a passwd file entry to a file name using up to 14 characters of the
recipient name.  This means that if you have a user "longname1", mail
to "longname9" will be accepted with no errors even though no one
will be able to retreive it.  I think I even had to make a small change
to Smail3 to get this right.

"Who am I" will fail (SysVr3 again) on long user names but can usually be
replaced by $LOGNAME in scripts.

Les Mikesell
  les@chinet.chi.il.us

meissner@osf.org (Michael Meissner) (01/16/91)

In article <70DsV1w163w@wvus.wciu.edu> pete@wvus.wciu.edu (Pete
Gregory) writes:

| Are there any deadly implications to using long (>8 chars) userid names
| in /etc/passwd?  Management wants to inflict an archaic userid convention
| on me (okay with me, as long as UNIX likes it) that will sometimes result in
| user names longer than 8 (sometimes 14) characters long.

My username is 8 characters, and with that, I've noticed quirks over
the years.  Notably, some ls's use a tab after the username, which
make ls -l columns unaligned.  Another problem is that the .rhost
mechanism on older BSD systems won't recognize 8 character names, but
that can be crowbar'ed by using hosts.equiv and living with the looser
security.
--
Michael Meissner	email: meissner@osf.org		phone: 617-621-8861
Open Software Foundation, 11 Cambridge Center, Cambridge, MA, 02142

Considering the flames and intolerance, shouldn't USENET be spelled ABUSENET?

lyndon@cs.athabascau.ca (Lyndon Nerenberg) (01/18/91)

>| Are there any deadly implications to using long (>8 chars) userid names
>| in /etc/passwd?

Yes. A lot of Unix implementations have the following line in <stdio.h>:

	#define L_cuserid       9

This constant defines the size of a char array large enough to hold
a login name plus the terminating NULL. Some (not a lot, but some)
software uses this constant to size buffers. If the code doesn't check
for (strlen(pw->pw_name) < L_cuserid) you're going to have problems.

Not all Unix releases document this constant. Under SunOS it's mentioned
in the cuserid(3) man page.

I would strongly advise that you limit login names to a maximum of
eight characters. There are better ways to achieve what you're setting
out to do than by overloading the semantics of login names.



-- 
    Lyndon Nerenberg  VE6BBM / Computing Services / Athabasca University
        {alberta,cbmvax,mips}!atha!lyndon || lyndon@cs.athabascau.ca
                    Packet: ve6bbm@ve6mc [.ab.can.na]
      The only thing open about OSF is their mouth.  --Chuck Musciano