#include <krb5.h> void qkrb_add_kt_entry(char * keytab, char * principal, char * password, krb5_kvno version);Service Program Name: QSYS/QKRBGSS;
The qkrb_add_kt_entry() function allows you to add a keytab entry to a keytab file for a specified principal name. If a principal name and version number match an existing keytab entry, the entry is replaced.
Object | Authority Required |
---|---|
All directories in the path to the keytab file | *X |
Keytab file | *RW |
NULL | The new entry will be placed in the default keytab file. |
0 | Create the new entry with the default version value. |
Message ID | Error Message Text |
---|---|
CPE4ABB E | Network Authentication Service failed with return code &1. |
The following example will add a keytab entry to the default keytab file.
Note: By using the code examples, you agree to the terms of the Code license and disclaimer information.
#include <krb5.h> #include <string.h.h> int main(int argc, char *argv[]) { /* Add a keytab entry to the default keytab file for the */ /* specified principal. */ /* This program accepts 2 parameters: */ /* 1: Pointer to the principal name for the new keytab entry */ /* 2: Pointer to the password for the new keytab entry */ char *principal; char *password; /* Copy the address of the principal and the password to local */ /* variables. */ principal = argv[1]; password = argv[2]; /* Create the keytab entry for the specified principal. */ /* NOTE: When the first parameter, keytab, is set to NULL the */ /* default keytab file is used. The default file is */ /* commonly: */ /* /QIBM/UserData/OS400/NetworkAuthentication/keytab/krb5.keytab */ qkrb_add_kt_entry(NULL, principal, password); return; }
[ Back to top | Security APIs | UNIX-Type APIs | APIs by category ]