lib/krb5_wrap: Remove unused smb_krb5_get_creds
authorAndrew Bartlett <abartlet@samba.org>
Sun, 3 Jun 2012 08:58:31 +0000 (18:58 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Sun, 3 Jun 2012 11:04:06 +0000 (13:04 +0200)
Found by callcatcher

This has been unsused since

commit 61f0b247633501d6bf4103ca8345048e537c043d
Author: G√ľnther Deschner <gd@samba.org>
Date:   Thu Nov 12 15:42:03 2009 +0100

    s3-kerberos: remove smb_krb5_get_tkt_from_creds().

    Now that cli_krb5_get_ticket() already handles S4U2SELF impersonation, remove
    smb_krb5_get_tkt_from_creds() which is not required anymore.

    Guenther

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Sun Jun  3 13:04:06 CEST 2012 on sn-devel-104

lib/krb5_wrap/krb5_samba.c
lib/krb5_wrap/krb5_samba.h

index dc90f19075f5e6ba51effed59b67167ceeba158b..2d237ffa1242094b657f227ddaae798a24389032 100644 (file)
@@ -1436,126 +1436,6 @@ krb5_error_code smb_krb5_get_credentials(krb5_context context,
        return ret;
 }
 
-/*
- * smb_krb5_get_creds
- *
- * @brief Get krb5 credentials for a server
- *
- * @param[in] server_s         The string name of the service
- * @param[in] time_offset      The offset to the KDCs time in seconds (optional)
- * @param[in] cc               The krb5 credential cache string name (optional)
- * @param[in] impersonate_princ_s The string principal name to impersonate (optional)
- * @param[out] creds_p         The returned krb5_creds structure
- * @return krb5_error_code
- *
- */
-krb5_error_code smb_krb5_get_creds(const char *server_s,
-                                  time_t time_offset,
-                                  const char *cc,
-                                  const char *impersonate_princ_s,
-                                  krb5_creds **creds_p)
-{
-       krb5_error_code ret;
-       krb5_context context = NULL;
-       krb5_principal me = NULL;
-       krb5_principal server = NULL;
-       krb5_principal impersonate_princ = NULL;
-       krb5_creds *creds = NULL;
-       krb5_ccache ccache = NULL;
-
-       *creds_p = NULL;
-
-       initialize_krb5_error_table();
-       ret = krb5_init_context(&context);
-       if (ret) {
-               goto done;
-       }
-
-       if (time_offset != 0) {
-               krb5_set_real_time(context, time(NULL) + time_offset, 0);
-       }
-
-       ret = krb5_cc_resolve(context, cc ? cc :
-               krb5_cc_default_name(context), &ccache);
-       if (ret) {
-               goto done;
-       }
-
-       ret = krb5_cc_get_principal(context, ccache, &me);
-       if (ret) {
-               goto done;
-       }
-
-       ret = smb_krb5_parse_name(context, server_s, &server);
-       if (ret) {
-               goto done;
-       }
-
-       if (impersonate_princ_s) {
-               ret = smb_krb5_parse_name(context, impersonate_princ_s,
-                                         &impersonate_princ);
-               if (ret) {
-                       goto done;
-               }
-       }
-
-       ret = smb_krb5_get_credentials(context, ccache,
-                                      me, server, impersonate_princ,
-                                      &creds);
-       if (ret) {
-               goto done;
-       }
-
-       ret = krb5_cc_store_cred(context, ccache, creds);
-       if (ret) {
-               goto done;
-       }
-
-       if (creds_p) {
-               *creds_p = creds;
-       }
-
-       DEBUG(1,("smb_krb5_get_creds: got ticket for %s\n",
-               server_s));
-
-       if (impersonate_princ_s) {
-               char *client = NULL;
-
-               ret = smb_krb5_unparse_name(talloc_tos(), context, creds->client, &client);
-               if (ret) {
-                       goto done;
-               }
-               DEBUGADD(1,("smb_krb5_get_creds: using S4U2SELF impersonation as %s\n",
-                       client));
-               TALLOC_FREE(client);
-       }
-
- done:
-       if (!context) {
-               return ret;
-       }
-
-       if (creds && ret) {
-               krb5_free_creds(context, creds);
-       }
-       if (server) {
-               krb5_free_principal(context, server);
-       }
-       if (me) {
-               krb5_free_principal(context, me);
-       }
-       if (impersonate_princ) {
-               krb5_free_principal(context, impersonate_princ);
-       }
-       if (ccache) {
-               krb5_cc_close(context, ccache);
-       }
-       krb5_free_context(context);
-
-       return ret;
-}
-
-
 krb5_error_code smb_krb5_keyblock_init_contents(krb5_context context,
                                                krb5_enctype enctype,
                                                const void *data,
index bd348793741da94d6de186d76b5eee32a931c4b6..9db43b7535db845d9aa38260335d871e38f90003 100644 (file)
@@ -188,11 +188,6 @@ krb5_error_code smb_krb5_get_credentials(krb5_context context,
                                         krb5_principal server,
                                         krb5_principal impersonate_princ,
                                         krb5_creds **out_creds);
-krb5_error_code smb_krb5_get_creds(const char *server_s,
-                                  time_t time_offset,
-                                  const char *cc,
-                                  const char *impersonate_princ_s,
-                                  krb5_creds **creds_p);
 krb5_error_code smb_krb5_keyblock_init_contents(krb5_context context,
                                                krb5_enctype enctype,
                                                const void *data,