Commit Graph

91 Commits

Author SHA1 Message Date
Love Hornquist Astrand
687db64c56 Patch from Secure Endpoints/Asanka Herath for windows support 2009-12-21 08:45:28 +01:00
Love Hornquist Astrand
75aa4b44fa switch to rk_strerror_r 2009-12-13 11:42:12 -08:00
Ted Percival
bfcdeda3b4 Fix memory leak in fcc_move
This usually occurs when re-initializing a file credential
cache over the top of an existing one.

This was meant to be fixed in commit 48cb3aa by calling
fcc_destroy(), but that only unlinks the "from" file
(which was already renamed or unlinked) but still doesn't
free the in-memory credentials. Using fcc_close() instead of
fcc_destroy() frees the leaked in-memory credentials.

Signed-off-by: Love Hornquist Astrand <lha@h5l.org>
2009-12-10 23:35:44 +01:00
Love Hornquist Astrand
b3e86a1cb6 track kdc offset better 2009-11-22 12:25:15 -08:00
Love Hornquist Astrand
f5e2873be2 Use strerror_r 2009-10-12 09:34:37 -07: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
9c18bf414c use constants for cache types
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25063 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-04-03 04:08:09 +00:00
Love Hörnquist Åstrand
a7e136a5d7 use krb5_cc_new_unique, use constants for cache types
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25058 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-04-03 04:07:17 +00:00
Love Hörnquist Åstrand
53dcd1bdd3 test leak and make behavie sanely.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25025 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-04-03 04:00:51 +00:00
Love Hörnquist Åstrand
48cb3aa538 plugs leaks
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@25021 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-04-03 03:59:54 +00:00
Love Hörnquist Åstrand
5e4d827e61 Patch from Riverbed (Derrick Pallas) under the license of the files they are in:
Fix resource leak in heimdal/krb5/fcache/fcc_remove_cred
	In fcache, fcc_remove_cred generates a ccache called
	"newfile," which is not cleaned up if the final call
	(krb5_cc_move) fails.

Free of uninitialized value in fcache/fcc_move(...)
	If init_fcc fails to acquire a file handle, sp will be
	uninitialized. If this is the case, the call to
	krb5_storage_free will dereference this uninitialized value,
	which causes undefined behaviour.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24944 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-03-25 15:37:21 +00:00
Love Hörnquist Åstrand
d9a3a6a070 export _krb5_erase_file
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24450 ec53bebd-3082-4978-b11e-865c3cabbd6b
2009-01-25 00:46:06 +00:00
Love Hörnquist Åstrand
06e31e6376 handle krb5_cc_default_name() returning NULL in a diffrent way.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24029 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-11-12 04:18:50 +00:00
Love Hörnquist Åstrand
f9d5a05854 krb5_cc_default_name() can fail if the configuration file is strange.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24025 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-11-12 04:18:04 +00:00
Love Hörnquist Åstrand
9aa9efb279 make get_default_name have a better name
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23959 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-10-26 18:21:11 +00:00
Love Hörnquist Åstrand
7811db9c1f add lastmodified
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23923 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-10-18 21:14:54 +00:00
Love Hörnquist Åstrand
03babea1e3 switch to krb5_clear_error_message
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23911 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-10-14 02:55:39 +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
29047d38f3 strings should be i18n
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23769 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-09-07 21:21:18 +00:00
Love Hörnquist Åstrand
7b5981996c sprinle O_CLOEXEC, from Andrew Bartlett
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23474 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-07-28 08:49:43 +00:00
Love Hörnquist Åstrand
30e523c1a5 close-on-exec
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23444 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-07-27 12:07:47 +00:00
Love Hörnquist Åstrand
7fcd266fdd use krb5_set_error_message
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23316 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-06-23 04:32:32 +00:00
Love Hörnquist Åstrand
d542833a1f use krb5_set_error_message
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23280 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-06-23 03:26:18 +00:00
Love Hörnquist Åstrand
3b7ff465c1 Add declspec for Windows
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23026 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-04-17 10:02:03 +00:00
Love Hörnquist Åstrand
96ece475a2 get_version returns an int, update
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22985 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-04-15 15:54:57 +00:00
Love Hörnquist Åstrand
331b920fdc Add version number to krb5_cc_ops
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22845 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-04-07 11:48:51 +00:00
Love Hörnquist Åstrand
fd298c28c9 Make the remove cred slight more atomic, now it might lose creds, but
there will be no empty cache at any time.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22832 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-04-07 11:47:49 +00:00
Love Hörnquist Åstrand
ab73d921f4 Make the storing credential an atomic write(2) to avoid signal races,
bug traced by Harald Bart and Lars Malinowsky.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22792 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-03-26 14:43:11 +00:00
Love Hörnquist Åstrand
56663c51c4 Make erase_file() to locking too.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22789 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-03-25 20:56:02 +00:00
Love Hörnquist Åstrand
24faee83cd (fcc_move): more explict why the fcc_move failes, handle cross device links.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22517 ec53bebd-3082-4978-b11e-865c3cabbd6b
2008-01-24 11:45:51 +00:00
Love Hörnquist Åstrand
473b2e044b Use HAVE_FCNTL for both lock and unlock, from Hai Zaar.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22194 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-12-07 02:23:00 +00:00
Love Hörnquist Åstrand
75399b34c3 (fcc_move): make sure ->version is uptodate.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22120 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-12-03 22:36:59 +00:00
Love Hörnquist Åstrand
1cdcbe1493 Implement krb5_cc_ops->default_name.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22101 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-12-03 17:15:27 +00:00
Love Hörnquist Åstrand
64cf3425d8 Implement the move operation.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22093 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-12-03 12:44:40 +00:00
Love Hörnquist Åstrand
7a39e6f7d9 doxygen documentation
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22030 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-11-10 10:38:15 +00:00
Love Hörnquist Åstrand
38251964e0 (init_fcc): provide better error codes
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21977 ec53bebd-3082-4978-b11e-865c3cabbd6b
2007-10-18 20:09:22 +00:00
Love Hörnquist Åstrand
4a924643eb (fcc_get_cache_next): avoid const warning.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19379 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-12-15 21:35:52 +00:00
Love Hörnquist Åstrand
0c000a62f7 Support "iteration" of file credential caches by giving the user back
the default file credential cache and only that.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19349 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-12-15 16:48:28 +00:00
Love Hörnquist Åstrand
a699632a9e (fcc_gen_new): fix a use after free, found by IBM checker.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16936 ec53bebd-3082-4978-b11e-865c3cabbd6b
2006-04-02 01:04:37 +00:00
Love Hörnquist Åstrand
a20802f00e Revert previous, I was confused.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15927 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-08-12 13:31:19 +00:00
Love Hörnquist Åstrand
d48840959b (fcc_store_cred): default to MIT style ticket flags.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15924 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-08-12 10:11:47 +00:00
Love Hörnquist Åstrand
c3579d1f6c rename to avoid shadowing
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15446 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-06-16 20:25:20 +00:00
Love Hörnquist Åstrand
ea4a3e5660 When returning a new error code, either set error string or clear it
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15327 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-05-31 22:06:15 +00:00
Love Hörnquist Åstrand
14747af538 (_krb5_xunlock): catch the error and turn it into something sensable
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15325 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-05-31 21:48:57 +00:00
Love Hörnquist Åstrand
fd9149ac7d (fcc_get_first): check return value from malloc, memset the structure,
make sure cursor doesn't point to freed memory on failure.
From: Wynn Wilkes <wwilkes@vintela.com>


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@15164 ec53bebd-3082-4978-b11e-865c3cabbd6b
2005-05-17 17:46:46 +00:00
Johan Danielsson
9125cb5647 Fix the cache flags bitorder issue with a storage flag instead of a
separate function.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@13767 ec53bebd-3082-4978-b11e-865c3cabbd6b
2004-04-24 21:17:02 +00:00
Love Hörnquist Åstrand
b209d68f8c (fcc_remove_cred): simplistic implementation, XXX add locking
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@13730 ec53bebd-3082-4978-b11e-865c3cabbd6b
2004-04-17 17:09:31 +00:00
Love Hörnquist Åstrand
39dc6f4fa5 (fcc_store_cred): NULL terminate krb5_config_get_bool_default' arglist
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@13502 ec53bebd-3082-4978-b11e-865c3cabbd6b
2004-03-10 13:28:15 +00:00
Love Hörnquist Åstrand
cd4be77fc7 (fcc_store_cred): use [libdefaults]fcc-mit-ticketflags=boolean to
decide what format to write the fcc in. Default to mit version (aka
heimdal 0.7)


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@13486 ec53bebd-3082-4978-b11e-865c3cabbd6b
2004-03-09 17:40:05 +00:00