VMS Help  —  DCE  DCE_SECURITY, API Routines, sec_login_get_pwent
 NAME
   sec_login_get_pwent - Returns a passwd-style entry for a login context

 SYNOPSIS

 #include <dce/sec_login.h>

 void sec_login_get_pwent(
         sec_login_handle_t login_context,
         sec_login_passwd_t *pwent,
         error_status_t *status);

 PARAMETERS

 Input

 login_context
        An opaque handle to login context data. The login context
        contains, among other data, the account principal name and UUID,
        account restrictions, records of group membership, and the
        process home directory.  (See sec_intro for more details about
        the login context.)

 Output

 pwent  A pointer to a pointer to the returned passwd-style structure.
        The particular structure depends on the underlying system. For
        example, on a system with a passwd structure like that supported
        by 4.4BSD and OSF/1, the structure (found in /usr/include/pwd.h)
        is:
             struct passwd {
                 char    *pw_name;    /* user name */
                 char    *pw_passwd;  /* encrypted password */
                 int     pw_uid;      /* user uid */
                 int     pw_gid;      /* user gid */
                 time_t  pw_change;   /* password change time */
                 char    *pw_class;   /* user access class */
                 char    *pw_gecos;   /* miscellaneous account info */
                 char    *pw_dir;     /* home directory */
                 char    *pw_shell;   /* default shell */
                 time_t  pw_expire;   /* account expiration */
             };

 status
        A pointer to the completion status.  On successful completion,
        the routine returns one of the following status codes:

          + error_status_ok to indicate that the login context has
            been validated and certified.

          + sec_login_s_not_certified to indicate that the login context
            has been validated, but not certified.  Although this code
            indicates successful completion, it warns you that the
            context is not validated.

 If the call does not complete successfully, it returns an error.

 DESCRIPTION

 The sec_login_get_pwent() routine creates a passwd-style structure for
 the current network login context.  This is generally useful for
 establishing the local operating system context. Applications that
 require all of the data normally extracted via getpwnam() should extract
 that data from the login context with this call.

 This routine works only on explicitly created (not inherited or
 imported) contexts.

 CAUTIONS
 The returned sec_login_passwd_t structure points to data stored in
 the structure indicated by the login_context pointer and must be
 treated as read-only data.  Writing to these data objects may cause
 unexpected failures.

 FILES
       SYS$COMMON:[DCE$LIBRARY]SEC_LOGIN.IDL
              The idl file from which dce/sec_login.h was derived.

 EXAMPLES

 The following example illustrates use of the sec_login_get_pwent()
 routine:

      #include <pwd.h>
      struct passwd *pwd;
      sec_login_get_pwent( login_context,
                           &(sec_login_passwd_t*)pwd,&status );
      printf ("%s",pwd->pw_name);

 ERRORS

 sec_login_s_context_invalid
              The login context itself is invalid.

 sec_login_s_not_certified
              The login context has not been certified.

 sec_login_s_default_use
              Illegal use of the default login handle occurred.

 sec_login_s_info_not_avail
              The login context has no UNIX information.

 sec_rgy_object_not_found
              The registry server could not find the specified login
              context data.

 sec_rgy_server_unavailable
              The DCE Registry Server is unavailable.

 error_status_ok
              The call was successful.

 RELATED INFORMATION

 Functions: sec_intro
Close Help