Username and Groupname Sizes on HP-UX

Ø Make sure the file system limits does not create problems with longer user /group
name, by either truncating the name if it is OK, or designing a new hashing
algorithm to generate a unique file name, instead of using the name itself.
6. Are there places where names are collected into a fixed size buffer? An example would be
such as members defined in /etc/group are limited to LINE_MAX bytes long. If so, how does
increasing the size of a name impact the code?
Ø If there is an impact, and the buffer cannot be increased, document the limitation.
Else use a different algorithm to handle longer buffer.
7. Does the code call any of getpw* or getgr* routines? Where is the name portion of the
passwd_t structure used throughout the code? Does the code handle any size name that is
passed back from those routines?
Ø Make sure sufficient storage is allocated to handle any size name.
8. Does the code call any of the utmp or utmpx routines?
Ø They must be changed to call utmps.
9. Does the code read directly from any file that contains a user name? For example, instead of
using getuts* APIs directly reading /etc/utmps file
Ø If so, switch to APIs if possible. If not, bring this to the notice of HP.
10. Does your code parse output from other commands, such as ls -l , ps ef , who? Does it assume
that fields in the output will appear in certain character (column) locations?
Ø If so, set the appropriate display width to get the required output from the command.
5.2 Other Considerations
5.2.1 Dependency on the system state: Expanded user/group name enabled or not
Ideally, all the APIs and utilities must be independent of the length of user/group names. However
some applications may need to understand the state of the system (whether it is expanded
user/group name enabled or not)
To allocate the required storage at run time based on the length.
To operate correctly. For example, the useradd should not allow long user/group names
unless system is enabled for it.
You must determine whether your application needs to know the state of the system.
If your application needs to know the state of the system then sysconf(_SC_LOGIN_NAME_MAX) can
be used. If it returns -1 or 64, then the system is not enabled with long user/group name. If it returns
255, then the system is enabled with long user/group name.
6 Test Guidelines
In addition to the existing tests that exercise the user/group name functionality, testing should be
primarily focused on the maximum capacity situations. HP recommends that the passwd/group setup
is done as part of installing the test tools using a chrooted environment and not to modify the system
files. This helps in avoiding removal/copy of these files during the test run, and reduces the risk of
leaving the system in an unstable state if it crashes in the middle of a test run.
6.1 User/Group Database Configuration
Configure system to enable expanded user/group name and test with a new passwd database. This
can be integrated into the test environments (potentially under a chrooted environment. In general, it
is sufficient for application developers to test the code with just one backend database because the
code path exercised in the application is the same irrespective of the backend database. However,
some of the applications may have the need to get tested with some other backend database as well
(for example, NSS password backend).
6.2 Display Functionality
In a long user/group environment, the output of some of the commands and utilities change
according to the display guidelines. These utilities require the following three types of testing:
No configurations, default mode