summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove -b6 and -old dump formatsGreg Hudson2013-02-041-590/+8
| | | | | | | Get rid of the code to dump and load -b6 and -old format dump files. Loading these versions hasn't worked since at least 1.3. ticket: 7564 (new)
* Add more tests for dump and loadGreg Hudson2013-02-048-26/+151
| | | | | | | | Move the existing dump/load tests from t_general.py to a new script t_dump.py. Add additional tests using pre-created dumpfiles, to exercise the -r18, -r13, -b7, and -ov formats. bigredbutton: whitespace
* Simplify kdb5_util create using a null passwordGreg Hudson2013-02-041-30/+7
| | | | | | kadm5_create_principal now uses a random key if passed a null password, so we don't need a multi-step process to create admin principals when creating a database any more.
* Fix kdb5_util dump.c uninitialized warningsGreg Hudson2013-02-011-1/+1
| | | | | | | | | | | | | Some versions of clang report an uninitialized variable warning (which we treat as an error) in process_k5beta_record. Due to the if-ladder style of the function, uninitialized tmpint values can be copied around in certain error cases, although the garbage values would be ultimately ignored. As a minimal fix, initialize the tmpint variables. ticket: 7560 (new) target_version: 1.11.1 tags: pullup
* Simplify LDAP password decodingGreg Hudson2013-02-012-113/+45
| | | | | | Make dec_password a static function in ldap_service_stash.c and remove some impedance mismatch with krb5_ldap_readpassword() by making it operate on C strings and return a krb5_error_code.
* Remove partial LDAP client cert supportGreg Hudson2013-01-314-138/+40
| | | | | | | | The LDAP KDB module has some code to interpret {FILE} values in stash files, and set the service_cert_path/pass fields in the ldap context. But there was no code to actually use those values to do client cert authentication, so it wasn't useful. Remove the partial implementation.
* Fix COPY_FIRST_CANONNAME hostent searchViktor Dukhovni2013-01-311-11/+11
| | | | | | | | | | | In fake-addrinfo.c, the COPY_FIRST_CANONNAME logic erroneously assumes that h_name is the same as h_aliases[0]. Look at h_name before h_aliases for an FQDN, since h_name is normally the forward-canonicalized name and h_aliases are not. [ghudson@mit.edu: rewrote commit message] ticket: 7556 (new)
* Revert previous change to process_tgs_reqGreg Hudson2013-01-311-1/+1
| | | | | | | | | Commit c072b059ecff257e7600be0e86869decd135d422 did not have the intended effect because, at the point where is_referral is set, request->server has already been modified to contain server->princ. ticket: 7555 status: open
* Fix is_referral flag in KDC TGS codeGreg Hudson2013-01-311-1/+1
| | | | | | | | | A server response which is a cross-realm TGT is not a referral if it was directly requested by the client. Misclassifying such a response as a referral means we don't mirror the request's name type, which has been observed to break older Java clients. ticket: 7555 (new)
* Fix prepend_err_str in LDAP KDB moduleGreg Hudson2013-01-291-3/+4
| | | | | | Use the oerr parameter to fetch the existing message. Stop handling oerr == 0, since no call sites were using it. Free the old error message before returning.
* Add LDAP debug DB optionGreg Hudson2013-01-283-0/+4
| | | | | | | Add a DB option in the LDAP KDB module to turn on debugging messages. Adapted from a patch by Zoran Pericic <zpericic@inet.hr>. ticket: 7551 (new)
* Refactor LDAP DB option parsing codeGreg Hudson2013-01-287-381/+169
| | | | | | | | | | krb5_ldap_open and krb5_ldap_create contain two large, almost identical blocks of DB option processing code. Factor it out into a new function krb5_ldap_parse_db_params in ldap_misc.c, and simplify the factored-out code. Create a helper function to add server entries and use it to simplify krb5_ldap_read_server_params as well as DB option parsing. Since the new DB option helper uses isspace instead of isblank, we no longer require portability goop for isblank.
* Make kproplog handle underfull iprop logsGreg Hudson2013-01-251-3/+4
| | | | | | | | | kproplog currently assumes that an iprop log is full once it has circled--which is true right now but will need to change for hierarchical slaves. Avoid this assumption by using the correct index modulus in print_update whether or not the log is full. Based on a patch from Richard Basch <basch@alum.mit.edu>.
* Check for negative poll timeout in k5_sendto_kdcGreg Hudson2013-01-251-0/+4
| | | | | | ticket: 7553 target_version: 1.11.1 tags: pullup
* Quiet kpropd.c signed/unsigned comparison warningsNicolas Williams2013-01-241-3/+3
| | | | [ghudson@mit.edu: simplify slightly]
* Adjust kdb5.c check for ulog being mappedGreg Hudson2013-01-241-1/+1
| | | | | | Check the ulog pointer, which is a little more direct, rather than the ulogfd field. (ulogfd is currently initialized to 0 prior to ulog_map; we could fix that instead, but this feels simpler.)
* Remove ulog_check(); the ulog is not a DB journalNicolas Williams2013-01-231-114/+6
| | | | | | | | | | | | | | | The db2 DB is not power-fail safe. There's no point trying to replay an incompletely committed entry from the ulog at kadmind startup time. For that matter, even if the db2 DB was power-fail safe there'd be no point replaying an uncommitted entry from the ulog as the libkadm5srv app (nor any client of it, as in the case of kadmind) will not have received any notice of success -- it'd be wrong to complete that operation later when the user thought it'd failed. [ghudson@mit.edu: merge with master, adjust comment] ticket: 7552 (new)
* Propagate policy changes over iprop via full dumpGreg Hudson2013-01-222-3/+81
| | | | | | | | Since iprop cannot carry policy changes, force a full resync to happen each time a policy change occurs. Based on a patch from Richard Basch <basch@alum.mit.edu>. ticket: 7522
* Verify iprop test results more thoroughlyGreg Hudson2013-01-222-47/+37
| | | | | | | In k5test.py, allow run_kadminl to take an environment argument. In t_iprop.py, perform some queries on the slaves after each propagation to spot-check that it got modifications from master. Use a helper function to check serial numbers for conciseness.
* Fix iprop log reinitializationGreg Hudson2013-01-228-42/+50
| | | | | | | | | | | | | | | | If the master iprop log is reinitialized to serial number 0, slaves will need to take a full dump--but after that happens, we need to know whether the slave has taken that full dump, we we don't offering full dumps indefinitely. So, record a timestamp in kdb_last_time when we reinitialize the log header, and compare the slave timestamp to kdb_last_time whenever it has the current serial number, even if it's 0. Test this by performing a propagation with sno 0 in t_iprop.py and detecting whether kpropd gets a second UPDATE_FULL_RESYNC_NEEDED response from kadmind. ticket: 7550 (new)
* Modernize style of kdb_log.cGreg Hudson2013-01-221-460/+292
| | | | | ulog_get_entries had an unreachable branch which was removed during de-indentation.
* Clean up iprop flow control in kdb5.cGreg Hudson2013-01-181-53/+42
| | | | | | | | | | | Add a helper predicate to determine whether to log operations. In the predicate, check if the ulog is actually mapped. Use a single cleanup label in krb5_db_put_principal. Use a cleanup label in krb5_db_delete_principal instead of releasing resources individually at each exit point. Avoid locking and unlocking the ulog if we're not logging (although it would be a no-op). Based on a patch from Nico Williams <nico@cryptonector.com>.
* Fix iprop safety net in kdb5_util loadGreg Hudson2013-01-171-2/+4
| | | | | | | | | The error message was missing a newline, and the exit behavior causes the database to be destroyed. ticket: 7370 target_version: 1.11.1 tags: pullup
* Get rid of krb5_read_realm_paramsGreg Hudson2013-01-166-251/+63
| | | | | | | Read realm parameters directly from the profile in the KDC's init_realm(), getting rid of the intermediate krb5_realm_params structure. Then get rid of krb5_realm_params and krb5_read_realm_params, since nothing else uses it.
* Remove KDC macros for realm config fieldsGreg Hudson2013-01-154-15/+9
| | | | | | Stop using macros to refer to kdc_realm_t fields, as they could conflict with structure field names for the same. Leave behind the kdc_context and tgs_server macros for now.
* Remove unused krb5_realm_params fieldsGreg Hudson2013-01-154-79/+1
| | | | | | | krb5_realm_params is only consumed by the KDC (everything else uses kadm5_config_params), so only needs to contain fields used by the KDC. Get rid of everything else. Also get rid of realm_profile, which is read in by KDC code but never used (and was never set anyway).
* Correct typo in krb5_responder_context_st descrZhanna Tsitkov2013-01-141-3/+4
| | | | responder_get_challenge() meant to be krb5_responder_get_challenge()
* Clean up style of alt_prof.cGreg Hudson2013-01-121-417/+354
| | | | | | Get rid of K&R-style function headers, format code and comments consistently according to current conventions, rename some variables using idiomatic names, and de-indent some nested control blocks.
* Flesh out responder context doxygen markupGreg Hudson2013-01-111-0/+30
|
* Use [out] more sparingly in doxygen markupGreg Hudson2013-01-111-107/+107
| | | | | | | | | In krb5.hin doxygen markup, only use [out] or [in,out] when a function changes the entire value of what the parameter points to, not when the function mutates a larger object (especially an abstract object). Also remove a couple of incorrect [in] annotations, change a few parameter descriptions to be more consistent, and fix one typo.
* Better doxygen markup for RESPONDER_QUESTION_OTPZhanna Tsitkov2013-01-111-21/+23
| | | | | | Doxygen and, consequently, Sphinx gets confused with the KRB5_RESPONDER_QUESTION_OTP comment layout. Also, mark the output parameter of krb5_responder_set_answer().
* Update copyright year in prototype sourcesBen Kaduk2013-01-112-2/+2
|
* Simplify KDC host referral codeGreg Hudson2013-01-118-157/+77
| | | | | | | | | | | Remove some unnecessary optimizations to reduce code complexity. Get rid of krb5_match_config_pattern in favor of a simpler helper function in do_tgs_req_c. Get rid of KRB5_CONF_ASTERISK and just use "*" instead. Use a helper function to combine [kdcdefaults] and realm subsection values of variables, and don't bother adding leading and trailing spaces. Consistently use the names "hostbased" and "no_referral" to refer to variable values (with a "realm_" prefix for structures which currently use it).
* Test multi-value host referral variablesGreg Hudson2013-01-111-5/+5
| | | | | | host_based_services and no_host_referral are allowed to have multiple relations in each place they appear, so alter a couple of the test cases to exercise that.
* Remove manual kdc_realm testsGreg Hudson2013-01-1119-720/+0
|
* Test KDC host-based referral supportGreg Hudson2013-01-114-11/+234
| | | | | | | Test the KDC host-based referral support in t_referral.py, using a new harness to call krb5_get_credentials with a specified server name type. Also use this new harness for the #7483 regression test, to avoid relying on an undocumented kvno extension.
* Add k5test support for KDC special environmentsGreg Hudson2013-01-111-11/+15
| | | | | | Accept environment parameters in the K5Realm start_kdc and start_kadmind methods, so that krb5kdc or kadmind can be started or restarted with a modified configuration.
* Clean up k5_locate_server error handlingGreg Hudson2013-01-111-25/+10
| | | | | | | | | | | profile_get_values() cannot return success with an empty list of values, so don't bother counting them. Return 0 from locate_srv_conf_1 if no profile values exist and from dns_locate_server if we decide not to make a SRV query. Adjust k5_locate_server to match the new helper behavior, and return KRB5_REALM_UNKNOWN if neither profile nor DNS come up with any answers (not KRB5_REALM_CANT_RESOLVE, which doesn't make sense now that we're deferring KDC hostname resolution).
* Fix no_host_referral concatention in KDCGreg Hudson2013-01-111-6/+7
| | | | | | | | | | | | | If no_host_referral is set in both [kdcdefaults] and the realm subsection, we're supposed to concatenate their values. But the logic in handle_referral_params would overwrite the value with the non-concatenated realm value. Similar bugs of this nature were fixed in 639c9d0f5a7c68dc98a2a452abc05ca32443cddf (r22037) but this one was missed. ticket: 7539 (new) target_version: 1.11.1 tags: pullup
* Get rid of adm.hGreg Hudson2013-01-106-243/+35
| | | | | | adm.h predates the ovsec kadm5 integration. It contains a bunch of obsolete defines and a redundant definition of krb5_realm_params. Get rid of it, and include <kadm5/admin.h> where we currently include it.
* make dependGreg Hudson2013-01-1077-582/+696
| | | | | Mostly this gets rid of the trailing space on line 2 after bb76891f5386526bdf91bc790c614fc9296cb5fa.
* Fold kadm5 internal policy functions into callersGreg Hudson2013-01-099-190/+9
| | | | | | | | | kadm5_create_policy and kadm5_modify_policy had _internal variants in libkadm5srv (but not libkadm5clnt) which only existed to protect the policy_refcnt field from modification over the wire. Now that policy_refcnt is no longer used, we don't need the separation. Bump the library soname since this is technically an ABI change.
* Test more policy featuresGreg Hudson2013-01-091-0/+77
| | | | | | Add tests to t_policy.py for password quality enforcement, password history (apart from the existing #7099 regression test), and for references to nonexistent policies.
* Consolidate policy tests into t_policy.pyGreg Hudson2013-01-094-77/+48
| | | | | Create a combined script for policy-related tests, and fold in the existing lockout, password history, and allowed-keysalts tests.
* Allow principals to refer to nonexistent policiesGreg Hudson2013-01-0913-664/+125
| | | | | | | | | | | | | | Stop using and maintaining the policy_refcnt field, and do not try to prevent deletion of a policy which is still referenced by principals. Instead, allow principals to refer to policy names which do not exist as policy objects; treat those principals as having no associated policy. In the kadmin client, warn if addprinc or modprinc tries to reference a policy which doesn't exist, since the server will no longer error out in this case. ticket: 7385
* Stop loading policy for pw_expiration in LDAPGreg Hudson2013-01-091-24/+0
| | | | | | | | | | | populate_krb5_db_entry() performs a subsidiary LDAP search to load the password policy, which it uses to update the pw_expiration field. This has some minimal value (it causes pw_expiration values in principals to auto-update whenever the pw_max_life field of a policy changes), but it's complicated, expensive, and inconsistent with the DB2 back end. Get rid of it. ticket: 7535 (new)
* Rename ccache configuration macrosZhanna Tsitkov2013-01-096-21/+21
| | | | | KRB5_CONF_ prefix should be used for the krb5/kdc.conf parameters. Use KRB5_CC_CONF_ prefix for cache configuration variables.
* Error on void pointer arithmetic with gccGreg Hudson2013-01-091-1/+1
| | | | | | Add -Werror=pointer-arith to the gcc warning flags. The equivalent was added to the Solaris compiler flags in 2dc1ef4078acd7ca463a8eee2ef20de54e672f37 (r21886).
* Fix void pointer arithmetic in oid_ops.cGreg Hudson2013-01-091-1/+1
| | | | | | | | When asserting that out has advanced the expected number of bytes in generic_gss_str_to_oid, avoid adding to oid->elements, which is a void pointer. Instead subtract from out and compare. ticket: 7524
* Fix various result checksNickolai Zeldovich2013-01-073-3/+3
| | | | | | | | | | | Correct three cases where the wrong expression was checked to see if an allocation function returned null. [ghudson@mit.edu: commit message, patch splitting] ticket: 7534 target_version: 1.11.1 tags: pullup