aboutsummaryrefslogtreecommitdiff
path: root/src/util
AgeCommit message (Collapse)AuthorFilesLines
2021-07-12Fix argument type errors on WindowsGreg Hudson1-1/+1
Fix three Windows-specific argument type errors, including a crash bug in the default replay cache type. Change the compiler flags to treat several argument type warnings as errors. The replay cache bug was reported by Thomas Wagner. (cherry picked from commit 65b21aee6ab5e7d0851302b98647261c15c71c96) ticket: 9005 version_fixed: 1.19.2
2021-01-08Revert dns_canonicalize_hostname default to trueGreg Hudson1-0/+1
Field testing of dns_canonicalize_hostname=fallback (ticket 8911) revealed more disruptive edge cases than anticipated. Many were fixed by ticket 8930, but host-based GSS initiator names were recently discovered to not work, and one other edge case could not be resolved without a change to external code. Restore the default to true for now. Set the value to fallback in the test suite, to continue testing the desired configuration and to avoid restoring tests/resolve. (cherry picked from commit 15f8c4fd7d62d07ea2759a7b6d684c000430559e) ticket: 8973 version_fixed: 1.19
2020-10-22Use PKG_CHECK_MODULES for system library com_errAnonymous Maarten2-4/+4
[ghudson@mit.edu: whitespace changes; reverted man page change] ticket: 8957 (new)
2020-10-08Fix Python deprecation warningsGreg Hudson1-10/+5
Address all warnings issued by "python -Werror::DeprecationWarning" in the test suite and doc build, as of Python 3.8.2.
2020-09-07Rename master_kdc and iprop_master_ulogsizeGreg Hudson2-3/+3
Use "primary_kdc" and "iprop_ulogsize" as the preferred names of the two relations. Fall back to the old keys if the new ones are not set. ticket: 8921
2020-05-29Default dns_canonicalize_hostname to "fallback"Greg Hudson1-19/+6
This change should mitigate some of the pain caused by the rdns=true default (generally associated with unwanted PTR records that cannot easily be changed), with a minimum of fallout. Update the documentation and tests accordingly. In test environments, disable qualify_shortname and use the uncanonicalized system hostname (lowercased) to match the initial sn2princ result. ticket: 8911 (new)
2020-04-08Fix typos in commentsGreg Hudson3-7/+7
Correct comment spelling errors detected using codespell. Reported by Jens Schleusener.
2020-03-26make regenGreg Hudson1-0/+3
2020-03-25Add finalization safety check to com_errJiri Sasek1-1/+6
If the linker erroneously runs the libkrb5 finalizer after the libcom_err finalizer, the consequent remove_error_table() calls could crash due to accessing a destroyed mutex or an invalid et_list pointer. Add an unsynchronized check on finalized in remove_error_table(), and set et_list to null in com_err_terminate() after destroying the list. [ghudson@mit.edu: minimized code hanges; rewrote comment and commit message] ticket: 8890 (new)
2020-03-20Remove unused util/ss filesGreg Hudson7-431/+1
Delete the old C/yacc/lex sources for mk_cmds.
2020-03-12Fix typo in musl build fixGreg Hudson1-1/+1
Commit cbdbc8d00d31344fafe00e0fdf984e04e631f7c4 checked for __GLIBC__PREREQ instead of __GLIBC_PREREQ, thus accidentally reverting the workaround introduced in commit bf5953c549a6d279977df69ffe89b2ba51460eaf. Fix the typo. ticket: 8880
2020-03-02Fix Linux build error with musl libcTBK1-2/+1
Commit bf5953c549a6d279977df69ffe89b2ba51460eaf caused a build failure on non-glibc Linux build environments. Change the conditionalization so that __GLIBC_PREREQ will only be used if it is defined. [ghudson@mit.edu: simplified conditionals; rewrote commit message] ticket: 8880 (new) tags: pullup target_version: 1.18-next
2020-01-24Honor transited-policy-checked flag in serversGreg Hudson1-2/+4
For consistency with Heimdal and simplicity of server configuration, do not check the transited field in krb5_rd_req() if the transited-policy-checked flag is set in the ticket. Add a cross-realm test using the gcred and rdreq harnesses to test server transited processing. Also fix the KDC capaths case so that the client actually doesn't know the path to the server realm. In k5test.py, adjust _cfg_merge() to remove keys mapped to None in the second dictionary (instead of mapping them to None in the result), so that deleting whole sections works. Remove the corresponding check for None in _write_cfg_section() as it is no longer needed. ticket: 8870 (new) tags: pullup target_version: 1.18
2020-01-23Apply permitted_enctypes to KDC request enctypesRobbie Harwood1-24/+6
permitted_enctypes was initially intended only to restrict the processing of AP requests (and was later applied to KDB key data searches so that the KDC wouldn't issue a ticket it would refuse to accept). Because the documentation was never clear about its scope, many configurations assume that permitted_enctypes also applies to clients. In light of the existing configurations, take the simple way out and use permitted_enctypes as the default for default_tkt_enctypes and default_tgs_enctypes. Update the documentation, add a test to explicitly check the new behavior, and remove now-unnecessary configuration from the test suite. [ghudson@mit.edu: unrolled helper function; edited documentation and commit message; simplified test case] ticket: 8869 (new) tags: pullup target_version: 1.18
2020-01-07Add return_trace option to k5test.pyGreg Hudson1-14/+18
If return_trace=True is specified when running a command in a Python test, collect the trace output and return it in a tuple with the regular output.
2019-12-11In mkrel, build documentation with python3Greg Hudson1-2/+2
After commit 95830231758de259abbbccedbac01613f578768a, the documentation cannot be built with Python 2. Run make with "PYTHON=python3" to ensure that we use Python 3.
2019-12-06Qualify short hostnames when not using DNSGreg Hudson1-16/+18
When DNS forward canonicalization is turned off or fails, qualify single-component hostnames with the first DNS search domain. Add the qualify_shortname relation to override this suffix. For one of the tests we need to disable qualification, which is accomplished with an empty value. Adjust k5test.py to correctly emit empty values when writing profiles. ticket: 8855 (new)
2019-11-13Use k5-buf.h integer helpers where appropriateGreg Hudson1-7/+3
2019-10-23Work around glibc bug 11941 (dlclose assertion)Greg Hudson1-0/+15
When building against glibc 2.24 or earlier, suppress calls to dlclose() to prevent the assertion failure "_dl_close: Assertion `map->l_init_called' failed" at process exit. We need this workaround to enable automated tests that load GSSAPI modules. ticket: 7135
2019-09-19Add environment variable for GSS mech configGreg Hudson1-0/+2
If the environment variable GSS_MECH_CONFIG is set (and the process is not privileged), read it instead of /etc/gss/mech or files within /etc/gss/mech.d. Set GSS_MECH_CONFIG in test frameworks so that system configuration does not interfere with tests. Fix documentation to indicate that the default mech config file is in sysconfdir, not necessarily /etc. ticket: 8833 (new)
2019-08-15Improve daemon checking in Python test scriptsGreg Hudson1-16/+38
If a daemon exits early and we detect it with check_daemon(), avoid trying to terminate it again as the process entry will have been reaped. Check all daemons on successful exit and exit with an error if any daemons exited early. Also remove a piece of Python 2.5 compatibility code which is no longer relevant with Python 3.
2019-08-15Don't skip past zero byte in profile parsingGreg Hudson1-1/+1
In parse_quoted_string(), only process an escape sequence if there is a second character after the backlash, to avoid reading past the terminating zero byte. Reported by Lutz Justen. ticket: 8825 (new) tags: pullup target_version: 1.17-next target_version: 1.16-next
2019-08-05Display daemon output in Python test scriptsGreg Hudson1-0/+21
In k5test.py, if a daemon process exits before we terminate it, display the exit status. If a daemon process generates output beyond the sentinel, display the output before terminating the process.
2019-07-30Remove orphaned KfM codeMichael Mattioli8-1242/+0
Remove the Mac parts of the ccapi code, as ccapi is now only used in the Windows build. Remove util/mac. [ghudson@mit.edu: rewrote commit message]
2019-07-30Convert remaining Python scripts to Python 3Greg Hudson5-22/+22
Commit e23d24beacb73581bbf4351250f3955e6fd44361 missed some Python scripts, in part because of the "PYTHON = python" line in src/Makefile.in from commit 7be2ef2b6c8c491781251a5023db48d7690f5fa8. Remove that line and convert the remaining scripts. Also fix the check-pytests-no warning to mention Python 3 instead of Python 2.5.
2019-07-23Add profile tests for final nodesGreg Hudson7-2/+60
2019-07-11Fix typosAntoine Cœur2-2/+2
2019-06-25Convert OTP and kdcproxy tests to Python 3Greg Hudson2-17/+19
Commit e23d24beacb73581bbf4351250f3955e6fd44361 did not convert t_otp.py or paste-kdcproxy.py. Convert t_otp.py to Python3. Rewrite paste-kdcproxy.py using wsgiref from the standard Python library to avoid the Paste dependency. ticket: 8818 (new) tags: pullup target_version: 1.17-next
2019-06-10Remove strerror() calls from k5_get_error()Greg Hudson1-3/+2
Coverity models strerror() as a function which cannot accept negative values, even though it has defined behavior on all integers. k5_get_error() contains code to call strerror_r() and strerror() if its fptr global is unset, which isn't an expected case in practice. To silence a large number of Coverity false positives, just return a fixed string if fptr is null.
2019-06-07Update HTTP linksMichael Mattioli4-7/+7
Move http links to https where appropriate. Update links which have moved. Remove a couple of links which no longer work and have no obvious replacement. Remove a link from a comment in the German translation which does not appear to be related to the message. [ghudson@mit.edu: adjusted changes; rewrote commit message]
2019-05-31Make siphash24 available internallyGreg Hudson2-0/+10
2019-05-28Update test suite to avoid single-DES enctypesRobbie Harwood1-1/+1
Remove the CRC exercise code, since CRC is DES-only. ticket: 8808
2019-05-28Remove the v4 and afs3 salt typesRobbie Harwood1-11/+0
In preparation for removing single-DES support, remove the v4 and afs3 salt types. The afs3 salt type could only be used with single-DES keys, and the v4 salt type was only useful for single-DES keys from krb4 databases. [ghudson@mit.edu: wrote commit message] ticket: 8808
2019-04-30Use secure_getenv() where appropriateGreg Hudson1-1/+1
ticket: 8800
2019-04-30Add secure_getenv() supportGreg Hudson2-4/+123
On systems with secure_getenv() (glibc 2.17+) use it directly. For the fallback implementation, check the current process uids and gids in a library initializer, looking at the saved uid and gid where possible. Include a comment about more aggressive approaches to detecting elevated privilege. ticket: 8800 (new)
2019-04-17Remove confvalidator utilityRobbie Harwood5-378/+0
This utility has not been maintained with encryption types and salt changes, which suggests it is unused.
2019-03-04Rename configure.in to configure.acGreg Hudson2-5/+5
autotools plans to drop support for the name configure.in. (automake's NEWS file expresses plans to drop support for it in autoconf 2.0; autoconf added a warning in commit 560f16b52d3d3db1536d9ca5b863ce9b1a5c9e35, indicating in the commit message that support will be dropped in a future version.) ticket: 8788 (new)
2019-01-03Fix build issues with Solaris native compilersashan1-3/+3
In the LDAP KDB module, fix an empty initializer. In the SPAKE edwards25519 code, use autoconf tests to determine whether to use the 64-bit code. In the SPAKE update_thash() function, make sure the types of the conditional expression results match exactly. In libkrb5support, link against zap.o now that k5buf.o can use zap() (as of commit 8ee8246c14702dc03b02e31b9fb5b7c2bb674bfb). [ghudson@mit.edu: squashed commits; rewrote commit message; adjusted autoconf tests; minor code changes] ticket: 8769 (new) tags: pullup target_version: 1.17
2018-10-26Update auto-generated filesGreg Hudson1-1/+1
Regenerate dependency files and mit-krb5.pot. Regenerate man pages and NOTICE with python-sphinx 1.6.7. Regenerate deltat.c with bison 3.0.4. Update config.guess and config.sub from upstream (commit 2fa97a8a0ed37bec720bd118d65e674cebf50404).
2018-10-04Disable stdin buffering in libss dummy readlineGreg Hudson1-0/+3
readline() is careful not to read more bytes from fd 0 than it has to. Do the same in the dummy libss readline() by disabling stdin buffering. ticket: 8745
2018-10-03Use the term "replica KDC" in source and docsGreg Hudson2-9/+9
ticket: 8738 (new)
2018-08-30Check malloc() result in ss_execute_command()Greg Hudson1-0/+2
Reported by Bean Zhang.
2018-08-22Add a hash table implementation to libkrb5supportGreg Hudson5-4/+447
2018-08-09Fix memory leaks in test programsGreg Hudson2-0/+2
Fix additional memory leaks detected by a newer asan (clang version 6.0.0) in test programs.
2018-07-26Fix k5test prompts for Python 3Greg Hudson1-0/+2
With Python 3, sys.stdout.write() of a partial line followed by sys.stdin.readline() does not display the partial line. Add explicit flushes to make prompts visible in k5test.py. ticket: 8710
2018-07-18Eliminate preprocessor-disabled dead codeRobbie Harwood3-71/+0
It's been policy for a while now not to create "dead hunks" like these. A great deal of this code simply doesn't work because it hasn't been kept up-to-date, and may never have worked. Eliminate these dead hunks along with the complexity to support them.
2018-07-12Convert Python tests to Python 3Greg Hudson3-37/+40
Look for python3 in configure.in and verify that we got it. Convert test code to conform to Python 3. ticket: 8710 (new)
2018-07-05Explicitly look for python2 in configure.inGreg Hudson1-1/+0
The executable "python" has traditionally been Python 2, but is becoming more ambiguous as operating systems transition towards Python 3. Look for "python2" in the path in preference to "python", and check that what we found isn't Python 3. Remove the "#!/usr/bin/python" headers at the start of Python test scripts since we run them explicitly under python, not as executables. Execute paste-kdcproxy.py via sys.executable in t_proxy.py so that it doesn't need a #!/usr/bin/python header. ticket: 8709 (new)
2018-06-18Eliminate use of the 'register' keywordThomas Sondergaard15-62/+62
'register' is a reserved and unused keyword in C++17 so having it present in the public headers presents a a compatibility issue. Also in C the 'register' keyword is mostly obsolete, so remove all uses of it. [ghudson@mit.edu: adjusted style of some of the affected lines]
2018-06-12Remove wshelper libraryGreg Hudson21-3779/+1
ticket: 8687