summaryrefslogtreecommitdiffstats
path: root/src/util/support
Commit message (Collapse)AuthorAgeFilesLines
...
* krb5int_get_plugin_dir_data() uses + instead of * in reallocEzra Peisach2006-06-011-1/+1
| | | | | | | | | | | | | | | | In line 570, in reallocating the plugin tree - the memory allocated is (count + 1) + sizeof(*p) instead of (count +1 ) * sizeof(*p) Detected while running the krb5kdc under valgrind with memcheck. ticket: new tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18070 dc483132-0cff-0310-8789-dd5450dbe970
* Don't look for pthread_mutexattr_setrobust_npKen Raeburn2006-05-161-5/+0
| | | | | | | | | | Apparently Red Hat's Fedora Core 5 defines it but doesn't declare it, so we'd have to declare it before testing the address. While it was once useful for checking whether the pthread code had been loaded, I think the other tests done now are more effective and this isn't needed any more. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18012 dc483132-0cff-0310-8789-dd5450dbe970
* vsnprintf not present on windowsJeffrey Altman2006-05-091-0/+6
| | | | | | | | | | vsnprintf is not present on Windows. Microsoft provides the _vsnprintf form instead. Add a macro to allow this file to compile. ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17993 dc483132-0cff-0310-8789-dd5450dbe970
* plugins support requires a Windows equivalent to opendir and friendsJeffrey Altman2006-05-091-1/+6
| | | | | | | | | | | | | This patch simply allows krb5 to build once again on Windows. Windows does not have opendir() and friends. Instead Win32 API functions must be used as described in http://msdn.microsoft.com/library/en-us/dnucmg/html/UCMGch09.asp ticket: new status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17992 dc483132-0cff-0310-8789-dd5450dbe970
* * threads.c (krb5int_pthread_loaded): Supply dummy version for !ENABLE_THREADSKen Raeburn2006-05-091-0/+5
| | | | | | | | case. ticket: 3426 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17990 dc483132-0cff-0310-8789-dd5450dbe970
* * plugins.c (krb5int_get_plugin_filenames): Make extention array static and ↵Ken Raeburn2006-05-051-1/+1
| | | | | | const git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17981 dc483132-0cff-0310-8789-dd5450dbe970
* * plugins.c (krb5int_get_plugin_filenames): Avoid shadowing local variable namesKen Raeburn2006-05-051-3/+3
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17980 dc483132-0cff-0310-8789-dd5450dbe970
* * plugins.c (FILEEXTS): No trailing semicolonKen Raeburn2006-05-051-2/+2
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17979 dc483132-0cff-0310-8789-dd5450dbe970
* Export new function namesAlexandra Ellwood2006-05-041-2/+2
| | | | | | ticket: 3716 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17976 dc483132-0cff-0310-8789-dd5450dbe970
* Changed to krb5int_open_plugin_dirs/krb5int_close_plugin_dirs whichAlexandra Ellwood2006-05-041-68/+203
| | | | | | | | | | | | | takes a list of filebases and directories rather than a list of full paths so the caller doesn't have to generate the possibilities themselves. krb5int_open_plugin_dirs will append the possible suffixes for that platform (including no suffix in case there already is one on the file base). Modified the kdb and locate kdc interfaces to use the new API. ticket: 3716 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17975 dc483132-0cff-0310-8789-dd5450dbe970
* Updated comments to explain how the CFBundles get unloaded.Alexandra Ellwood2006-04-251-1/+2
| | | | | | (And not to call CFBundleUnloadExecutable which is refcounted.) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17962 dc483132-0cff-0310-8789-dd5450dbe970
* Update internal plugin interface to add an errinfo structure to "open"Ken Raeburn2006-04-251-32/+38
| | | | | | | and "get" routines, so that more detailed error information (e.g., from dlerror()) may be returned to the caller. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17960 dc483132-0cff-0310-8789-dd5450dbe970
* Don't define DEBUG; it prints debug messages that cause test suite failuresKen Raeburn2006-04-251-2/+0
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17958 dc483132-0cff-0310-8789-dd5450dbe970
* Added CoreFoundation bundle plugin supportAlexandra Ellwood2006-04-241-208/+332
| | | | | | | | | | | | | Added CoreFoundation bundle plugin support to support library bundle plugin code. Also modified plugin types so they allocate a list of pointers rather than a list of structs so that we can reuse the code that generates the pointer types. (Basically now krb5int_open_plugin_dir() can call krb5int_open_plugin() rather than doing nearly the same thing.) ticket: new target_version: 1.5 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17950 dc483132-0cff-0310-8789-dd5450dbe970
* Fix memory leak. closedir() was never being called after successful opendir()Ezra Peisach2006-04-201-0/+2
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17946 dc483132-0cff-0310-8789-dd5450dbe970
* * errors.c (krb5int_get_error): Try strerror_r if available before strerror.Ken Raeburn2006-04-192-2/+29
| | | | | | | | | | | * plugins.c (ERRSTR): New macro, tries strerror_r and uses strerror only if it fails or isn't available. (krb5int_open_plugin_dir): Use it. ticket: 3620 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17944 dc483132-0cff-0310-8789-dd5450dbe970
* Move gmt_mktime.c from lib/krb5/os to util/support, and rename the function.Ken Raeburn2006-04-143-0/+136
| | | | | | | Stop exporting gmt_mktime from libkrb5, and export krb5int_gmt_mktime from libkrb5support. Updated the one caller, asn1_decode.c. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17921 dc483132-0cff-0310-8789-dd5450dbe970
* Remove ChangeLog files from the source tree. From now on, theSam Hartman2006-04-111-294/+0
| | | | | | | subversion commit log entry needs to include information that would have been in the changelog. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17893 dc483132-0cff-0310-8789-dd5450dbe970
* more DEFS=Ken Raeburn2006-04-042-0/+5
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17839 dc483132-0cff-0310-8789-dd5450dbe970
* make depend, now with dependency sortingKen Raeburn2006-03-311-15/+15
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17811 dc483132-0cff-0310-8789-dd5450dbe970
* make dependKen Raeburn2006-03-271-0/+3
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17786 dc483132-0cff-0310-8789-dd5450dbe970
* Initial enhanced error message support, similar to what I sent toKen Raeburn2006-03-265-0/+155
| | | | | | | | | | | | | | | | krbdev except for some function renaming (krb5_free_error was already in use, so added _message to everything), and the context is allowed to be NULL (in which case we fall back to error_message() and storing no strings) to simplify some code. Low-level routines in the support library, using a private data structure; higher-level routines in libkrb5, using a krb5_context. Added error info strings to the KRB_ERR_GENERIC case in gc_via_tkt.c and the python sample service location plugin. Added code to kinit and kvno to look up and display the strings. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17776 dc483132-0cff-0310-8789-dd5450dbe970
* * plugins.c (krb5int_get_plugin_dir_data): If dirhandle is null or theKen Raeburn2006-03-132-5/+9
| | | | | | file pointer is null, return a one-element list containing just NULL. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17738 dc483132-0cff-0310-8789-dd5450dbe970
* Instead of arbitrary division of headers into include and include/krb5, withKen Raeburn2006-03-112-5/+9
| | | | | | | | | | | | include directives sometimes using krb5/foo.h and sometimes using foo.h, and -I options always given for both directories in both source and build trees, push include/krb5/* up a level and drop the krb5 directory (except, for the moment, the change log). Updated #include directives, -I options, and dependencies accordingly, and deleted one or two bits of old, unused code that was noticed in the process. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17730 dc483132-0cff-0310-8789-dd5450dbe970
* missed a dlsym call removalKen Raeburn2006-03-081-1/+0
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17714 dc483132-0cff-0310-8789-dd5450dbe970
* Oops. This should come closer to building on Windows..Ken Raeburn2006-03-082-18/+49
| | | | | | | | | | | | | * plugins.c: Only include dlfcn.h if USE_DLOPEN. (struct plugin_file_handle): Only include a pointer if USE_DLOPEN. (krb5int_open_plugin, krb5int_get_plugin_data, krb5int_close_plugin, krb5int_open_plugin_dir, krb5int_close_plugin_dir): Only use the dlopen interface if USE_DLOPEN is defined. (krb5int_get_plugin_dir_data, krb5int_get_plugin_dir_func): Use krb5int_get_plugin_data/func instead of dlsym. Drop some debugging code. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17713 dc483132-0cff-0310-8789-dd5450dbe970
* krb5.h, which is built after util/et, which is built after the supportKen Raeburn2006-03-082-8/+32
| | | | | | | | | | | | | code. Fix: Put service location decls in k5-locate.h, pull plugin support decls out of k5-int.h into k5-plugin.h, and make it stand on its own, which includes changing the return type from krb5_error_code to int32_t. Oops: The plugin support code included k5-int.h, which includes git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17707 dc483132-0cff-0310-8789-dd5450dbe970
* Merge from plugin branchKen Raeburn2006-03-074-2/+361
| | | | | | | | | | | | | | | | | | | | | | | | | Add plugin support: - plugin routines in support library (may break windows build!) - plugin support in KDC location code - sample Python-based plugin for KDC location, not built without tweaking sources - changed service location interface to use an enum instead of passing profile string and DNS strings and port numbers - changed pathnames for plugin locations, including kdb back end - remove locate_service from accessor API Also, do build shared libraries for Darwin just like any other UNIX box. Not present yet: - use new plugin interface for kdb back end - Windows support - Mac bundle support (but dlopen support works) - search path for libkrb5 plugins (only one hard-coded directory for now) - sorting of plugin collections for predictable ordering See the various ChangeLogs for specifics. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17706 dc483132-0cff-0310-8789-dd5450dbe970
* Qing Dong <dongq@mit.edu> provided a set of changes to allowJeffrey Altman2006-02-272-0/+6
| | | | | | | | | | | | | krb5 to build under the Microsoft Visual Studio 8 compiler in 64-bit mode and produce file names that do not conflict with the names produced by the 32-bit build. That patch was modified to work on Unix and also include processor dependent pre-processor definitions to remove warnings. ticket: 3415 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17680 dc483132-0cff-0310-8789-dd5450dbe970
* copyright updateKen Raeburn2006-01-261-1/+1
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17620 dc483132-0cff-0310-8789-dd5450dbe970
* * fake-addrinfo.c (krb5int_in6addr_any): Always defineKen Raeburn2006-01-252-5/+3
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17608 dc483132-0cff-0310-8789-dd5450dbe970
* * threads.c (krb5int_mutex_alloc, krb5int_mutex_free, krb5int_mutex_lock,Ken Raeburn2006-01-253-1/+53
| | | | | | | | | | | | krb5int_mutex_unlock): New functions. (krb5int_mutex_lock_update_stats, krb5int_mutex_unlock_update_stats, krb5int_mutex_report_stats): Always define, even if not doing anything. * libkrb5support.exports: Export the new functions. ticket: 3417 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17607 dc483132-0cff-0310-8789-dd5450dbe970
* make dependTom Yu2005-11-291-13/+6
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17505 dc483132-0cff-0310-8789-dd5450dbe970
* * fake_addrinfo.c (getaddrinfo): AI_NUMERICSERV fix for AIXKen Raeburn2005-09-092-1/+15
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17380 dc483132-0cff-0310-8789-dd5450dbe970
* Add stub for krb5int_pthread_loaded() for WindowsJeffrey Altman2005-07-282-0/+10
| | | | | | ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17323 dc483132-0cff-0310-8789-dd5450dbe970
* Update dependenciesKen Raeburn2005-06-211-6/+13
| | | | | | | | | N.B.: The version of gcc used this time ("gcc version 3.4.3 20041212 (Red Hat 3.4.3-9.EL4)") seems to emit some duplicate dependencies -- some header files get listed twice. This is annoying but shouldn't cause any harm.... git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17256 dc483132-0cff-0310-8789-dd5450dbe970
* Add run-time determination of whether thread support is available in theKen Raeburn2005-06-013-1/+68
| | | | | | | | | | | | | | | | | support library. Check lots of weak references, and call pthread_once a couple of times, to distinguish a broken stub from the real thing. * threads.c [HAVE_PRAGMA_WEAK_REF]: Declare pthread_{g,s}etspecific, pthread_key_{create,delete}, pthread_{create,join} as weak references. (krb5int_pthread_loaded, loaded_test_aux) [HAVE_PRAGMA_WEAK_REF]: New functions. (flag_pthread_loaded, loaded_test_once) [HAVE_PRAGMA_WEAK_REF]: New variables. * libkrb5support.exports: Add krb5int_pthread_loaded. ticket: 3084 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17223 dc483132-0cff-0310-8789-dd5450dbe970
* * fake-addrinfo.c (fai_add_hosts_by_name): Pass null pointer instead of telnetKen Raeburn2005-05-182-2/+36
| | | | | | as service name. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17218 dc483132-0cff-0310-8789-dd5450dbe970
* threads.c (thread_termination): Free array of pointers to thread-specific ↵Alexandra Ellwood2005-03-202-24/+38
| | | | | | | | data (t) on thread termination. Use existing mutex to prevent the deletion of the array from interfering with the global list of thread specific data (used for library termination) ticket: 2971 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17129 dc483132-0cff-0310-8789-dd5450dbe970
* There is a memory leak here, if a thread has registered some per-thread dataKen Raeburn2005-02-092-2/+30
| | | | | | | | | | | | | | | | when we delete the key. Fixing it will require walking through the per-thread data of every thread and freeing the objects... and watching for deadlocks in the case where a thread is exiting at the same time. * threads.c (k5_key_delete) [pthread case]: Reset flags and destructor function pointer to unset state. (krb5int_thread_support_init, krb5int_thread_support_fini): If SHOW_INITFINI_FUNCS is defined, print some tracing messages. ticket: 2916 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17092 dc483132-0cff-0310-8789-dd5450dbe970
* * threads.c (k5_key_delete) [ENABLE_THREADS && !_WIN32]: Don't abort,Ken Raeburn2005-01-182-2/+7
| | | | | | | | just leak resources for now. ticket: 2888 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17052 dc483132-0cff-0310-8789-dd5450dbe970
* Some applications such as Eudora on Windows load and unload the KerberosJeffrey Altman2005-01-172-0/+8
| | | | | | | | | | | libraries as part of a plug-in. Plugins are often loaded for a specific purpose and then unregistered. In order to support this model, the libraries must restore the library state to the uninitialized state when the library is unloaded. ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17050 dc483132-0cff-0310-8789-dd5450dbe970
* fix calling convention for thread support fnsKen Raeburn2005-01-142-6/+18
| | | | | | | | | | | | | | | | This depends on a change to k5-thread.h that was included with a checkin I did earlier for 2878. * threads.c (k5_mutex_lock_update_stats, krb5int_mutex_unlock_update_stats, krb5int_mutex_report_stats): Define as KRB5_CALLCONV. (krb5int_mutex_lock_update_stats, krb5int_mutex_unlock_update_stats, krb5int_mutex_report_stats) [_WIN32]: Undef macros before defining functions. ticket: new target_version: 1.4 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17037 dc483132-0cff-0310-8789-dd5450dbe970
* * threads.c (krb5int_mutex_lock_update_stats,Ken Raeburn2005-01-052-0/+24
| | | | | | | krb5int_mutex_unlock_update_stats, krb5int_mutex_report_stats) [_WIN32 && !DEBUG_THREADS_STATS]: Define empty versions for Windows. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16997 dc483132-0cff-0310-8789-dd5450dbe970
* run "make depend"Ken Raeburn2004-12-301-13/+14
| | | | | | | | In most library directories, this just affects where the line breaks are. In most other directories, it's just dropping a trailing blank line. One or two files really do have updated dependencies. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16987 dc483132-0cff-0310-8789-dd5450dbe970
* 2004-12-15 Jeffrey Altman <jaltman@mit.edu>Jeffrey Altman2004-12-152-2/+6
| | | | | | | | rename krb5support_32.dll to k5sprt32.dll ticket: 2804 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16934 dc483132-0cff-0310-8789-dd5450dbe970
* * libkrb5support.exports: Add krb5int_in6addr_anyKen Raeburn2004-12-062-0/+3
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16914 dc483132-0cff-0310-8789-dd5450dbe970
* hooks for recording statistics on locking behaviorKen Raeburn2004-12-064-0/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Finish the hooks (left disabled by default) for logging somewhere the recorded timing behavior relating to the use of locks in the krb5 code. Currently, "reporting" means writing to /dev/tty or stderr, and the data is the number of times a mutex is locked, file and line where it was created, min/avg/max/stddev wait times to acquire the lock and hold times, and stats are only written out for locks that were locked a certain minimum number of times and with a minimum average wait time. The criteria are all controlled in threads.c, and k5-thread.h just has the hooks for gathering data. So turning on/off the data gathering requires a full rebuild, but tweaking the reporting is mostly just a relinking pass. (May also require adding a dependence on the math library to the support library; for a static build that may impact a lot of makefiles.) * include/k5-thread.h [DEBUG_THREADS_STATS]: Include string.h and inttypes.h. (get_current_time) [DEBUG_THREADS_STATS]: Define as inline. (k5_mutex_init_stats) [DEBUG_THREADS_STATS]: Save away current time as creation time. (k5_mutex_stats_tmp): New typedef, k5_debug_time_t if recording stats, dummy int otherwise. (k5_mutex_stats_start): New macro, get current time if recording, zero otherwise. (krb5int_mutex_lock_update_stats, krb5int_mutex_unlock_update_stats, krb5int_mutex_report_stats) [DEBUG_THREADS_STATS]: Declare. (krb5int_mutex_report_stats) [! DEBUG_THREADS_STATS]: New macro, does nothing. (k5_mutex_lock_update_stats, k5_mutex_unlock_update_stats): New macros, map to krb5int_ functions if recording, dummy statements otherwise. (k5_mutex_destroy): Call krb5int_mutex_report_stats. (k5_mutex_lock, k5_mutex_lock_1): Call k5_mutex_stats_start and k5_mutex_lock_update_stats. (k5_mutex_unlock_1): Call k5_mutex_unlock_update_stats. * util/support/threads.c [DEBUG_THREADS_STATS]: Include stdio.h. (stats_logfile) [DEBUG_THREADS_STATS]: New variable. (krb5int_thread_support_init) [DEBUG_THREADS_STATS]: Set it to point to a file on /dev/tty or stderr. (krb5int_thread_support_fini) [DEBUG_THREADS_STATS]: Flush it. (k5_mutex_lock_update_stats, krb5int_mutex_unlock_update_stats, get_stddev, krb5int_mutex_report_stats) [DEBUG_THREADS_STATS]: New functions. * util/support/libkrb5support.exports: Add krb5int_mutex_*_stats. ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16913 dc483132-0cff-0310-8789-dd5450dbe970
* * fake-addrinfo.c (HAVE_GETADDRINFO, HAVE_GETNAMEINFO)[_WIN32]: Don't defineKen Raeburn2004-11-192-8/+15
| | | | | | | | | here. (protoname): Handle IPPROTO_IGMP. (debug_dump_addrinfo_args): Update for current interfaces to socktypename and familyname. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16893 dc483132-0cff-0310-8789-dd5450dbe970
* make dependKen Raeburn2004-11-161-5/+11
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16875 dc483132-0cff-0310-8789-dd5450dbe970