]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
- (djm) [auth-krb5.c] Save errno across calls that might modify it;
authorDamien Miller <djm@mindrot.org>
Wed, 25 Apr 2012 23:52:15 +0000 (09:52 +1000)
committerDamien Miller <djm@mindrot.org>
Wed, 25 Apr 2012 23:52:15 +0000 (09:52 +1000)
   ok dtucker@

ChangeLog
auth-krb5.c

index 908dcd496ec8e1a24fcbda1122a9ec8d62df3a89..7ec760c64744be9800ac13c5715c53708b891a9b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
 20120426
  - (djm) [auth-passwd.c] Handle crypt() returning NULL; from Paul Wouters
    via Niels
+ - (djm) [auth-krb5.c] Save errno across calls that might modify it;
+   ok dtucker@
 
 20120423
  - OpenBSD CVS Sync
index d019fe202c5ef8cf6670dffb44218253cf75bfec..922c66c669c8e37b831d0c805f11458e21e0ec88 100644 (file)
@@ -226,7 +226,7 @@ krb5_cleanup_proc(Authctxt *authctxt)
 #ifndef HEIMDAL
 krb5_error_code
 ssh_krb5_cc_gen(krb5_context ctx, krb5_ccache *ccache) {
-       int tmpfd, ret;
+       int tmpfd, ret, oerrno;
        char ccname[40];
        mode_t old_umask;
 
@@ -237,16 +237,18 @@ ssh_krb5_cc_gen(krb5_context ctx, krb5_ccache *ccache) {
 
        old_umask = umask(0177);
        tmpfd = mkstemp(ccname + strlen("FILE:"));
+       oerrno = errno;
        umask(old_umask);
        if (tmpfd == -1) {
-               logit("mkstemp(): %.100s", strerror(errno));
-               return errno;
+               logit("mkstemp(): %.100s", strerror(oerrno));
+               return oerrno;
        }
 
        if (fchmod(tmpfd,S_IRUSR | S_IWUSR) == -1) {
-               logit("fchmod(): %.100s", strerror(errno));
+               oerrno = errno;
+               logit("fchmod(): %.100s", strerror(oerrno));
                close(tmpfd);
-               return errno;
+               return oerrno;
        }
        close(tmpfd);