pxfgetpwnam

Date:

10-20-2011

NAME

PXFGETPWNAM - Gets password information about login name

SYNOPSIS

INTEGER ilen, jpasswd, ierror
CHARACTER*n
CALL PXFGETPWNAM(name, ilen, jpasswd, ierror)

IMPLEMENTATION

Cray Linux Environment (CLE)

STANDARDS

IEEE Std 1003.9-1992 standard interface for FORTRAN 77

DESCRIPTION

The PXFGETPWNAM routine uses the getpwnam(3c) function to return password information about a login name. It uses the following components of the passwd structure:

pw_name

Login name

pw_uid

User ID

pw_gid

Group ID

pw_dir

Default login directory

pw_shell

Default login shell or program

The following components are supported but are not part of the POSIX 1003.9-1992 standard.

pw_passwd

Encrypted password

pw_age

Password age (character string)

pw_comment

Comment

pw_gecos

Comment

All arguments must be of default kind unless documented otherwise. Default kind is KIND=4 for integer, real, complex, and logical arguments.

The following is a list of valid arguments for this routine:

name

An input character variable or array element containing the login name for which password information is requested.

ilen

An input integer variable containing the character length of name. If ilen is zero, trailing blanks are stripped.

jpasswd

An output handle of type passwd created with PXFSTRUCTCREATE(3F).

ierror

An output integer variable that contains zero if PXFGETPWNAM was successful or nonzero if PXFGETPWNAM was not successful.

The PXFGETPWNAM routine may return the following errors:

ENOENT

If an entry matching the login name in name was not found.

EBADHANDLE

If jpasswd is an invalid handle or has an incorrect handle type.

EXAMPLES

In this example, the password information will be acquired for the login name root.

program pxftest
integer ilen, ierror, value
integer*8 jpasswd
CALL PXFSTRUCTCREATE('passwd',jpasswd,ierror)
name = 'root'
ilen = 4
CALL PXFGETPWNAM(name,ilen,jpasswd,ierror)
if (ierror .eq. 0) then
   print *,'PASSED: pxfgetpwnam call'
      else
   print *,'FAILED: pxfgetpwnam call with error = ',ierror
endif
CALL PXFSTRUCTFREE(jpasswd,ierror)
end

SEE ALSO

getpwnam(3c), PXFSTRUCTCREATE(3F), PXFSTRUCTFREE(3F)