Bug 508 - Krb4/AFS token passing doesn't work because of mkstemp
Summary: Krb4/AFS token passing doesn't work because of mkstemp
Status: CLOSED DUPLICATE of bug 44
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sshd (show other bugs)
Version: -current
Hardware: All Linux
: P2 normal
Assignee: OpenSSH Bugzilla mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-13 08:50 AEDT by Kevin Sullivan
Modified: 2004-04-14 12:24 AEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Sullivan 2003-03-13 08:50:57 AEDT
In auth-krb4.c, in krb4_init(), we have:
        if ((fd = mkstemp(authctxt->krb4_ticket_file)) != -1) {

which tries to create a temporary file to hold kerberos tickets.  This file is
created some lines above by:
        snprintf(authctxt->krb4_ticket_file, MAXPATHLEN, "%s%u_%ld",
So, mkstemp() is passes something like "/tmp/tkt9036_6294", with no Xs at the end.

On a RedHat 8.0, mkstemp() will fail if the file template does not end with at
least 6 Xs.

To fix this, replace the mkstemp line with:

if ((fd = open(authctxt->krb4_ticket_file, O_RDWR|O_CREAT|O_EXCL, 0x600)) != -1) {
Comment 1 Damien Miller 2003-03-13 09:43:16 AEDT
Please search existing bug reports before submitting new bugs

*** This bug has been marked as a duplicate of 44 ***
Comment 2 Damien Miller 2004-04-14 12:24:18 AEST
Mass change of RESOLVED bugs to CLOSED