Username and Groupname Sizes on HP-UX
ABSTRACT
HP-UX 11i Version 3 provides expanded username and groupname interfaces. This capability allows
setting of user and group names that are longer than the previously supported value. HP provides this
enhancement to support the user/group naming requirements of some customers.
The default operating system configuration settings ensure compatibility for applications using user
and group names by enforcing compatible name sizes. However, if the administrator configures the
system for expanded user and group names, code changes may be necessary to accommodate
expanded names. This paper is intended for both the system administrators and program developers.
It describes how an administrator can enable the capability. Also it describes how a program
developer can determine whether programs have dependencies on user or group name sizes, and
how to enhance them to accommodate expanded user and group names. The enhancements in most
cases enable the program to operate correctly on any HP-UX version whether or not expanded names
are assigned.
NOTE: Enabling the expanded name capability and creating long user or group names may result in
incorrect operation of some existing applications. It is important to read and understand all the
information in this document before the use of long user and group name is attempted.
1.0 Introduction
The user and group names have default length limits of 8 and 16 bytes
1
, respectively. However, the
system administrator can configure the system to expand both these limits to 255 bytes. AIX (255
bytes) and Windows (20 bytes) support longer user and group names. Hence, it is necessary to
support longer user and group names in a heterogeneous environment.
Programs using the C library APIs (getpw* and getgr*) which return the groupname and username
information in a structure, do not require any modification because the structure element is a
character pointer (char *). The structure can scale to any size. Thus, the FLV mechanism is not
required to get enhanced version of the C library APIs to work under the expanded user/group name.
However, APIs and applications that assume the current maximum length are impacted due to this
change. Therefore, the HP-UX default configuration ensures that the runtime environment is compatible
for existing application binaries. This paper describes how to enable the expanded user and group
name capability, the risks to applications, limitations in HP product support of long user and group
names, how to determine whether software code has dependencies upon the default name size limits,
and how to enhance programs to accommodate expanded name sizes.
This paper is organized as follows:
Enabling the system for expanded User and group names: Describes, for system administrators, how
to enable and use the expanded name capability.
Output formats: Describes, for system administrators and programmers, how to format the output of
utilities/commands, when the user and group names are longer.
HP Product Limitations: Describes the limitations in some HP products with respect to the size of user
and group names.
Programmer Notes: Describes briefly how software developers can enhance their applications to
accommodate expanded user and group name sizes.
1
HP-UX does not document 16byte limit on groupnames. However, SAM allows 16bytes groupnames.