Bug 1161073 - sshd sets KRB5CCNAME environment variable with a truncated value
Summary: sshd sets KRB5CCNAME environment variable with a truncated value
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: openssh
Version: 20
Hardware: All
OS: All
unspecified
unspecified
Target Milestone: ---
Assignee: Petr Lautrbach
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-11-06 10:44 UTC by ams
Modified: 2014-11-15 09:23 UTC (History)
4 users (show)

Fixed In Version: openssh-6.4p1-6.fc20
Clone Of:
Environment:
Last Closed: 2014-11-15 09:23:47 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
patch that corrects the calculation of bytes for authctxt->krb5_ccname (497 bytes, patch)
2014-11-06 10:44 UTC, ams
no flags Details | Diff

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.


Note You need to log in before you can comment on or make changes to this bug.