diff options
Diffstat (limited to 'gss-serv-krb5.c')
-rw-r--r-- | gss-serv-krb5.c | 35 |
1 files changed, 4 insertions, 31 deletions
diff --git a/gss-serv-krb5.c b/gss-serv-krb5.c index 91d87f798..4f02621dd 100644 --- a/gss-serv-krb5.c +++ b/gss-serv-krb5.c | |||
@@ -65,9 +65,6 @@ ssh_gssapi_krb5_init(void) | |||
65 | logit("Cannot initialize krb5 context"); | 65 | logit("Cannot initialize krb5 context"); |
66 | return 0; | 66 | return 0; |
67 | } | 67 | } |
68 | #ifdef KRB5_INIT_ETS | ||
69 | krb5_init_ets(krb_context); | ||
70 | #endif | ||
71 | 68 | ||
72 | return 1; | 69 | return 1; |
73 | } | 70 | } |
@@ -131,34 +128,10 @@ ssh_gssapi_krb5_storecreds(ssh_gssapi_client *client) | |||
131 | return; | 128 | return; |
132 | } | 129 | } |
133 | #else | 130 | #else |
134 | { | 131 | if ((problem = ssh_krb5_cc_gen(krb_context, &ccache))) { |
135 | int tmpfd; | 132 | logit("ssh_krb5_cc_gen(): %.100s", |
136 | char ccname[40]; | 133 | krb5_get_err_text(krb_context, problem)); |
137 | mode_t old_umask; | 134 | return; |
138 | |||
139 | snprintf(ccname, sizeof(ccname), | ||
140 | "FILE:/tmp/krb5cc_%d_XXXXXX", geteuid()); | ||
141 | |||
142 | old_umask = umask(0177); | ||
143 | tmpfd = mkstemp(ccname + strlen("FILE:")); | ||
144 | umask(old_umask); | ||
145 | if (tmpfd == -1) { | ||
146 | logit("mkstemp(): %.100s", strerror(errno)); | ||
147 | problem = errno; | ||
148 | return; | ||
149 | } | ||
150 | if (fchmod(tmpfd, S_IRUSR | S_IWUSR) == -1) { | ||
151 | logit("fchmod(): %.100s", strerror(errno)); | ||
152 | close(tmpfd); | ||
153 | problem = errno; | ||
154 | return; | ||
155 | } | ||
156 | close(tmpfd); | ||
157 | if ((problem = krb5_cc_resolve(krb_context, ccname, &ccache))) { | ||
158 | logit("krb5_cc_resolve(): %.100s", | ||
159 | krb5_get_err_text(krb_context, problem)); | ||
160 | return; | ||
161 | } | ||
162 | } | 135 | } |
163 | #endif /* #ifdef HEIMDAL */ | 136 | #endif /* #ifdef HEIMDAL */ |
164 | 137 | ||