]> andersk Git - gssapi-openssh.git/blobdiff - openssh/gss-serv-krb5.c
enable PAM user switching
[gssapi-openssh.git] / openssh / gss-serv-krb5.c
index 17e7ab6c8c4d0d9acfb654ed299c679921f305ee..bea0eaebd25acc85797a42bc3e5b187edd47761c 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: gss-serv-krb5.c,v 1.4 2005/10/13 19:08:08 stevesk Exp $       */
+/* $OpenBSD: gss-serv-krb5.c,v 1.7 2006/08/03 03:34:42 deraadt Exp $ */
 
 /*
  * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved.
 #ifdef GSSAPI
 #ifdef KRB5
 
-#include "auth.h"
+#include <sys/types.h>
+
+#include <stdarg.h>
+#include <string.h>
+
 #include "xmalloc.h"
+#include "key.h"
+#include "hostfile.h"
+#include "auth.h"
 #include "log.h"
 #include "servconf.h"
 
+#include "buffer.h"
 #include "ssh-gss.h"
 
 extern ServerOptions options;
@@ -156,6 +164,7 @@ ssh_gssapi_krb5_storecreds(ssh_gssapi_client *client)
        OM_uint32 maj_status, min_status;
        gss_cred_id_t krb5_cred_handle;
        int len;
+       const char *new_ccname;
 
        if (client->creds == NULL) {
                debug("No credentials stored");
@@ -212,11 +221,16 @@ ssh_gssapi_krb5_storecreds(ssh_gssapi_client *client)
                return;
        }
 
-       client->store.filename = xstrdup(krb5_cc_get_name(krb_context, ccache));
+       new_ccname = krb5_cc_get_name(krb_context, ccache);
+
        client->store.envvar = "KRB5CCNAME";
-       len = strlen(client->store.filename) + 6;
-       client->store.envval = xmalloc(len);
-       snprintf(client->store.envval, len, "FILE:%s", client->store.filename);
+#ifdef USE_CCAPI
+       xasprintf(&client->store.envval, "API:%s", new_ccname);
+       client->store.filename = NULL;
+#else
+       xasprintf(&client->store.envval, "FILE:%s", new_ccname);
+       client->store.filename = xstrdup(new_ccname);
+#endif
 
 #ifdef USE_PAM
        if (options.use_pam)
This page took 0.033975 seconds and 4 git commands to generate.