65 Commits

Author SHA1 Message Date
Nicolas Williams
6923b822b8 krb5: Fix leaks in test_cc.c 2022-02-11 16:02:27 -06:00
Nicolas Williams
584a2d3a2b krb5: Fix error clobbering in test_cc 2022-02-01 15:54:31 -06:00
Nicolas Williams
fb553dde1d krb5: Fix warnings 2022-01-14 17:10:16 -06:00
Nicolas Williams
66e256e672 krb5: Can't test KCM in test_cc 2022-01-02 22:16:06 -06:00
Nicolas Williams
af923957f6 krb5: Make test_cc w/ KEYRING more reliable
Joining a new keyring session every time seems to make it better.
2021-12-15 16:55:46 -06:00
Nicolas Williams
6f7c6a7f67 krb5: Fix out-of-tree SQLite3 ccache perms issue
SQLite3 defaults to 0644 unless overridden, relying on the process'
umask to make that tighter.

Our in-tree SQLite3 uses 0600 as the permissions for DB files it
creates.

Out-of-tree builds of SQLite3 probably get the 0644 default.

We can't change the umask in libraries -- it's not thread-safe.

So this commit changes the SCC ccache type's default ccname to include
an intermediate directory which is created with `mkdir(2)` with
permissions set to 0700, then it chmods the DB file to 0644.
2021-11-30 11:34:04 -06:00
Nicolas Williams
a025788a37 krb5: Make test_cc run keyctl new_session 2021-11-30 11:42:00 -05:00
Nicolas Williams
90db9b96a4 krb5: Make test_cc not step on user ccaches
And cleanup on exit.
2021-11-30 11:42:00 -05:00
Nicolas Williams
886cc6026c krb5: Remove uses of KRB5_USE_PATH_TOKENS 2020-05-28 00:49:55 -05:00
Nicolas Williams
f3e6c4ffd4 krb5: Make FILE ccache type a collection type! 2020-03-12 21:02:09 -05:00
Nicolas Williams
7bf4d76e75 krb5: Improve cccol sub naming; add gss_store_cred_into2()
- Formalize the TYPE:collection_name:subsidiary_name naming scheme for
   ccaches in ccache collections
    - KEYRING: ccaches are weird because they have one more optional field: the
      "anchor", so rather than just assume a naming convention everywhere, we
      add new functions as well
 - Add krb5_cc_{resolve,default}_sub() that allows one to specify a
   "subsidiary" ccache name in a collection separately from the
   collection name
 - Add krb5_cc_{resolve,default}_for() which take a principal name,
   unparse it, and use it as the subsidiary ccache name (with colons
   replaced)
 - Make kinit use the new interfaces
 - Add missing DIR ccache iteration functionality
 - Revamps test_cc
 - Add krb5_cc_get_collection() and krb5_cc_get_subsidiary()
 - Bump the ccops SPI version number
 - Add gss_store_cred_into2()
 - Make MEMORY:anonymous not linked into the global MEMORY ccache
   collection, and uses this for delegated cred handles

TBD:

 - Split this up into a krb5 change and gss mech_krb5 change?
 - Add krb5_cc_init_and_store() utility, per Greg's suggestion?
2020-03-02 17:48:04 -06:00
Roland C. Dowdeswell
b5449e6c97 disable test_cc on Windows 2019-11-20 18:14:44 -05:00
Nicolas Williams
621c68abea Improve krb5_cc_remove_cred() test 2019-10-03 13:09:18 -05:00
Nicolas Williams
ec84667763 Fix krb5_cc_move() issues
Move init/copy/destroy fallback sequence from fcc_move() to
krb5_cc_move().

Make sure all backends's move() method calls krb5_cc_destroy() on the
source on success (and only on success).

In text_cc make sure that we can find in the destination the cred
stored into the source.
2019-10-03 13:09:18 -05:00
Nicolas Williams
889617883d Make note in test_cc of how to keyctl new_session 2019-07-09 12:34:26 -05:00
Luke Howard
fb81598d44 krb5: port MIT Linux keyring credentials cache () 2018-12-24 18:17:32 +11:00
Luke Howard
862133e2da krb5: support %{username} path expansion token 2018-12-22 16:31:19 +11:00
Luke Howard
a6ce554c7a krb5: support %{euid} path expansion token 2018-12-22 16:04:32 +11:00
Nicolas Williams
ff0bdc9bc8 Test improved fcc_remove_cred() 2013-09-12 12:14:40 -05:00
Viktor Dukhovni
203e2beedd The DIR ccache code and tests don't quite work yet. 2013-05-16 00:34:36 -04:00
Love Hornquist Astrand
de61953108 handle creation of DIR caches 2013-04-29 22:54:11 -07: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
Love Hörnquist Åstrand
fb8c65a8c2 better logging 2011-07-23 11:44:42 -07:00
Love Hornquist Astrand
0879b9831a remove trailing whitespace 2011-05-21 11:57:31 -07:00
Love Hornquist Astrand
077357c848 catch error from as.*printf 2010-05-30 13:37:07 -07:00
Love Hornquist Astrand
687db64c56 Patch from Secure Endpoints/Asanka Herath for windows support 2009-12-21 08:45:28 +01:00
Love Hornquist Astrand
596bd00c9b wrap scc tests with have scc 2009-11-22 11:56:11 -08:00
Love Hörnquist Åstrand
942a821fab remove RCSID
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25171 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-05-04 06:17:40 +00:00
Love Hörnquist Åstrand
c30773819b rename SDB to SCC
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25074 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-04-03 04:10:03 +00:00
Love Hörnquist Åstrand
92017a2fd1 rename scache to scc
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25068 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-04-03 04:09:00 +00:00
Love Hörnquist Åstrand
88e7107177 use krb5_cc_new_unique, use constants for cache types
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25065 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-04-03 04:08:30 +00:00
Love Hörnquist Åstrand
d32a5564a6 use krb5_cc_new_unique, use constants for cache types
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25061 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-04-03 04:07:48 +00:00
Love Hörnquist Åstrand
38b93186dd use krb5_cc_new_unique, use constants for cache types
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25060 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-04-03 04:07:38 +00:00
Love Hörnquist Åstrand
5697c8e76c use krb5_cc_new_unique, use constants for cache types
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25059 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-04-03 04:07:28 +00:00
Love Hörnquist Åstrand
e9acb99d0e test krb5_cc_[sg]et_config, plug leaks
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25023 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-04-03 04:00:28 +00:00
Love Hörnquist Åstrand
6d190e9b9d check id returned from krb5_cccol_cursor_next
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24036 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-11-12 04:20:04 +00:00
Love Hörnquist Åstrand
d5e9266af3 make scache dependant on sqlite
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23994 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-10-26 18:27:35 +00:00
Love Hörnquist Åstrand
fe1a976ae2 new krb5_cc_cache_match
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23905 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-10-13 03:03:21 +00:00
Love Hörnquist Åstrand
6937d41a02 remove trailing whitespace
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23815 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-13 09:21:03 +00:00
Love Hörnquist Åstrand
e172367898 switch to utf8 encoding of all files
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23814 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-13 08:53:55 +00:00
Love Hörnquist Åstrand
6ebb98dd4a skip unknown types
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23322 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-06-24 23:49:39 +00:00
Love Hörnquist Åstrand
2abf5f2292 test remove
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22834 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-04-07 11:47:58 +00:00
Love Hörnquist Åstrand
dcc5363304 no test_init_vs_destroy for API: cache, more tests
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22823 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-04-07 11:47:12 +00:00
Love Hörnquist Åstrand
3a907b327a test acc and scc
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22820 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-04-07 11:46:58 +00:00
Love Hörnquist Åstrand
e9764e31f4 more verbose info.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22784 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-03-25 13:33:38 +00:00
Love Hörnquist Åstrand
e28ac4acd9 Test krb5_cc_move().
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22783 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-03-25 13:33:34 +00:00
Love Hörnquist Åstrand
d340f5fab3 update (c)
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22115 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-12-03 21:21:42 +00:00
Love Hörnquist Åstrand
5fed824f37 its vs it\'s etc. From Bjorn Sandell
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22071 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-11-14 20:04:50 +00:00
Love Hörnquist Åstrand
be1bf762ec plug memory leaks.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20842 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-06-03 14:21:32 +00:00
Love Hörnquist Åstrand
b04201d5d4 Make test work again.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18810 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-10-22 07:13:11 +00:00