]> andersk Git - openssh.git/blobdiff - gss-serv-krb5.c
- (dtucker) [regress/multiplex.sh] Use "kill -0 $pid" to check for the
[openssh.git] / gss-serv-krb5.c
index 7373beb6defdd82d450a0edda0a860977fd8cc9c..91d87f798f8319978b7c32f7c39fcecfd89a52dc 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: gss-serv-krb5.c,v 1.2 2003/11/21 11:57:03 djm Exp $   */
+/*     $OpenBSD: gss-serv-krb5.c,v 1.3 2004/07/21 10:36:23 djm Exp $   */
 
 /*
  * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved.
 extern ServerOptions options;
 
 #ifdef HEIMDAL
-#include <krb5.h>
+# include <krb5.h>
 #else
-#include <gssapi_krb5.h>
+# ifdef HAVE_GSSAPI_KRB5
+#  include <gssapi_krb5.h>
+# elif HAVE_GSSAPI_GSSAPI_KRB5
+#  include <gssapi/gssapi_krb5.h>
+# endif
 #endif
 
 static krb5_context krb_context = NULL;
@@ -49,7 +53,7 @@ static krb5_context krb_context = NULL;
 /* Initialise the krb5 library, for the stuff that GSSAPI won't do */
 
 static int
-ssh_gssapi_krb5_init()
+ssh_gssapi_krb5_init(void)
 {
        krb5_error_code problem;
 
@@ -61,7 +65,9 @@ ssh_gssapi_krb5_init()
                logit("Cannot initialize krb5 context");
                return 0;
        }
+#ifdef KRB5_INIT_ETS
        krb5_init_ets(krb_context);
+#endif
 
        return 1;
 }
@@ -128,11 +134,15 @@ ssh_gssapi_krb5_storecreds(ssh_gssapi_client *client)
        {
                int tmpfd;
                char ccname[40];
+               mode_t old_umask;
 
                snprintf(ccname, sizeof(ccname),
                    "FILE:/tmp/krb5cc_%d_XXXXXX", geteuid());
 
-               if ((tmpfd = mkstemp(ccname + strlen("FILE:"))) == -1) {
+               old_umask = umask(0177);
+               tmpfd = mkstemp(ccname + strlen("FILE:"));
+               umask(old_umask);
+               if (tmpfd == -1) {
                        logit("mkstemp(): %.100s", strerror(errno));
                        problem = errno;
                        return;
This page took 0.037459 seconds and 4 git commands to generate.