krb5_sname_to_principal()--Convert Service Name to a Kerberos Principal
Syntax
#include <krb5.h> krb5_error_code krb5_sname_to_principal( krb5_context context, krb5_const char * hostname, krb5_const char * sname, krb5_int32 type, krb5_principal * ret_princ);Service Program Name: QSYS/QKRBGSS
Default Public Authority: *USE
Threadsafe: Yes
The krb5_sname_to_principal() function converts a service name and a host name to a Kerberos principal. The principal name is in the format sname/hostname@realm. The realm name that corresponds to the host name is obtained by calling the krb5_get_host_realm() routine.
Not every coded character set identifier (CCSID) contains the '@' character; however, alternative CCSID values often are available. For example, instead of using Greece 423, run the job with a default CCSID of 875.
Authorities
No authorities are required.
Parameters
- context (Input)
- The Kerberos context.
- hostname (Input)
- The host containing the desired service instance. The local host is used if
NULL is specified for this parameter.
- sname (Input)
- The service name. The service name is set to the character string "host" if
NULL is specified for this parameter.
- type (Input)
- The type of host name provided as follows:
KRB5_NT_SRV_HST (x'00000003') A DNS host name has been provided. The Kerberos runtime looks up the address assigned to the host name and then does a reverse search to get the primary host name for that address. The resulting host name then is converted to lowercase. KRB5_NT_UNKNOWN (x'00000000') The host name type is unknown. No translation is performed on the specified host name and it is used as is.
- ret_princ (Output)
- The generated principal. The krb5_free_principal() routine should be called to release the principal when it is no longer needed.
Return Value
If no errors occur, the return value is 0. Otherwise, a Kerberos error code is returned.
Error Messages
Message ID | Error Message Text |
---|---|
CPE3418 E | Possible APAR condition or hardware failure. |
API introduced: V5R1
[ Back to top | Security APIs | UNIX-Type APIs | APIs by category ]