summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--auth-krb5.c12
2 files changed, 9 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 908dcd496..7ec760c64 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
120120426 120120426
2 - (djm) [auth-passwd.c] Handle crypt() returning NULL; from Paul Wouters 2 - (djm) [auth-passwd.c] Handle crypt() returning NULL; from Paul Wouters
3 via Niels 3 via Niels
4 - (djm) [auth-krb5.c] Save errno across calls that might modify it;
5 ok dtucker@
4 6
520120423 720120423
6 - OpenBSD CVS Sync 8 - OpenBSD CVS Sync
diff --git a/auth-krb5.c b/auth-krb5.c
index d019fe202..922c66c66 100644
--- a/auth-krb5.c
+++ b/auth-krb5.c
@@ -226,7 +226,7 @@ krb5_cleanup_proc(Authctxt *authctxt)
226#ifndef HEIMDAL 226#ifndef HEIMDAL
227krb5_error_code 227krb5_error_code
228ssh_krb5_cc_gen(krb5_context ctx, krb5_ccache *ccache) { 228ssh_krb5_cc_gen(krb5_context ctx, krb5_ccache *ccache) {
229 int tmpfd, ret; 229 int tmpfd, ret, oerrno;
230 char ccname[40]; 230 char ccname[40];
231 mode_t old_umask; 231 mode_t old_umask;
232 232
@@ -237,16 +237,18 @@ ssh_krb5_cc_gen(krb5_context ctx, krb5_ccache *ccache) {
237 237
238 old_umask = umask(0177); 238 old_umask = umask(0177);
239 tmpfd = mkstemp(ccname + strlen("FILE:")); 239 tmpfd = mkstemp(ccname + strlen("FILE:"));
240 oerrno = errno;
240 umask(old_umask); 241 umask(old_umask);
241 if (tmpfd == -1) { 242 if (tmpfd == -1) {
242 logit("mkstemp(): %.100s", strerror(errno)); 243 logit("mkstemp(): %.100s", strerror(oerrno));
243 return errno; 244 return oerrno;
244 } 245 }
245 246
246 if (fchmod(tmpfd,S_IRUSR | S_IWUSR) == -1) { 247 if (fchmod(tmpfd,S_IRUSR | S_IWUSR) == -1) {
247 logit("fchmod(): %.100s", strerror(errno)); 248 oerrno = errno;
249 logit("fchmod(): %.100s", strerror(oerrno));
248 close(tmpfd); 250 close(tmpfd);
249 return errno; 251 return oerrno;
250 } 252 }
251 close(tmpfd); 253 close(tmpfd);
252 254