Jump to content
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
HP.com home

Transition Impacts

Tru64 UNIX Software Transition Kit


» HP STK home
» Home
» Overview
» Tools
» Documentation
» Transition impacts
» Identifier types
» Impact list
» Porting to HP-UX
» Glossary
» Help
» Send us feedback
Site maps
» Tru64 UNIX STK
Content starts here

critical impact:

utmpx structure - incompatible data types (CrCh102)

CAP Impacts SEC Impacts

Problem description

The utmpx data type used by the getutxline, getutxid, getutxent, and pututxline functions on Tru64 UNIX is incompatible with the data type on HP-UX.

The getutxline, getutxid, getutxent, and pututxline functions access the user accounting database. The utmpx structure contains entries in the user accounting database.

On Tru64 UNIX, the utmpx structure is defined as follows:

struct utmpx {
   char    ut_user[__UT_TMP_NAMESIZE]; /* User login name */
   char    ut_id[14];              /* /etc/inittab id- IDENT_LEN in init */
   char    ut_line[__UT_LINESIZE]; /* device name (console, lnxx) */
   short   ut_type;                /* type of entry */
   pid_t   ut_pid;                 /* process id */
   struct  {
      short       ut_termination; /* Process termination status */
      short       ut_exit;        /* Process exit status */
   } ut_exit;                      /* The exit status of a process
                                    * marked as DEAD_PROCESS.
   struct  timeval ut_tv;          /* Time entry was made */
   char    ut_host[__UT_TMP_HOSTSIZE]; /* host name same as MAXHOSTNAMELEN */

In the preceding structure, __UT_TMP_NAMESIZE is 32 or 64, __UT_LINESIZE is 32, and __UT_TMP_HOSTSIZE is 64 or 256.

On HP-UX, the utmpx structure is defined as follows:

struct utmpx
   char ut_user[24] ;              /* User login name */
   char ut_id[4] ;                 /* /etc/lines id(usually line #) */
   char ut_line[12] ;              /* device name (console, lnxx) */
   pid_t ut_pid ;                  /* process id */
   short ut_type ;                 /* type of entry */
   struct __exit_status

       short __e_termination ;
       short __e_exit ;
#endif /* _STRUCT___EXIT_STATUS */
   unsigned short ut_reserved1 ;   /* Reserved for future use */
   struct timeval ut_tv;           /* time entry was made */
   char ut_host[64] ;              /* host name, if remote;
                                      NOT SUPPORTED */
   uint32_t ut_addr ;              /* Internet addr of host, if remote */
   char ut_reserved2[12] ; /* Reserved for future use */
} ;


C/C++ Structuresutmpx            

See also

Solution description

Review the applicable manpages and code.

Because of the different capacities in ut_user[ ], ut_line[ ], and ut_host[ ], applications that use these fields might not work properly. The different implementation of ut_exit might also cause unexpected behavior. Review the applicable manpages and code to determine if unexpected behavior will result.

See also

Problem summary

classifications source types OS release severity type
CAP, SEC C, C++ any HP-UX 11i version critical changed
Printable version
Privacy statement Using this site means you accept its terms Feedback to DSPP
© 2007 Hewlett-Packard Development Company, L.P.