Username and Groupname Sizes on HP-UX

3.1 Issues due to Display of Long User/Group Names
Extending user/group names beyond 8 bytes disrupts the tabular output of commands such
as ps that do not truncate user/group names.
Commands such as ls that truncate user/group names provide incomplete/erroneous data to
callers.
Script writers often use the knowledge of the column widths of different fields in the output by
commands such as ls. This gathered data is then used to perform some other action.
Changes in column width of user/group name fields break these scripts.
Truncation of user/group names can result in script errors.
Truncation of user/group names may result in misidentification if two user/group names
having the same prefix.
3.2 Display Guidelines Followed by HP Supplied Commands and
Utilities
Under an expanded user/group name enabled environment following display guidelines are followed
by HP supplied commands and utilities. Some of the commands/utilities may not follow the display
guidelines due to the limitations posed by the output of those commands. Exceptions to these
guidelines are documented in the man page of the command/utility.
3.2.1 Default Display Mode
Default display width of zero is set when lugadmin -e is executed without specifying the -d option. It
can be changed at any time by executing lugadmin with the -d option. For user and group names
longer (in bytes) than the default length for that command/utility, the name is truncated to the
maximum default length and the last printed character is replaced with a plus sign (+). Consider an
example of a command which uses a field width of eight characters for the display of username in a
system where long user/group name is not enabled. When the long user/group name is enabled and
default display mode is set, the command continues to use the field width of eight characters for
displaying the user name. Thus if the username is nine characters, then the first seven characters of the
username are printed followed by ‘+’.
3.2.2 System-wide or user specific configuration of display width.
The lugadmin command with –d option can be used to change the system-wide configuration.
For example, when lugadmin –d 64 is issued, the display width is set to 64, thus the user/group
name field width of the applications is set to 64. For all the user/group names that are longer than
64 bytes, the name is truncated to 63 characters, and last character in the 64
th
column is replaced
with "+" character to indicate the truncation.
If an individual user wants a value for the display width that is different from the value set with the
system-wide configuration, the user can set the UG_DISPLAY_WIDTH environment variable.
The environment variable overrides the system-wide configuration.
Man page of lugadmin provides the details of the display width configuration.
3.3 API for Display Width
In order to maintain the consistency of the display of user/group names and ease of future
modifications, a new API, ug_display_width () is introduced to query the display width to be used
based on the formatting rules described in section 3.2. The man page of ug_display_width ()
describes how to use it.
3.4 Types of Applications That Need to Consider the Display Guidelines
The following are examples of applications which need to consider the display guidelines:
Applications that provide output formatted in columns, such as who, ls, ps, etc.
Applications that display output in fields, such as finger.
Applications that attempt to limit output to the conventional terminal display width of 80
characters.