Commit Graph

568 Commits

Author SHA1 Message Date
Viktor Dukhovni
d75e74b2d7 Avoid kinit NPE when default cred not in keytab 2014-07-22 17:57:17 -04:00
Jelmer Vernooij
ea062e4bb2 Remove references to KRBTKFILE from login.1 and kinit.1. 2014-06-02 00:32:37 +02:00
Jelmer Vernooij
7e81485562 Remove kerberos 4 references from kimpersonate.8. 2014-06-01 23:21:52 +02:00
Ken Dreyer
9dd7e27bf7 klist: fix spelling in comments 2014-05-28 14:34:06 -06:00
Jeffrey Altman
69c2872dbd kinit: get_switched_ccache
Provide a new internal function called get_switched() to encapsulate
the algorithm for selecting a credential cache when the selected
ccache type supports switching.  There is no change in behavior for
UNIX which always calls krb5_cc_new_unique().  However, on Windows
alternate behavior is provided when the ccache type is API or MSLSA.

For the API ccache the default ccache name is stored in the Windows
registry which is shared across all logon sessions belonging to a
user.  For users that are members of the Administrators group this
includes both the UAC restricted and elevated sessions sharing the
same desktop.  It is very disconcerting when the elevated session obtains
credentials for the same client principal as the restricted session
and then all apps in the restricted session lose access to their
credential cache.   For Windows, the API credential caches are named
after the principal that is stored within them.  It provides for a
better end user experience.

For the MSLSA ccache tickets belonging to multiple principals are
all stored within the MSLSA ccache.  As a result, all attempts to
switch ccache names default back to the one and only one name.

Change-Id: I7865cd044cff01ff38ab107ec0961e42788fa073
2014-05-14 21:52:35 -04:00
Ingo Schwarze
b7d384392b fix the kswitch(1) manual prologue
Signed-off-by: Love Hörnquist Åstrand <lha@h5l.org>
2014-01-31 08:38:04 +01:00
Viktor Dukhovni
b09e1a137b Use defrealm in last-resort parse of kt principal 2013-10-11 20:54:46 -04:00
Viktor Dukhovni
c6548bc166 Don't deref NULL pointer with klist -t 2013-10-03 20:41:49 -04:00
Love Hornquist Astrand
1b39c562d5 use STDERR_FILENO instead of 2 2013-09-27 08:24:51 -07:00
Viktor Dukhovni
2ccdebdacc Fix kinit renew vs. new strategy.
The previous code never obtained a new TGT when -l was not used.
2013-09-23 11:02:08 -04:00
Nicolas Williams
129b4f3720 Fix warning in ! NO_AFS case 2013-09-12 12:14:42 -05:00
Nicolas Williams
c9d390acac Don't use "if (!ret)" 2013-09-12 12:14:41 -05:00
Nicolas Williams
8696739102 Add SIGINFO support for kinit cmd
Use SIGUSR1 if there's no SIGINFO, so the code isn't dead.
2013-09-12 12:14:41 -05:00
Nicolas Williams
6d5741d03b kinit cmd: back-off more slowly and warn
Also refactor AFS klog code so we do it only once on renew.
2013-09-12 12:14:41 -05:00
Nicolas Williams
79ca0dfe75 kinit should save cc configs if it krb5_cc_move()s
Also, renew_validate() should krb5_cc_new_unique() and krb5_cc_move() it
into place.
2013-09-12 12:14:41 -05:00
Nicolas Williams
8ce9a1d686 Allow batch mode in kinit with password file 2013-09-12 12:14:41 -05:00
Nicolas Williams
13c8a2c212 Make kinit cmd not exit on transient errors 2013-09-12 12:14:40 -05:00
Nicolas Williams
c5867bde0e Add options to kcpytkt and kdeltkt for exp tix 2013-09-12 12:14:40 -05:00
Nicolas Williams
d03e8cd91d Use krb5_timeofday() in kuser/copy_cred_cache.c 2013-09-12 12:14:40 -05:00
Love Hornquist Astrand
3e0fd6449e /sess-/session-/g since a few extra letter makes it easier to understand 2013-09-03 21:56:04 -07:00
Harald Barth
502b33ca7f kimpersonate sessionkeyoption and afsdes
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2013-09-03 21:53:31 -07:00
Love Hornquist Astrand
a1168815ec use krb5_cc_get_lifetime 2013-07-16 14:42:24 +02:00
Love Hornquist Astrand
060474df16 quel 64bit warnings, fixup implicit encoding for template, fix spelling 2013-06-03 21:46:20 -07:00
Viktor Dukhovni
2433496ea6 Simplify user_realm support by removing krb5_parse_name_flags_realm()
and setting the realm as necessary in the caller.
2013-05-16 23:15:00 -04:00
Viktor Dukhovni
3f3bcc2731 When user_realm is used by PAM, do likewise in kinit.
When PAM is configured to use a user_realm that is different from the
default realm, do likewise in kinit with bare user names or the default
principal computed from the login name.

Similarly, when using a keytab, if no realm is specified find the most
suitable match in the keytab file.
2013-05-16 00:32:08 -04:00
Love Hornquist Astrand
b2ff260e15 klist --json support 2013-05-07 16:47:45 -07:00
Viktor Dukhovni
39516c2fc5 Normalize kinit.c whitespace in preparation for user_realm support patch. 2013-05-02 01:39:22 -04:00
Roland C. Dowdeswell
a952dc2c52 Add -F to kinit for compatibility with MIT Kerberos. 2013-02-02 05:42:05 +08:00
Roland C. Dowdeswell
3ea8da179a Fix renewal/refresh logic when kinit is provided with a command.
1.  in ticket_lifetime() calculate the remaining lifetime
	    of the ticket rather than the requested lifetime.

	2.  in renew_func(), attempt to renew if the tickets are
	    renewable rather than only if --renewable is specified.

	3.  fix the call to renew_validate() in renew_func() to
	    specify renewable tickets if the original tickets are
	    renewable rather than only if --renewable is specified.

	4.  stop printing constant warnings to the terminal about
	    how tickets cannot be obtained if they expire, cannot
	    be renewed and we can't non-interactively obtain fresh
	    ones.  We limit it to a single warning.

	5.  after the tickets expire, we backoff the requests to
	    obtain fresh tickets exponentially.
2012-10-17 01:32:43 +08:00
Roland C. Dowdeswell
b37b991a6f We need heimtools.c which I derived from kcc.c. 2012-03-06 17:22:29 +00:00
Roland C. Dowdeswell
635f5ef5b4 Make kinit print ``Password incorrect'' if it gets KRB5_GET_IN_TKT_LOOP. 2012-03-06 09:28:31 +00:00
Love Hörnquist Åstrand
9d6b30cb8b remove kcc droppings 2012-03-06 00:07:17 -08:00
Jelmer Vernooij
2b365b2327 Rename kcc to heimtools.
This should prevent naming clashes with other utilities named 'kcc'.

Signed-off-by: Love Hörnquist Åstrand <lha@h5l.org>
2012-03-06 00:06:26 -08:00
Roland C. Dowdeswell
cc47c8fa7b Turn on -Wextra -Wno-sign-compare -Wno-unused-paramter and fix issues.
We turn on a few extra warnings and fix the fallout that occurs
when building with --enable-developer.  Note that we get different
warnings on different machines and so this will be a work in
progress.  So far, we have built on NetBSD/amd64 5.99.64 (which
uses gcc 4.5.3) and Ubuntu 10.04.3 LTS (which uses gcc 4.4.3).

Notably, we fixed

	1.  a lot of missing structure initialisers,

	2.  unchecked return values for functions that glibc
	    marks as __attribute__((warn-unused-result)),

	3.  made minor modifications to slc and asn1_compile
	    which can generate code which generates warnings,
	    and

	4.  a few stragglers here and there.

We turned off the extended warnings for many programs in appl/ as
they are nearing the end of their useful lifetime, e.g.  rsh, rcp,
popper, ftp and telnet.

Interestingly, glibc's strncmp() macro needed to be worked around
whereas the function calls did not.

We have not yet tried this on 32 bit platforms, so there will be
a few more warnings when we do.
2012-02-20 19:45:41 +00:00
Roland C. Dowdeswell
df73c96b74 Populate creds in get_new_tickets before actually using it.
Signed-off-by: Love Hörnquist Åstrand <lha@h5l.org>
2012-01-29 20:58:12 -08:00
Love Hornquist Astrand
623bd64f0c use sl_did_you_mean 2011-11-22 12:18:48 -08:00
Love Hörnquist Åstrand
1a1bd736c0 merge support for FAST in as-req codepath 2011-10-28 19:25:48 -07:00
Nicolas Williams
e1be4482ac Improve kgetcred support for name canon rules and document 2011-10-22 14:54:26 -05:00
Nicolas Williams
a5e77c578e Deferred hostname canon using name canon rules 2011-10-22 14:54:13 -05:00
Jeffrey Altman
d6bff3199d add cache type column to kswitch output
Change-Id: I6b27ba6f7c853da56f81b45b312ef06e13f2dbb0
2011-09-26 01:56:14 -04:00
Jeffrey Altman
9081ab775f Windows: include KAFS when building kuser
if NO_AFS is not defined include the KAFS library when
building kuser.   the KAFS library does not yet build on
Windows but will in the future.

Change-Id: If2a6c7279d6166cc0f4c49d36f3fa54ad7d19d87
2011-09-20 16:16:09 -04:00
Stefan Metzmacher
57300e1482 kuser/kinit: make it possible to use --windows option on its own
metze

Signed-off-by: Love Hörnquist Åstrand <lha@h5l.org>
2011-07-30 11:56:46 -07:00
Love Hornquist Astrand
8a5c96e680 process last request and pass in server name 2011-07-24 20:24:38 -07:00
Love Hornquist Astrand
3f0a3c4795 Add fast armor bits 2011-07-24 20:24:37 -07:00
Love Hörnquist Åstrand
12403a31ce sprinkle more windows files 2011-07-23 11:18:21 -07:00
Love Hörnquist Åstrand
7aaba443bc add NTMakefile and windows directories 2011-07-17 12:16:59 -07:00
Love Hornquist Astrand
0879b9831a remove trailing whitespace 2011-05-21 11:57:31 -07:00
Thomas Klausner
97df66c0a0 Put Nd argument after Nd macro.
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2011-05-21 11:54:27 -07:00
Thomas Klausner
3772533acd Convert to UTF-8.
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2011-05-21 11:54:21 -07:00
Thomas Klausner
db8e287e41 Use "Fl Fl" for long options.
Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2011-05-21 11:54:14 -07:00