Commit Graph

30241 Commits

Author SHA1 Message Date
Nicolas Williams
06ba7b1597 test: When kdc fails to start, show the log
This is an attempt to find out why the GitHub Actions OS X build is
failing.
2022-01-20 14:32:17 -06:00
Nicolas Williams
7e67437594 GitHub: Add optional coverity build 2022-01-20 13:54:51 -06:00
Nicolas Williams
588e49a1bc kdc: Fix copy_Principal_ptr() bug (plugin acc.) 2022-01-20 13:32:31 -06:00
Nicolas Williams
681708f416 gsskrb5: Fix coverity issue 2022-01-20 13:28:57 -06:00
Nicolas Williams
62176f07d9 kuser: Fix coverity issues 2022-01-20 13:28:39 -06:00
Nicolas Williams
be6305b601 kadm5: Fix ENOMEM path leak 2022-01-20 12:41:39 -06:00
Nicolas Williams
b0fa256521 krb5: Fix coverity warning in krcache.c 2022-01-20 12:41:39 -06:00
Nicolas Williams
b991c4b2b3 hdb: Fix coverity warnings
This is a fix for a false positive that we can avoid by changing the
internal API in question.  Might as well.
2022-01-20 12:41:39 -06:00
Nicolas Williams
d1564ce6e9 kcm: Fix coverity issues 2022-01-20 12:41:39 -06:00
Jeffrey Altman
7ab7fdd269 update .gitignore 2022-01-20 12:49:19 -05:00
Jeffrey Altman
34e918f210 lib/krb5: unparse_name_fixed ERANGE if zero buffer len
The tests depend upon an ERANGE error for buffer length zero.
They broken due to 8324a2af1d
("lib/krb5: unparse_name_fixed error if invalid name buffer or length")
which returned EINVAL.

Change-Id: I81693f9d3f5fdc1838c11ffbfe0dafc742d9b207
2022-01-20 11:09:04 -05:00
Jeffrey Altman
d55abd8f50 lib/krb5: make_local_fast_ap_fxarmor requires a ccache
If make_local_fast_ap_fxarmor() is called without a ccache
it will segmentation fault.  Set a krb5 error message in the
context and fail with EINVAL.

Change-Id: I8a72a026dbae931e41498f55cd634ad2fee26772
2022-01-20 10:22:51 -05:00
Jeffrey Altman
966e98d50b lib/krb5: fcc_remove_cred return krb5_cc_end_seq_get failure
krb5_cc_end_seq_get() is not expected to fail because it is a
cleanup routine.  If it fails it indicates something wrong with
the cache or the system.  Return the failure if there is one.

Otherwise, the failure from krb5_cc_next_cred() should be
returned UNLESS it is KRB5_CC_END in which case return success.

Change-Id: I80e07103e2fb38aa40418a436fa5351fb89549d3
2022-01-20 10:06:11 -05:00
Jeffrey Altman
29940dd22c lib/krb5: krb5_init_creds_set_service fail if set_realm fails
Calls to krb5_principal_set_realm() can fail due to memory
allocation failures.  If the client realm cannot be set in
the generated principal the wrong realm will be used.
Check for the result of krb5_principal_set_realm() and if
there is a failure, clean up and return the error code to
the caller.

Change-Id: Icadd04c858e88c1ba1d4344c60a784885a6a1344
2022-01-20 09:44:43 -05:00
Jeffrey Altman
8324a2af1d lib/krb5: unparse_name_fixed error if invalid name buffer or length
If the output 'name' buffer is NULL or length is zero, there is
no place to unparse the principal name to.  Fail with EINVAL and
if possible set an error message on the krb5_context.

This avoids potential NULL pointer dereferences.

Change-Id: Ie38d284f1867be883a2f2e31103ea50cd130a0fe
2022-01-20 09:27:59 -05:00
Jeffrey Altman
8836e6a39d lib/krb5: krb5_vset_error_message is no-op if no krb5_context
Refactor krb5_vset_error_message() to remove the many conditional
tests on the existence of krb5_context.  If there is no krb5_context
then _krb5_debug() is a no-op.  Therefore, there is no point in
performing any of the other work.

Change-Id: Ib88b592a542a195f27e352a80ced0a98a6f85300
2022-01-20 09:09:27 -05:00
Luke Howard
e32f7a4387 kdc: add _nocopy setter for use by mssfu
Add an internal-use setter accessor for use by mssfu.c when principal names are
replaced. This also fixes a leak where r->client_princ was not freed before
being replaced with the impersonated client name.
2022-01-20 17:23:24 +11:00
Luke Howard
ec24edf700 kdc: add accessor functions for KDC request structure
Add accessor functions for use by Samba and other plugin developers.
Documentation is in kdc/kdc-accessors.h.
2022-01-20 17:23:24 +11:00
Luke Howard
ed4fe65794 base: change ret fieldname to error_code in request struct 2022-01-20 17:23:24 +11:00
Luke Howard
f4e936c893 include: fix token_validator_plugin.h typo
token_validator_plugin.h was also missing in Makefile.am:CLEANFILES.
2022-01-20 17:23:11 +11:00
Nicolas Williams
302250026c kdc: Do not announce via Bonjour when testing
Let's see if this fixes the GitHub Actions OS X CI.
2022-01-20 00:20:30 -06:00
Luke Howard
0c26edd468 include: add more generated files to CLEANFILES
take #2, fix build breakage.

Recently added features for Heimdal 8 did not update
include/Makefile.am:CLEANFILES appropriately.
2022-01-20 17:17:58 +11:00
Luke Howard
d74b411f12 Revert "include: add more generated files to CLEANFILES"
This reverts commit 622527d9ca.
2022-01-20 17:17:09 +11:00
Luke Howard
622527d9ca include: add more generated files to CLEANFILES
Recently added features for Heimdal 8 did not update
include/Makefile.am:CLEANFILES appropriately.
2022-01-20 17:15:51 +11:00
Nicolas Williams
9d0149d2f2 krb5: Context has to be opt. in for path tok. exp. 2022-01-19 23:49:06 -06:00
Nicolas Williams
1eda4920c8 krb5: Fix coverity warnings 2022-01-19 23:38:27 -06:00
Nicolas Williams
9203c4a3f4 ipropd: Ignore setsockopt() result 2022-01-19 23:37:32 -06:00
Nicolas Williams
4eec82dc52 ipc: Ignore setsockopt result 2022-01-19 23:37:01 -06:00
Nicolas Williams
dd2ad50fbf hdb: Make HDB-as-keytab get function match API
krb5_kt_get_entry() allows a NULL principal to be given ("match all").

The get method of the HDB-as-keytab keytab did not know this, and could
dereference a NULL as a result.
2022-01-19 23:35:19 -06:00
Nicolas Williams
cf19a0f8e3 krb5: Context must be optional for error functions
We pass a NULL context to error functions in CCAPI (lib/krb5/acache.c)
code paths.
2022-01-19 23:33:44 -06:00
Nicolas Williams
1e634df8a5 base: Context has to be optional in for path tok. exp.
We call path token expansion functions with a NULL context in CCAPI
(lib/krb5/acache.c).  We only need the context for errors.
2022-01-19 23:32:22 -06:00
Nicolas Williams
82e00128a2 base: Context has to be opt. in for error functions
This is needed so that it can be optional for path token expansion,
which has to have the context be optional for ccapi (lib/krb5/acache.c),
which in some cases calls path token expansion functions w/ a NULL
context.
2022-01-19 23:30:55 -06:00
Nicolas Williams
c650e37321 kdc: Fix leak caused by a1481f1f0 2022-01-19 17:32:16 -06:00
Nicolas Williams
03c69ffe1c GitHub: Use -Wnonnull for GCC build 2022-01-19 17:00:11 -06:00
Nicolas Williams
4a0e01f9ed kadm5: Add missing error checks 2022-01-19 16:57:06 -06:00
Nicolas Williams
97cef99f54 iprop: Fix coverity warnings 2022-01-19 16:53:45 -06:00
Nicolas Williams
1b213c1082 kadmind: Add missing error checks 2022-01-19 16:33:37 -06:00
Nicolas Williams
655c057769 kadm5: Add missing error checks 2022-01-19 16:33:17 -06:00
Nicolas Williams
9d6dd21256 iprop-log: Add missing error checks 2022-01-19 13:59:04 -06:00
Nicolas Williams
ff4c82cd47 kpasswdd: Fix leak of keytab on exit 2022-01-19 13:41:29 -06:00
Nicolas Williams
8c5030bcf7 gss: test_context: Fix leak 2022-01-19 12:35:08 -06:00
Nicolas Williams
26054d835c gss: Fix leak in gss-token 2022-01-19 12:33:11 -06:00
Nicolas Williams
abb9a46ccc kadmin: Add missing error check in init() 2022-01-18 15:41:43 -06:00
Nicolas Williams
fb4632edb1 krb5: Fix leak in test_ap-req.c 2022-01-18 15:40:54 -06:00
Nicolas Williams
b349b4add0 kdc: Fix recent dangling ptr; move more into r
As we move more and more state into astgs_request_t we need to be
careful not to leave locals and function arguments aliasing objects from
the astgs_request_t.
2022-01-18 15:32:05 -06:00
Nicolas Williams
3b0b9f2dfe krb5: Constify _krb5_principal2principalname() 2022-01-18 15:12:56 -06:00
Nicolas Williams
01848fe1de GitHub: Valgrind build: use LMDB
Let's see if the output from valgrind we're currently getting has to do
with BDB or if it's to do with Heimdal (I can't reproduce locally with
LDMB).
2022-01-18 12:35:26 -06:00
Nicolas Williams
f26bc69ded gss: Fix name attr leak in test_context 2022-01-18 12:35:26 -06:00
Nicolas Williams
0b137e3287 gss: Workaround valgrind "lifetime not equal" issue 2022-01-18 12:35:26 -06:00
Nicolas Williams
257be08bbb GitHub: Make valgrind build a debug build
To get line numbers from valgrind stack traces we need the valgrind
build to be a debug (-g) build.
2022-01-18 10:31:20 -06:00