Commit Graph

104 Commits

Author SHA1 Message Date
Roland C. Dowdeswell
f0f07ff408 Use krb5_enomem() more consistently in lib/krb5. 2013-02-13 16:15:00 +08:00
Nicolas Williams
ad7e54d698 Generalize token expansion to allow for context-specific tokens 2011-12-08 13:33:37 -06:00
Nicolas Williams
6aec02f979 Make krb5_kuserok() pluggable and add features (including MIT config compat) 2011-12-08 13:33:36 -06:00
Love Hornquist Astrand
0879b9831a remove trailing whitespace 2011-05-21 11:57:31 -07:00
Love Hornquist Astrand
492492e42a use new function krb5_einval instead of returning EINVAL directly 2011-05-18 21:59:23 -07:00
Jeffrey Altman
18b76b6236 fcache: prevent null pointer dereference
Validate krb5_ccache and krb5_cc_cursor inputs
before use.  Avoid null pointer dereference which
can occur if an application fails to properly check
return codes.

Change-Id: I8023808936e60cc7b8e57a062106cfcdc51ee7d7
2011-05-18 10:20:09 -04:00
Love Hornquist Astrand
f5f9014c90 Warning fixes from Christos Zoulas
- shadowed variables
- signed/unsigned confusion
- const lossage
- incomplete structure initializations
- unused code
2011-04-29 20:25:05 -07:00
Asanka Herath
4b36b36e0b Add roken/rename.c to fix non-standard rename()
roken/rename.c is for platforms where the native rename()
implementation does not replace the target if it already exists.  This
implementation isn't atomic, but should be close enough for most
purposes.

For correct behavior, rk_rename() should be used instead of rename().
rk_rename() is #defined to be rename() on platforms where this fix is
not necessary.
2010-09-14 08:03:34 -04:00
Asanka Herath
bd795255aa Fix fcc_remove_cred() on platforms with non-standard rename() 2010-09-14 08:03:31 -04:00
Asanka Herath
5dcc605f6b Fix calling conventions for Windows 2010-08-20 13:14:10 -04:00
Love Hornquist Astrand
0b2b9d9834 catch error from as.*printf 2010-05-30 14:12:39 -07:00
Love Hornquist Astrand
886914f8f9 always use _krb5_expand_path_tokens 2010-05-27 12:25:47 -05:00
Asanka Herath
b9567cb158 Don't attempt to release unallocated resource in fcc_move() 2010-05-26 10:38:43 -04: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
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