summaryrefslogtreecommitdiffstats
path: root/src/include
Commit message (Collapse)AuthorAgeFilesLines
...
* move getaddrinfo hacks into support lib for easier maintenanceKen Raeburn2004-11-032-1159/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the cache on Mac OS X, and likely to be enabled eventually on other platforms, this is going to wind up being a non-trivial amount of code on most platforms, and updating the cache code to work on other configurations is likely to take a few rounds. Rather than recompile the world and add a bunch of code to each object file doing name lookups, moving the code into the support library that already defines the static data (list head, mutex) should make things simpler. (TODO: Fix calling conventions for Windows?) * include/fake-addrinfo.h: Move most of code content into util/support/fake-addrinfo.c. (krb5int_getaddrinfo, krb5int_freeaddrinfo, krb5int_getnameinfo, krb5int_gai_strerror): Declare. (getaddrinfo, freeaddrinfo, getnameinfo, gai_strerror): Define as macros mapping to the krb5int_ function names. * util/support/fake-addrinfo.c: Import most of the contents of include/fake-addrinfo.h, so we only compile it once. (krb5int_getaddrinfo, krb5int_freeaddrinfo, krb5int_getnameinfo, krb5int_gai_strerror): New functions, always defined and exported. * util/support/libkrb5support.exports: Export the new functions, not the old _fac symbols. ticket: new status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16854 dc483132-0cff-0310-8789-dd5450dbe970
* * fake-addrinfo.h: Include errno.h earlierKen Raeburn2004-10-292-2/+5
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16845 dc483132-0cff-0310-8789-dd5450dbe970
* * k5-thread.h (return_after_yield, k5_mutex_lock) [__GNUC__]: Add macroKen Raeburn2004-10-282-1/+27
| | | | | | | versions so debugging line numbers will be useful. (DEBUG_THREADS_SLOW): Don't define. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16842 dc483132-0cff-0310-8789-dd5450dbe970
* forgot to check in with fake-addrinfo.hKen Raeburn2004-10-061-0/+6
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16805 dc483132-0cff-0310-8789-dd5450dbe970
* * fake-addrinfo.h (AI_ADDRCONFIG, AI_V4MAPPED, AI_ALL): If not defined, or whenKen Raeburn2004-10-051-7/+23
| | | | | | completely faking getaddrinfo, define them as zero. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16803 dc483132-0cff-0310-8789-dd5450dbe970
* * configure.in: Check for struct if_laddrconf, as for struct lifconfKen Raeburn2004-10-012-0/+18
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16800 dc483132-0cff-0310-8789-dd5450dbe970
* * configure.in: Use AC_MSG_NOTICE for krb4 messages instead of AC_MSG_RESULT,Ken Raeburn2004-09-242-2/+7
| | | | | | because there's no corresponding AC_MSG_CHECKING. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16787 dc483132-0cff-0310-8789-dd5450dbe970
* Add DNS resolver glue layer. Use itTom Yu2004-09-212-3/+4
| | | | | | ticket: 2710 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16769 dc483132-0cff-0310-8789-dd5450dbe970
* * configure.in: Check for h_errno declaration in netdb.hTom Yu2004-09-153-0/+23
| | | | | | | | * port-sockets.h: Explicitly declare h_errno if it's missing. ticket: 1044 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16758 dc483132-0cff-0310-8789-dd5450dbe970
* * port-sockets.h: Remove _XOPEN_SOURCE_EXTENDED hack for netdb.h,Tom Yu2004-09-102-9/+7
| | | | | | | | | as it can cause inconsistencies between headers. It significantly broke HP-UX 10.20 anyway. ticket: 2379 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16740 dc483132-0cff-0310-8789-dd5450dbe970
* krb5.hin: add new krb5_ccache flag, KRB5_TC_NOTICKETJeffrey Altman2004-09-092-0/+5
| | | | | | | | | when set, a krb5_ccache does not have to return a ticket within the returned credential ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16734 dc483132-0cff-0310-8789-dd5450dbe970
* * fake-addrinfo.h (fai_add_hosts_by_name): Handle case where returned ↵Ken Raeburn2004-08-232-2/+9
| | | | | | ai_canonname is null git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16682 dc483132-0cff-0310-8789-dd5450dbe970
* Fix Tru64 build:Ken Raeburn2004-08-152-6/+13
| | | | | | | | * k5-thread.h (k5_os_nothread_mutex_assert_locked, k5_os_nothread_mutex_assert_unlocked, k5_os_mutex_assert_locked, k5_os_mutex_assert_unlocked): Assertion macros should always have type void. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16663 dc483132-0cff-0310-8789-dd5450dbe970
* * k5-thread.h (k5_os_nothread_mutex_finish_init, k5_os_nothread_mutex_init,Ken Raeburn2004-08-132-25/+67
| | | | | | | | | | | | | | k5_os_nothread_mutex_destroy, k5_os_nothread_mutex_lock, k5_os_nothread_mutex_unlock) [!DEBUG_THREADS]: Replace macros with inline functions, to gain type checking and eliminate gratuitous compiler warnings. (k5_pthread_assert_unlocked, k5_pthread_assert_locked): Likewise. (k5_os_mutex_finish_init) [HAVE_PTHREAD && !USE_PTHREAD_LOCK_ONLY_IF_LOADED]: Likewise. (return_after_yield): New inline function. (k5_os_mutex_lock) [HAVE_PTHREAD]: Change back to a macro, calling return_after_yield. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16661 dc483132-0cff-0310-8789-dd5450dbe970
* * configure.in: Solaris getpwnam_r returns struct passwd*, notTom Yu2004-08-102-1/+6
| | | | | | struct pwd*. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16654 dc483132-0cff-0310-8789-dd5450dbe970
* * configure.in: If getpwnam_r is available, determine its return typeKen Raeburn2004-08-082-0/+27
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16647 dc483132-0cff-0310-8789-dd5450dbe970
* * configure.in: Look for sched.h and sched_yield.Ken Raeburn2004-08-073-4/+17
| | | | | | | | | * k5-thread.h: Only include sched.h if it's available. (MAYBE_SCHED_YIELD): Only use sched_yield if sched.h and sched_yield are available; if weak references are supported and sched_yield isn't available by default, check for it at run time. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16645 dc483132-0cff-0310-8789-dd5450dbe970
* * k5-thread.h [HAVE_PTHREAD]: Include sched.h if DEBUG_THREADS_SLOW is defined.Ken Raeburn2004-08-052-10/+40
| | | | | | | | | (MAYBE_SCHED_YIELD) [HAVE_PTHREAD]: Define, to call sched_yield or not, depending on DEBUG_THREADS_SLOW. (k5_os_mutex_lock, k5_os_mutex_unlock) [HAVE_PTHREAD]: Use MAYBE_SCHED_YIELD. (DEBUG_THREADS_SLOW): Define. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16642 dc483132-0cff-0310-8789-dd5450dbe970
* * k5-int.h (krb5_rc_recover_or_initialize): DeclareKen Raeburn2004-08-042-0/+4
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16639 dc483132-0cff-0310-8789-dd5450dbe970
* * configure.in: Actually check for pthread_mutex_lockKen Raeburn2004-08-042-1/+5
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16638 dc483132-0cff-0310-8789-dd5450dbe970
* * k5-thread.h [HAVE_PRAGMA_WEAK_REF]: Declare the pthread mutex functions asKen Raeburn2004-07-282-0/+15
| | | | | | | | weak. (USE_PTHREAD_LOCK_ONLY_IF_LOADED): Define if pthread_mutex_lock isn't available by default. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16625 dc483132-0cff-0310-8789-dd5450dbe970
* Add a mutex to protect the per-process fake-getaddrinfo data cache.Ken Raeburn2004-07-232-4/+32
| | | | | | | | | | | | | | | | | | | | | | Currently it gets locked while a name lookup is in progress, which is not very efficient. That should be changed, after the code is fixed up so that the cache works on other platforms. * include/fake-addrinfo.h: Include k5-thread.h. (struct fac): Add a mutex. (plant_face, find_face): Check that mutex is already locked. (krb5int_lock_fac, krb5int_unlock_fac): Declare. (fai_add_hosts_by_name): Use them to lock and unlock the mutex. * util/support/fake-addrinfo.c (krb5int_fac): Initialize the mutex. (krb5int_init_fac, krb5int_fini_fac): New functions; finish initializing or destroy the mutex. (krb5int_lock_fac, krb5int_unlock_fac): New functions; lock the mutex after calling krb5int_call_thread_support_init, or unlock it. * util/support/threads.c (krb5int_call_thread_support_init): New function. (krb5int_init_fac, krb5int_fini_fac): Declare. (krb5int_thread_support_init, krb5int_thread_support_fini): Call them. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16622 dc483132-0cff-0310-8789-dd5450dbe970
* * configure.in: Look for "struct lifconf" and maybe define HAVE_STRUCT_LIFCONFKen Raeburn2004-07-222-0/+17
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16620 dc483132-0cff-0310-8789-dd5450dbe970
* * fake-addrinfo.h (struct face, struct fac): Always declare.Ken Raeburn2004-07-192-20/+26
| | | | | | (krb5int_fac): Renamed from fac, and made extern. Always declare. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16615 dc483132-0cff-0310-8789-dd5450dbe970
* zap remaining bits of macsock.h supportKen Raeburn2004-07-174-13/+4
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16612 dc483132-0cff-0310-8789-dd5450dbe970
* * fake-addrinfo.h: Don't include netdb.h, since port-sockets.h already does.Ken Raeburn2004-07-163-8/+16
| | | | | | | | | | | * port-sockets.h: Define _XOPEN_SOURCE_EXTENDED around inclusion of netdb.h if it's not defined and not Windows, as fake-addrinfo.h used to do; otherwise just include it normally. ticket: 2379 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16608 dc483132-0cff-0310-8789-dd5450dbe970
* * port-sockets.h (inet_ntop): Cast NULL to desired return pointer typeKen Raeburn2004-07-162-2/+7
| | | | | | | ticket: 2592 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16604 dc483132-0cff-0310-8789-dd5450dbe970
* Remove use of client principal from krb5_context (default_ccprincipal) and ↵Alexandra Ellwood2004-07-152-1/+5
| | | | | | | | default principal from v4 CCAPI glue code ticket: 2634 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16602 dc483132-0cff-0310-8789-dd5450dbe970
* fix previous commitJeffrey Altman2004-07-151-1/+0
| | | | | | ticket: 2637 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16601 dc483132-0cff-0310-8789-dd5450dbe970
* * k5-int.h: define for WIN32 the macro krb5int_zap_data toJeffrey Altman2004-07-152-4/+17
| | | | | | | | | | | utilize the Win32 API SecureZeroMemory which is guaranteed by Microsoft not to be optimized out by the compiler. Both memset and ZeroMemory will be optimized out by the compiler when possible. ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16600 dc483132-0cff-0310-8789-dd5450dbe970
* * k5-platform.h (k5_call_init_function) [DELAY_INITIALIZER] [__GNUC__]: Use aKen Raeburn2004-07-142-0/+17
| | | | | | | statement expression so any line number info printed by assertion failures is useful. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16589 dc483132-0cff-0310-8789-dd5450dbe970
* * k5-thread.h (k5_key_t): Add a couple new values for GSSAPI ccache name ↵Ken Raeburn2004-07-142-0/+4
| | | | | | manipulation git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16588 dc483132-0cff-0310-8789-dd5450dbe970
* * k5-thread.h (k5_os_mutex_init, k5_os_mutex_destroy): IfKen Raeburn2004-07-142-2/+12
| | | | | | | USE_PTHREAD_LOCK_ONLY_IF_LOADED is defined, use pthread_mutex_init and _destroy only if pthread support is loaded. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16587 dc483132-0cff-0310-8789-dd5450dbe970
* * k5-thread.h (k5_os_mutex_lock, k5_os_mutex_unlock, k5_os_mutex_assert_locked,Ken Raeburn2004-07-112-4/+9
| | | | | | | k5_os_mutex_assert_unlocked) [USE_PTHREAD_LOCK_ONLY_IF_LOADED]: Fix typo in accessing non-pthread versions. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16580 dc483132-0cff-0310-8789-dd5450dbe970
* * fake-addrinfo.h (in6addr_any): If we need to define a static copy, rename itKen Raeburn2004-07-112-0/+5
| | | | | | with a macro first. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16579 dc483132-0cff-0310-8789-dd5450dbe970
* * configure.in: Check krb5_cv_inet6_with_dinet6 as well as krb5_cv_inet6 whenKen Raeburn2004-07-112-1/+13
| | | | | | | deciding whether to test for in6addr_any. If gcc is in use, suppress pedantic warnings about "inline". git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16578 dc483132-0cff-0310-8789-dd5450dbe970
* * k5-thread.h: Test HAVE_PTHREAD instead of HAVE_PTHREAD_HKen Raeburn2004-07-092-1/+3
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16573 dc483132-0cff-0310-8789-dd5450dbe970
* forgot the changelogJeffrey Altman2004-07-091-0/+4
| | | | | | ticket: 2629 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16571 dc483132-0cff-0310-8789-dd5450dbe970
* osconf.h:Jeffrey Altman2004-07-091-1/+1
| | | | | | | | | | < #if !!defined(_WIN32) --- > #if !defined(_WIN32) ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16570 dc483132-0cff-0310-8789-dd5450dbe970
* * win-mac.h (KRB5_USE_INET6, ENABLE_THREADS): DefineKen Raeburn2004-07-092-0/+6
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16569 dc483132-0cff-0310-8789-dd5450dbe970
* * k5-thread.h [! HAVE_PTHREAD_H]: Don't explicitly disable thread support whenKen Raeburn2004-07-072-5/+50
| | | | | | | | | | pthread.h is missing. (k5_os_mutex, K5_OS_MUTEX_PARTIAL_INITIALIZER, k5_os_mutex_finish_init, k5_os_mutex_init, k5_os_mutex_destroy, k5_os_mutex_lock, k5_os_mutex_unlock, k5_os_mutex_assert_unlocked, k5_os_mutex_assert_locked) [_WIN32]: Define Windows versions; still not enabled by default. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16552 dc483132-0cff-0310-8789-dd5450dbe970
* * k5-thread.h: Use K5_THREAD_H for multiple inclusion protection.Ken Raeburn2004-07-072-3/+74
| | | | | | | | | | | (k5_debug_mutex_stats, k5_mutex_init_stats, k5_mutex_finish_init_stats, K5_MUTEX_STATS_INIT): Add some dummy support for recording statistics on how long mutexes are held, etc. Incomplete implementation started, but code not enabled. (k5_mutex_t): Add statistics field. (K5_MUTEX_PARTIAL_INITIALIZER, k5_mutex_init_1, k5_mutex_init): Initialize it. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16550 dc483132-0cff-0310-8789-dd5450dbe970
* * configure.in: Check for getpwuid_rKen Raeburn2004-07-072-1/+5
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16549 dc483132-0cff-0310-8789-dd5450dbe970
* * k5-thread.h: Restructured mutex code.Ken Raeburn2004-07-022-175/+292
| | | | | | | | | | | | | | | (k5_debug_loc): New type, may contain file/line info if DEBUG_THREADS_LOC is defined. (k5_os_nothread_*): Dummy implementation of mutex lock for a single-threded process. Uses a flag and assert() if DEBUG_THREADS is defined, does nothing interesting otherwise. (k5_os_mutex*, k5_once*): General implementations, with dummy or POSIX or POSIX-if-loaded-otherwise-dummy variants. (k5_mutex_*): Combine OS-specific mutex implementation with optional file/line tracking, and provide a place to instrument for other debugging or performance data. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16539 dc483132-0cff-0310-8789-dd5450dbe970
* * configure.in: Test for 'inline' support.Ken Raeburn2004-07-014-17/+10
| | | | | | | * k5-platform.h (inline): Don't define here. * win-mac.h (inline): Define as __inline. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16536 dc483132-0cff-0310-8789-dd5450dbe970
* * k5-thread.h (K5_MUTEX_DEBUG_INITIALIZER): Use current file and line.Ken Raeburn2004-07-012-10/+23
| | | | | | | | | | | | | (k5_mutex_debug_finish_init, k5_mutex_debug_init, k5_mutex_debug_destroy): Save current file and line. (k5_mutex_debug_lock): Verify that the lock was unlocked before, and set the state to locked. (k5_mutex_debug_unlock): Verify that the mutex was locked before, and set the state to unlocked. (k5_debug_assert_locked, k5_debug_assert_unlocked): Use k5_mutex_debug_check_init instead of checking initialized==1. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16535 dc483132-0cff-0310-8789-dd5450dbe970
* * k5-thread.h (k5_debug_assert_locked, k5_debug_assert_unlocked): New macros.Ken Raeburn2004-06-302-0/+22
| | | | | | | (k5_assert_locked, k5_assert_unlocked): New macros, may or may not call the debug macros. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16533 dc483132-0cff-0310-8789-dd5450dbe970
* * k5-platform.h (JOIN4, JOIN4_2, JOIN3, JOIN3_2): Unused macros deleted.Ken Raeburn2004-06-252-32/+36
| | | | | | | | | | | (JOIN__2, JOIN__2_2): Renamed from JOIN2 and JOIN2_2. Insert two underscores between the tokens supplied. All uses changed to use new macros, and not use identifiers with leading underscores. ticket: 2603 status: resolved git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16521 dc483132-0cff-0310-8789-dd5450dbe970
* Delete preprocessor tests for macintosh, __MWERKS__, applec, and THINK_C, allKen Raeburn2004-06-2211-65/+19
| | | | | | | part of the pre-Mac OS X support. (Except the bits in the Yarrow code, where it was part of the upstream source.) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16506 dc483132-0cff-0310-8789-dd5450dbe970
* * k5-platform.h (MAKE_INIT_FUNCTION, CALL_INIT_FUNCTION, INITIALIZER_RAN): UseKen Raeburn2004-06-182-5/+11
| | | | | | | | the linker-driven version for Windows. The auxinit function definition needs an argument list. (MAKE_FINI_FUNCTION): Likewise. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16488 dc483132-0cff-0310-8789-dd5450dbe970