- (djm) [auth-krb5.c] Save errno across calls that might modify it;

ok dtucker@
This commit is contained in:
Damien Miller 2012-04-26 09:52:15 +10:00
parent 7584cb1ac4
commit 025bfd11d9
2 changed files with 9 additions and 5 deletions

View File

@ -1,6 +1,8 @@
20120426 20120426
- (djm) [auth-passwd.c] Handle crypt() returning NULL; from Paul Wouters - (djm) [auth-passwd.c] Handle crypt() returning NULL; from Paul Wouters
via Niels via Niels
- (djm) [auth-krb5.c] Save errno across calls that might modify it;
ok dtucker@
20120423 20120423
- OpenBSD CVS Sync - OpenBSD CVS Sync

View File

@ -226,7 +226,7 @@ krb5_cleanup_proc(Authctxt *authctxt)
#ifndef HEIMDAL #ifndef HEIMDAL
krb5_error_code krb5_error_code
ssh_krb5_cc_gen(krb5_context ctx, krb5_ccache *ccache) { ssh_krb5_cc_gen(krb5_context ctx, krb5_ccache *ccache) {
int tmpfd, ret; int tmpfd, ret, oerrno;
char ccname[40]; char ccname[40];
mode_t old_umask; mode_t old_umask;
@ -237,16 +237,18 @@ ssh_krb5_cc_gen(krb5_context ctx, krb5_ccache *ccache) {
old_umask = umask(0177); old_umask = umask(0177);
tmpfd = mkstemp(ccname + strlen("FILE:")); tmpfd = mkstemp(ccname + strlen("FILE:"));
oerrno = errno;
umask(old_umask); umask(old_umask);
if (tmpfd == -1) { if (tmpfd == -1) {
logit("mkstemp(): %.100s", strerror(errno)); logit("mkstemp(): %.100s", strerror(oerrno));
return errno; return oerrno;
} }
if (fchmod(tmpfd,S_IRUSR | S_IWUSR) == -1) { if (fchmod(tmpfd,S_IRUSR | S_IWUSR) == -1) {
logit("fchmod(): %.100s", strerror(errno)); oerrno = errno;
logit("fchmod(): %.100s", strerror(oerrno));
close(tmpfd); close(tmpfd);
return errno; return oerrno;
} }
close(tmpfd); close(tmpfd);