diff options
author | Darren Tucker <dtucker@zip.com.au> | 2004-08-14 23:55:37 +1000 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2004-08-14 23:55:37 +1000 |
commit | 066969339dcd0352965de0ab1b5f693cf2a7fee8 (patch) | |
tree | df36cda53b0cb0050084516295cd1529e48f01ef /gss-serv-krb5.c | |
parent | a763105c0f6e4d58f2e477597d1cf5ca5317b1a1 (diff) | |
download | openssh-git-066969339dcd0352965de0ab1b5f693cf2a7fee8.tar.gz |
- (dtucker) [auth-krb5.c gss-serv-krb5.c openbsd-compat/xmmap.c]
Explicitly set umask for mkstemp; ok djm@
Diffstat (limited to 'gss-serv-krb5.c')
-rw-r--r-- | gss-serv-krb5.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gss-serv-krb5.c b/gss-serv-krb5.c index 6bd5830f..91d87f79 100644 --- a/gss-serv-krb5.c +++ b/gss-serv-krb5.c @@ -134,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; |