Bug 445 - User DCE Credentials do not get forwarded to child session
Summary: User DCE Credentials do not get forwarded to child session
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Kerberos support (show other bugs)
Version: -current
Hardware: Alpha OSF/1
: P2 normal
Assignee: OpenSSH Bugzilla mailing list
URL:
Keywords: patch
Depends on:
Blocks: 914
  Show dependency treegraph
 
Reported: 2002-11-27 06:41 AEDT by Dr. Kenneth D. Matney, Sr.
Modified: 2005-03-10 09:07 AEDT (History)
0 users

See Also:


Attachments
diff -u session.c session.c.orig (614 bytes, text/plain)
2003-01-08 01:50 AEDT, Dr. Kenneth D. Matney, Sr.
no flags Details
Copy KRB5CCNAME for Tru64/SIA too (3.05 KB, patch)
2004-04-14 16:59 AEST, Darren Tucker
djm: ok+
Details | Diff
Simpler alternative patch (1.02 KB, patch)
2004-05-04 22:36 AEST, Darren Tucker
no flags Details | Diff
Always unset KRB5CCNAME too. (1.75 KB, patch)
2004-05-07 09:45 AEST, Darren Tucker
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dr. Kenneth D. Matney, Sr. 2002-11-27 06:41:48 AEDT
Under OSF/1, DCE credentials are created in the SIA layer for the
parent when the user log's in with a password.  These credentials
do not get forwarded to the child session.  This can be done via
passing an environmental variable from parent to child in session.c.

The following fix accomplishes this functionality and is basically
a NO-OP in the event that the required environmental variable is
not present:
	[kmy@gazelle:/dfs/sys/packages/ssh/openssh-3.4p1/alpha_tru64_v510] diff
session.c.orig session.c 
	940c940
	<       char **env;
	---
	>       char **env, *dcecreds;
	954a955,958
	> 
	> /*    Propagate DCE credentials to child .. kmy@ornl.gov            */
	>       if( (dcecreds=getenv("KRB5CCNAME")) )
	>               child_set_env( &env, &envsize, "KRB5CCNAME", dcecreds );
	[kmy@gazelle:/dfs/sys/packages/ssh/openssh-3.4p1/alpha_tru64_v510] 

With this fix installed, users may use native DFS without
the complexity of having to perform a dce_login in addition
to their normal login, because the child now has access to
the file containing the credentials of the parent and accepts
them as their credentials.
are sent to the
Comment 1 Damien Miller 2003-01-07 12:20:38 AEDT
The attached patch has been corrupted - please attach it (in "diff -u" format)
to the bug using the "Create Attachment" link
Comment 2 Dr. Kenneth D. Matney, Sr. 2003-01-08 01:50:02 AEDT
Created attachment 197 [details]
diff -u session.c session.c.orig

Output of "diff -u" attached as requested.
-- Ken Matney, Sr.
Comment 3 Damien Miller 2003-05-15 21:39:08 AEST
I am not sure I understand (my Kerberos knowledge isn't so great):

We already set this for Krb5 auth:

#ifdef KRB5
	if (s->authctxt->krb5_ticket_file)
		child_set_env(&env, &envsize, "KRB5CCNAME",
		    s->authctxt->krb5_ticket_file);
#endif



Comment 4 Simon Wilkinson 2003-05-21 00:49:13 AEST
The existing code only handles the situation where Kerberos
credentials are created by the OpenSSH's krb5 code. What would appear
to be happening under OSF/1 is that one of the calls used to verify
the users login is, as a by-product, creating the credentials cache.

When the child is forked, this environment information is being lost. We
already handle the case for Cygwin where we have to propagate the parents 
environment to the child - this is just a special case of that.
Comment 5 Dr. Kenneth D. Matney, Sr. 2003-05-21 01:11:26 AEST
I am no longer running OSF1; although, I may
have to do so in the future.  The last comment
on propagating parent's  environment to the
child is mostly correct.  The call to
sia_ses_init creates a KRB5 ticket which
contains authorization/authentication for
the parent.  This ticket information needs
to be propagated to the child.

Actually, this is the proper way to handle
OSF1 SIA; since, the operating system SIA
layer is run-time configurable by design
and you do not really want to pass
the user's password to KRB5 a second time.

This is to say that the file, /etc/sia/matrix.conf
tells the OS about whether or not DCE is a valid
authentication/authorization method.  In the event
that DCE is being used, the parent's authorizations
do need to be propagated to the child.  However, we
also must deal with the case wherein DCE is no longer
a valid mechanism.  In this case, the parent will
not have an authorization to propagate.
-- 
Ken Matney, Sr.
Comment 6 Dr. Kenneth D. Matney, Sr. 2003-05-21 01:14:27 AEST
Oops!  That should have been sia_ses_authent
instead of sia_ses_init.  And sia_ses_release
does not destroy the credential (also by design).
-- 
Ken Matney, Sr.
Comment 7 Darren Tucker 2004-04-14 13:34:49 AEST
There's a special case for copying KRB5CCNAME for AIX (because its auth modules
might set it), so perhaps we just need to add a case for Tru64+SIA?
Comment 8 Darren Tucker 2004-04-14 13:43:21 AEST
Target for early openssh-3.9
Comment 9 Darren Tucker 2004-04-14 16:59:28 AEST
Created attachment 603 [details]
Copy KRB5CCNAME for Tru64/SIA too
Comment 10 Damien Miller 2004-04-14 17:05:07 AEST
Comment on attachment 603 [details]
Copy KRB5CCNAME for Tru64/SIA too

Looks good to me. Assuming that it fixes the problem, then OK to commit.
Comment 11 Darren Tucker 2004-05-04 22:36:15 AEST
Created attachment 626 [details]
Simpler alternative patch

Always check for KRB5CCNAME, since there are other instances where this is
needed (eg PAM in some configurations).  See:
http://marc.theaimsgroup.com/?m=108366671611466
Comment 12 Darren Tucker 2004-05-07 09:45:44 AEST
Created attachment 628 [details]
Always unset KRB5CCNAME too.
Comment 13 Darren Tucker 2004-08-17 19:04:29 AEST
BTW, if anyone uses OSF1/DUnix/Tru64 with DCE or another platform with the same
issue, could you please confirm if the patch resolves it?
Comment 14 Darren Tucker 2005-02-01 19:54:41 AEDT
I tested this with a fake KRB5CCNAME and it worked as expected.  Since
essentially the same code is already enabled for AIX, I'm going to commit #628
unless someone objects.
Comment 15 Darren Tucker 2005-02-02 18:31:31 AEDT
#628 committed.  Thanks all.
Comment 16 Darren Tucker 2005-03-10 09:07:59 AEDT
With the release of OpenSSH 4.0, these bugs are now closed. For details, see:
http://www.openssh.com/txt/release-4.0