summaryrefslogtreecommitdiffstats
path: root/src/util
Commit message (Collapse)AuthorAgeFilesLines
...
* remove error tables by pointer Jeffrey Altman2007-10-011-3/+3
| | | | | | | | | | | | | | | On Windows, it is possible for the same DLL to be loaded into a process multiple times as separate instances. Each time a DLL is loaded it registers its error tables at different locations in the process address space. Removing the tables by base instead of pointer value can result in the error table list pointing at invalid memory. ticket: new tags: pullup target_version: 1.6.3 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20040 dc483132-0cff-0310-8789-dd5450dbe970
* def-check.pl needs to ignore ordinals in .def fileKen Raeburn2007-10-011-0/+1
| | | | | | | | | Otherwise, the UNIX build blows out now that the Windows export lists have been updated. Silly consistency checks.... ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20039 dc483132-0cff-0310-8789-dd5450dbe970
* profile library memory leaks introduced when malloc returns 0Ezra Peisach2007-09-263-2/+7
| | | | | | | | | | | | | | | | | | | | I have a modified version of valgrind that will allow me to have malloc fail in a controlled way. A number of memory leaks in error return passes exist in the profile library. They are essentially inconsequental - but my goal is to eventually create a test harness that tries to cover all code - including error returns... prof_parse.c: (profile_parse_file): Free node being created if parse_line() fails. prof_file.c (profile_open_file): free prf_data_t on malloc failure prof_tree.c (profile_create_node): The magic element must be set before calling profile_free_node for it to release memory. ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19981 dc483132-0cff-0310-8789-dd5450dbe970
* stdint.h should only be accessed if HAVE_STDINT_H definedJeffrey Altman2007-09-221-1/+3
| | | | | | | | | stdint.h does not exist on Windows. Conditionally include it based upon HAVE_STDINT_H ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19965 dc483132-0cff-0310-8789-dd5450dbe970
* Ignore dependency lines beginning with '#' to deal with gccTom Yu2007-09-191-0/+1
| | | | | | | | | | -fworking-directory output during make depend. ticket: 5752 target_version: 1.6.4 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19961 dc483132-0cff-0310-8789-dd5450dbe970
* Bidirectional map template codeKen Raeburn2007-09-041-0/+194
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19918 dc483132-0cff-0310-8789-dd5450dbe970
* Fix bug in clearing of new storageKen Raeburn2007-09-041-1/+2
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19917 dc483132-0cff-0310-8789-dd5450dbe970
* Ignore KRB5_ATTR_DEPRECATEDKen Raeburn2007-08-271-0/+1
| | | | | | | ticket: 2836 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19886 dc483132-0cff-0310-8789-dd5450dbe970
* remap mechanism-specific status codes in mechglue/spnegoKen Raeburn2007-08-165-0/+547
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch creates a mapping in the mechglue/spnego code to modify mechanism status codes when passing them back to the application, so that mechglue's display_status dispatcher can determine the correct mechanism to dispatch to. This is part of the "get enhanced error messages from gssapi applications" project; ticket 5590 has updates to the Kerberos 5 mechanism to extract enhanced error messages (when there are any) from the Kerberos library. util/gen.pl, util/t_*.pm: New code generation script and templates. lib/gssapi/generic: Add a new, global mapping that enumerates the {mechOID,status} pairs as they're seen, allowing a magic mechOID value to indicate com_err error codes from mechglue and spnego, and reserving status code 0 for unknown errors. Preload the Kerberos "wrong principal" error code once for each mechanism OID used for Kerberos, so the entries get fixed positions (1-3) in the table. lib/gssapi/gss_libinit.c: Call the initializer and destructor functions. lib/gssapi/mechglue, lib/gssapi/spnego: Enter all mechanism-generated or locally-generated status codes into the mapping table, and return the table index to the application. Do the reverse in display_status, to get the messages from the mechanism.. lib/rpc: Define new function gssrpcint_printf to use for debugging instead of printf, to redirect output away from dejagnu; add a couple more debugging calls. Check for minor status codes 1-3 now instead of KRB5KRB_AP_WRONG_PRINC. tests/dejagnu/krb-standalone/gssftp.exp: Test getting more detailed error messages back, by having the ftp client attempt to authenticate to a non-existent service, and examining the error message for the service principal name. ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19831 dc483132-0cff-0310-8789-dd5450dbe970
* Don't define vsnprintf for Windows hereKen Raeburn2007-08-011-6/+0
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19741 dc483132-0cff-0310-8789-dd5450dbe970
* Avoid unchecked sprintf in some more support codeKen Raeburn2007-07-121-2/+3
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19704 dc483132-0cff-0310-8789-dd5450dbe970
* Avoid use of unchecked sprintf in libraries. Use asprintf if theKen Raeburn2007-07-123-29/+22
| | | | | | | output buffer is allocated according to the size of data to be written, or snprintf otherwise. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19703 dc483132-0cff-0310-8789-dd5450dbe970
* make dependKen Raeburn2007-07-101-23/+37
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19688 dc483132-0cff-0310-8789-dd5450dbe970
* Add a note at the start of the output reminding the reader that it's a ↵Ken Raeburn2007-07-041-0/+7
| | | | | | generated file git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19674 dc483132-0cff-0310-8789-dd5450dbe970
* Perl code for generating "map" routines from a common template withKen Raeburn2007-07-042-0/+178
| | | | | | | | | | supplied type info. * ktemplate.pm: Code for parsing a command line and writing out a supplied template with substitutions. * gen-map.pl: Parameter info and template for "map" type. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19669 dc483132-0cff-0310-8789-dd5450dbe970
* Include k5-platform.hKen Raeburn2007-07-021-0/+2
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19658 dc483132-0cff-0310-8789-dd5450dbe970
* Attach format attributes to declarations of various message-formattingKen Raeburn2007-06-292-3/+15
| | | | | | | | | | | | | routines under gcc. In a couple of routines, hard-code the preference for using the vsnprintf paths instead of list-of-int-arguments hacks now that we're assuming vsnprintf is available in other places. Installed headers affected: com_err.h (com_err, com_err_va) ss.h (ss_error) krb5.h (krb5_set_error_message, krb5_vset_error_message) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19653 dc483132-0cff-0310-8789-dd5450dbe970
* Ignore __attribute__Ken Raeburn2007-06-291-0/+5
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19651 dc483132-0cff-0310-8789-dd5450dbe970
* Check for null pointer returns when allocating storage.Ken Raeburn2007-06-283-44/+133
| | | | | | | Clean up some memory leaks in out-of-memory error paths. Use strdup and asprintf when appropriate. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19650 dc483132-0cff-0310-8789-dd5450dbe970
* Update mkstemp and export-list handling for WindowsKen Raeburn2007-06-281-3/+19
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19646 dc483132-0cff-0310-8789-dd5450dbe970
* Implement S_ISDIR from S_IFMT or _S_IFMT if necessary (e.g., on Windows)Ken Raeburn2007-06-281-0/+10
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19645 dc483132-0cff-0310-8789-dd5450dbe970
* update dependenciesKen Raeburn2007-06-201-0/+3
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19601 dc483132-0cff-0310-8789-dd5450dbe970
* Move (BSD-licensed) mkstemp from libdb2 to libkrb5support, and renameKen Raeburn2007-06-203-3/+143
| | | | | | | | | | | | | the function to krb5int_mkstemp. Generate the symbol export list for libkrb5support at build time. Declare krb5int_mkstemp in k5-platform.h. Change cc_file.c to use mkstemp unconditionally. Make libdb2.so (built for testing only) link against the libkrb5support, and use krb5int_mkstemp if mkstemp is not available. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19600 dc483132-0cff-0310-8789-dd5450dbe970
* provide asprintf functionality for internal useKen Raeburn2007-06-201-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I plan to use asprintf in some gssapi error-message management routines, so let's make sure we have the functionality available, implementing it locally if necessary. This implementation assumes vsnprintf is available, an assumption that the support library is already making at the moment. Since this implementation requires calling vsnprintf potentially multiple times with the same va_list, use va_copy if it's available, or provide a hack version (which should work okay if va_list is a scalar or array type that requires no other special handling, and if va_end does nothing interesting, which is usually the case) if the compiler doesn't provide it. I also changed a couple bits of code to use asprintf, to make sure we exercise our implementation in testing. (C99 requires vsnprintf and va_copy; vasprintf is a GNU/BSD extension, but an oh so useful one....) * configure.in: Check for va_copy, or if va_list objects can be simply assigned. Define HAS_VA_COPY and CAN_COPY_VA_LIST as appropriate. * include/k5-platform.h: Define a va_copy macro if the compiler doesn't provide it. * include/k5-platform.h: If vsnprintf isn't available from the OS, abort compilation. If vasprintf isn't available from the OS, provide k5_{v,}asprintf based on vsnprintf and define {v,}asprintf macros. * lib/krb5/keytab/t_keytab.c (do_test): Use asprintf. * util/support/errors.c (krb5int_vset_error): Use asprintf unconditionally. ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19595 dc483132-0cff-0310-8789-dd5450dbe970
* profile stores empty string values without double quotesJeffrey Altman2007-04-251-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | prof_parse.c (need_double_quotes): The profile library will happily read in right hand values that represent the empty string by parsing "". However, when storing the same empty string back to a file, the empty string is written without the double quotes. This means that [section] foo = "" becomes [section] foo = which is invalid input. A subsequent attempt to parse the profile will result in an invalid input error. KFW and KFM's realm editors can inadvertently produce an invalid krb5 profile if one of the ignored sections of the input profile contains a right hand value that is "". This patch was produced by Asanka Herath and it was reviewed by jaltman and lxs. ticket: new tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19529 dc483132-0cff-0310-8789-dd5450dbe970
* krb5int_open_plugin_dirs errors out if directory does not existAlexandra Ellwood2007-04-051-10/+2
| | | | | | | | | | | If one of the directories in the list doesn't exist and no filenames are passed in because opendir fails and then the code gets an error. opendir() failing should not be a fatal error. The function should just move on to the next directory. ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19400 dc483132-0cff-0310-8789-dd5450dbe970
* All Windows apps were popping MessageBoxes when stderr is redirected. ↵Kevin Koch2007-03-271-3/+11
| | | | | | | | | | | | | Console apps shouldn't and no longer do that. Added isGuiApp, which tests gui resource usage Removed duplicate nested tests for _WIN32. Ticket: 5446 Status: resolved Target_Version: 1.6.1 Tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19292 dc483132-0cff-0310-8789-dd5450dbe970
* Generate makefiles for two static libs plus the python plugin from the ↵Ken Raeburn2007-03-252-19/+2
| | | | | | top-level configure script git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19270 dc483132-0cff-0310-8789-dd5450dbe970
* Remove KRB5_BUILD_LIBRARY_STATIC; always use KRB5_BUILD_LIBRARYKen Raeburn2007-03-251-1/+1
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19266 dc483132-0cff-0310-8789-dd5450dbe970
* Never set krb5_force_static. Instead, set the defaults for buildingKen Raeburn2007-03-251-1/+1
| | | | | | | | | | | | | | | | shared libraries, and allow a Makefile.in to include a new makefile fragment for building private (static, not installed) libraries. Created another makefile fragment to be included to indicate the shared library has no dependencies. (Currently this is the case only for the libdb2 library, which we don't install, but do build for testing.) The way we construct the library dependency search path arguments doesn't work for an empty list on some platforms. Updated Makefile.in to use @libpriv_frag@ and @libnodeps_frag@ as necessary. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19265 dc483132-0cff-0310-8789-dd5450dbe970
* Fix PROG_LIBPATH, and use -l instead of an explicit filename to build ↵Ken Raeburn2007-03-251-3/+3
| | | | | | profile_tcl git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19263 dc483132-0cff-0310-8789-dd5450dbe970
* Zero sockaddrs in fai_add_entry() so we can compare them with memcmp()Alexandra Ellwood2007-03-191-0/+2
| | | | | | | | | | | | If we don't zero the struct sockaddrs in fai_add_entry() then any sin_zero fields will be left as random memory and the memcmp() will return that the addresses are different even if they aren't. ticket: new target_version: 1.6.1 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19235 dc483132-0cff-0310-8789-dd5450dbe970
* Back out windows specific makefile changeSam Hartman2007-03-031-1/+1
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19204 dc483132-0cff-0310-8789-dd5450dbe970
* More existence tests; path updateKevin Koch2007-03-021-1/+1
| | | | | | | | | | | Modify remainder of Makefiles that were sensitive to identity/obj or other cleaned files not being present. Update util/et/Makefile.in to look for com_err.h in src/include, not src/include/src. ticket: 5457 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19203 dc483132-0cff-0310-8789-dd5450dbe970
* Delete more stuff for 'clean' and 'distclean' targetsKen Raeburn2007-03-022-1/+2
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19198 dc483132-0cff-0310-8789-dd5450dbe970
* Don't use struct in6_addr if we don't have IPv6 supportKen Raeburn2007-02-161-0/+7
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19165 dc483132-0cff-0310-8789-dd5450dbe970
* Remove unused fileKen Raeburn2007-01-201-50/+0
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19089 dc483132-0cff-0310-8789-dd5450dbe970
* Handle function names immediately preceded by "*", like "*strdup"Ken Raeburn2007-01-201-1/+1
| | | | | | in k5-int.h+krb5.h. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19085 dc483132-0cff-0310-8789-dd5450dbe970
* Modifications to support the generation and embedding Jeffrey Altman2006-12-071-1/+3
| | | | | | | | | | | | of library manifests into generated EXEs and DLLs. Manifests are required for Windows XP and above when applications are built with Microsoft Visual Studio 2005 (aka VS8) or above. ticket: 3642 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18930 dc483132-0cff-0310-8789-dd5450dbe970
* * fake-addrinfo.c (krb5int_lock_fac, krb5int_unlock_fac): Define only if ↵Ken Raeburn2006-11-021-0/+4
| | | | | | FAI_CACHE git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18755 dc483132-0cff-0310-8789-dd5450dbe970
* use strdupKen Raeburn2006-10-281-4/+2
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18747 dc483132-0cff-0310-8789-dd5450dbe970
* Add supp-int.h to provide prototypes for declared internal functions.Ezra Peisach2006-10-185-4/+43
| | | | | | | *.x: Include this header Makefile.in: Update dependencies git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18728 dc483132-0cff-0310-8789-dd5450dbe970
* Suppress some uninteresting glibc warnings on RHEL4Ken Raeburn2006-10-151-0/+16
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18709 dc483132-0cff-0310-8789-dd5450dbe970
* Use $(VALGRIND) when running programs using $(KRB5_RUN_ENV) orKen Raeburn2006-10-132-3/+3
| | | | | | | | | | | | | | | | | | $(RUN_SETUP). Replaces old hack with MAYBE_VALGRIND added to RUN_ENV in a way that would break in some of the tests. Set VALGRIND in site.exp in tests/dejagnu. (Not used yet.) Runs some shell scripts under valgrind, rather than changing them to run only the executables under valgrind; this is mostly okay, just creates lots of extra log data, and requires --trace-children=yes. This should work for any instrumentation program invocation that gets followed immediately by the name and argument list for the program being instrumented. For example, VALGRIND="env LD_PRELOAD=..." should work, though I haven't tested it. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18699 dc483132-0cff-0310-8789-dd5450dbe970
* Use const pointers for error messages.Ken Raeburn2006-10-071-4/+4
| | | | | | Add some debugging hooks in the libkrb5 support. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18661 dc483132-0cff-0310-8789-dd5450dbe970
* Fix AIX version of GET_HOST_BY_NAME to use TMP.ent for the result, notKen Raeburn2006-09-281-1/+1
| | | | | | | | the no-longer-defined my_h_ent. ticket: 4256 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18632 dc483132-0cff-0310-8789-dd5450dbe970
* windows thread support frees thread local storage after TlsSetValueJeffrey Altman2006-09-211-2/+2
| | | | | | | | | | | | | threads.c: The return value of TlsSetValue is non-zero on success. As a result of misinterpreting the return value, the memory set in TLS is then freed. A subsequent call to TlsGetValue returns the invalid pointer. ticket: new tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18600 dc483132-0cff-0310-8789-dd5450dbe970
* Make it easier to ignore additional directories, like, oh, say, localKen Raeburn2006-09-151-3/+12
| | | | | | install paths for OpenLDAP. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18587 dc483132-0cff-0310-8789-dd5450dbe970
* clean up mkrel patchlevel.h editing etcTom Yu2006-08-211-2/+3
| | | | | | | | | | | * src/util/mkrel: Be more careful editing KRB5_RELDATE. Delete '$ac_config_fragdir' autoconf droppings. ticket: new tags: pullup target_version: 1.5.1 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18475 dc483132-0cff-0310-8789-dd5450dbe970
* check calling conventions specified for WindowsKen Raeburn2006-06-291-16/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we're making changes on UNIX, sometimes we update the Windows export list but forget to make sure we've annotated the function declaration in the header file with a calling convention specification. This patch checks the krb5 and gssapi public headers against the Windows export lists (which are annotated with calling-convention and other info in comments), and flags any inconsistencies in public interfaces. * util/def-check.pl: Be quiet about normal stuff by default; accept a "-v" option to be verbose. Exit with non-zero status if something wrong is detected. Fix some problems in parsing gssapi header files. Handle DECSCRIPTION and HEAPSIZE directives in .def files, and DATA annotation in comments. * include/Makefile.in (verify-calling-conventions-krb5): New target. (all-unix): Depend on it in maintainer mode. * lib/gssapi/Makefile.in (verify-calling-conventions-gssapi): New target. (all-unix): Depend on it in maintainer mode. (merged-gssapi-header.h): New target; assemble public headers into one input file. (clean-misc-unix): New target; delete merged-gssapi-header.h. (clean-unix): Depend on it. ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18258 dc483132-0cff-0310-8789-dd5450dbe970