qkrb_remove_kt_entry()--Remove Keytab Entry


  Syntax
 #include <krb5.h>

 void qkrb_remove_kt_entry(char *      keytab,
                           char *      principal,
                           krb5_kvno   version);
 
  Service Program Name: QSYS/QKRBGSS;

  Default Public Authority: *USE

  Threadsafe: Yes

The qkrb_remove_kt_entry() function allows you to remove keytab entries from a keytab file for a specified principal.


Authorities and Locks

Object Authority Required
All directories in the path to the keytab file *X
Keytab file *RW


Parameters

keytab  (Input)
The name of the keytab file from which the entry is removed.
NULL The keytab entries will be removed from the default keytab file.

principal  (Input)
The principal name of the keytab entry being removed.

Note: If the realm name is not included in the specified principal name, the default realm will be appended to the name.

version  (Input)
The version number of the keytab entry being removed.
0 Remove all versions of keytab entries from the keytab file.


Error Messages

Message ID Error Message Text
CPE4ABB E Network Authentication Service failed with return code &1.


Example

The following example will remove a keytab entry from 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[])
{
    /* Remove all the keytab entries from the default keytab file     */  
    /* for the specified principal.                                   */
    /* This program accepts 1 parameter:                              */
    /*   1: Pointer to the principal name of the entry being removed. */
   
    char *principal;

    /* Copy the address of the principal to a local variable.         */
    principal = argv[1];

    /* Remove all versions of the principal's keytab entries from the */
    /* default keytab file.                                           */
    /*   NOTES: 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  */
    /*                                                                */
    /*          When the third parameter, version, is set to 0 all    */
    /*          versions of the keytab entries will be removed.       */    
    qkrb_remove_kt_entry(NULL, principal, 0);

    return;
}


API introduced: V5R3

[ Back to top | Security APIs | UNIX-Type APIs | APIs by category ]