Bug 1161073

Summary: sshd sets KRB5CCNAME environment variable with a truncated value
Product: [Fedora] Fedora Reporter: ams
Component: opensshAssignee: Petr Lautrbach <plautrba>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: mattias.ellert, mgrepl, plautrba, tmraz
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: openssh-6.4p1-6.fc20 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-11-15 09:23:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
patch that corrects the calculation of bytes for authctxt->krb5_ccname none

Description ams 2014-11-06 10:44:05 UTC
Created attachment 954391 [details]
patch that corrects the calculation of bytes for authctxt->krb5_ccname

Description of problem:

After logging in with ssh, kerberos ticket cache is not found due to environment variable KRB5CCNAME being truncated (missing the last 2 characters).



Version-Release number of selected component (if applicable):
openssh-6.4p1-5


How reproducible:
Every time

Steps to Reproduce:
1. login via kerberos-enabled ssh 
2. 
3.

Actual results:
`klist` cannot find credentials cache because KRB5CCNAME does not have full file path

Expected results:
KRB5CCNAME should contain "FILE:/path/to/credentials_cache"


Additional info:
The bug was introduced with 'openssh-6.3p1-krb5-use-default_ccache_name.patch'

The calculation of the length (len) of authctxt->krb5_ccname is short by 2 bytes - it does not allow for the ':' or the terminating 0.
"""
len = strlen(authctxt->krb5_ticket_file) + strlen(ccache_type);
authctxt->krb5_ccname = xmalloc(len);
...
snprintf(authctxt->krb5_ccname, len, "%s:%s", ccache_type, authctxt->krb5_ticket_file);
"""

Comment 1 Petr Lautrbach 2014-11-06 14:54:07 UTC
Good catch, sir! Thanks for the report and the patch.

It's even case for the 'default_ccache_name = KEYRING:persistent:%{uid}'

Comment 2 Fedora Update System 2014-11-12 14:02:47 UTC
openssh-6.4p1-6.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/openssh-6.4p1-6.fc20

Comment 3 Fedora Update System 2014-11-13 18:10:22 UTC
Package openssh-6.4p1-6.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing openssh-6.4p1-6.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-14849/openssh-6.4p1-6.fc20
then log in and leave karma (feedback).

Comment 4 Fedora Update System 2014-11-15 09:23:47 UTC
openssh-6.4p1-6.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.