summaryrefslogtreecommitdiff
path: root/server/server.c
Commit message (Collapse)AuthorAge
* Don't send to realms with no serversGravatar Jeffrey Hutzelman2013-03-18
| | | | | | | | | | | | | | | | | | | | | | When we are using c-ares to resolve otherrealm server names asynchronously, there is a period of time during startup during which a realm may have no servers whose names we have successfully resolved. This can also happen when a realm is added, or when servers for a realm are deleted, and even without asynchronous resolution, it can happen if we are having trouble resolving names. We now avoid trying to send notices to realms for which there are no usable servers (that is, servers which are not deleted, not marked nosend, and whose names have been resolved). Currently, when this happens, the notice to be sent is just dropped on the floor. Arguably, we should manage a queue of packets waiting to be sent to such a realm, and resend them if we ever discover a usable server. But that would be complicated. In addition, since we are basically never ready to send realm wakeups when processing the realm.list, they are now deferred until the first server's name has been resolved (and then, until the timer queue is processed). This has the additional effect of causing wakeups to be sent for realms which appear during a realm.list reload.
* Make ZRealm.srvrs be an array of pointersGravatar Jeffrey Hutzelman2013-03-18
| | | | | | | | | | | | With asynchronous name resolution and timers, we need to keep around pointers to individual other-realm servers. This, we cannot move existing servers around in memory without causing data corruption. But, realm_init() wants to reallocate the srvrs array for a realm when adding servers. Therefore, to allow ZRealm.srvrs to be reallocated without changing the addresses of existing servers, it is converted from an array of servers to an array of pointers to servers.
* Make otherrealms be an array of pointersGravatar Jeffrey Hutzelman2013-02-17
| | | | | | | | | | | | The server keeps pointers to realms in non-ephemeral data structures, such as triplet subscriber lists. Thus, we cannot move existing realms around in memory without causing data corruption. However, dynamic reloading of the realm.list means new realms can appear, which sooner or later will mean reallocating the otherrealms array to make room for more realms. Therefore, to allow otherrealms to be reallocated without changing the addresses of existing realms, otherrealms is converted from an array of realms to an array of pointers to realms.
* Underpinnings for realm.list enhancementsGravatar Derrick Brashear2013-02-17
| | | | | | | | | | Replace the per-realm array of servers with a per-realm array of struct _ZRealm_server, so that we can have additional information associated with each server. Additionally, introduce the concept that not every server in a realm's list is necessarily a suitable place to send notices. This means that when selecting a server, we may need to skip ineligible entries.
* Clean up warningsGravatar Jeffrey Hutzelman2013-02-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Eliminate compiler warnings due to various issues (listed below). This allows Zephyr to build cleanly under GCC versions ranging from 4.1.0 to 4.7.2 with all of the options shown below: -g -O2 -Wall -Werror -Wno-deprecated-declarations -Wmissing-declarations -Wpointer-arith -Wstrict-prototypes -Wshadow -Wextra -Wno-missing-field-initializers -Wno-unused-parameter and, on recent versions, -Wunreachable-code Test builds were done - On Ubuntu 12.10 (Quantal Quetzal) using both MIT Kerberos 1.10.1 and Heimdal 1.6, without krb4 and both with and without C-Ares and Hesiod - On Fedora 14 using Heimdal 0.6, without C-Ares or Hesiod and both with and without krb4 (KTH Kerberos 1.3rc2) - On Fedora Core 3, Fedora Core 5, Fedora 7, and Fedora 10, using Heimdal 0.6 and without C-Ares, Hesiod, or krb4 It also allows clean builds on Solaris 10 under the Sun Studio 12 (9/07) C compiler with the following options: -g -fd -v -errfmt -errhdr=%user -errtags=yes -errwarn=%all -erroff=E_OLD_STYLE_FUNC_DECL,E_ENUM_TYPE_MISMATCH_ARG,E_ARG_INCOMPATIBLE_WITH_ARG ... and under Solaris 9 with the Sun Forte 7 (3/02) C compiler with the above options and -erroff=E_FUNC_HAS_NO_RETURN_STMT. Solaris builds were done with Heimdal 0.6 and without C-Ares, Hesiod, or krb4. The following types of issues are addressed in this change: - Parameters and local variables with the same names as library functions - Parameters and local variables with the same names as globals - Declarations for exported global variables missing from headers - Prototypes for exported functions missing from headers - Missing 'static' on functions that shouldn't be exported - Old-style function declarations - Duplicate declarations - Type mismatches - Unused variables and functions - Uninitialized variables - Forward references to enums - Necessary header files not included - Violations of the aliasing rules, where GCC was able to detect them - Missing braces on if blocks that might be empty - Attempts to do pointer arithmetic on pointers of type void *, which is not permitted in standard C. - An attempt to pass a function pointer via a void * parameter, which is not permitted in standard C. Instead, we now pass a pointer to a structure, which then contains the required function pointer. - Unnecessary inclusion of <krb5_err.h>, which is already included by <krb5.h> when the former exists, and might not be protected against double inclusion, depending on which com_err was used. - Missing include of <com_err.h>, which was masked by the fact that it is included by headers generated by e2fsprogs compile_et - Use of com_err() with a non-constant value in place of the format string, which in every case was a fixed-size buffer in which a message was built using sprintf(!). Both the calls to sprintf and the fixed-size buffers have been removed, in favor of just letting com_err() do the formatting. - Various cases where X library functions expecting a parameter of type wchar_t * were instead passed a parameter of type XChar2b *. The two types look similar, but are not the same and are _not_ interchangeable. - An overly-simplistic configure test which failed to detect existence of <term.h> on Solaris, due to not including <curses.h>. - Using the wrong type for the flags output of krb5_auth_con_getflags() when building against Heimdal. A configure test is added to detect the correct type.
* Inline functions should be declared staticGravatar Jeffrey Hutzelman2013-01-31
|
* Actually remove the #ifdef OLD_COMPAT and NEW_COMPAT codeGravatar Karl Ramm2012-02-11
| | | | To my knowledge, this hasn't been enabled by anyone in ages
* It is not the 80s anymore, so we have a printf directive for pointersGravatar Karl Ramm2011-10-23
|
* It is still not the 80s anymore -- remove all caddr_tsGravatar Karl Ramm2011-02-02
|
* stop using MAXHOSTNAMELEN in a variety of places. Also ↵Gravatar Karl Ramm2010-08-24
| | | | nuke-trailing-whitespace.
* Fix a leak if ZNewFormatSmallRawNotice fails. (thanks to nelhage@mit.edu for ↵Gravatar Karl Ramm2010-08-22
| | | | noticing)
* it is the TWENTY-FIRST CENTURY, we can STOP USING K&RGravatar Karl Ramm2009-08-09
|
* Factor out code that extacts a sockaddr_in from a notice (and stop using theGravatar Karl Ramm2009-07-29
| | | | | | | deprecated sender_addr macro.) Actually remove the code from realm.c:real_dispatch because nothing was using the result. Ran nuke-trailing-whitespace on all the files I touched, as usual.
* As in [2406], the C preprocessor has seen enough abuse; it is theGravatar Karl Ramm2009-04-10
| | | | | future, so we can abuse inline functions instead.
* This needs to be positive. (are you sure?)Gravatar Karl Ramm2009-04-08
|
* remove notdef'd dynamic server list (?) codeGravatar Karl Ramm2008-01-21
|
* collapse state of a bunch of #if 0 and #if 1 debugging outputGravatar Karl Ramm2008-01-21
|
* passes gcc -Wall with no warnings other than des cryppt C_block sadness and ↵Gravatar Karl Ramm2008-01-21
| | | | getsid problem
* de K&RifyGravatar Karl Ramm2008-01-21
|
* /afs/andrew.cmu.edu/usr18/cg2v/hesiod-fix.diffGravatar Karl Ramm2007-12-25
|
* /afs/andrew.cmu.edu/usr18/cg2v/zephyr-krb5-server-20071215+.diffGravatar Karl Ramm2007-12-25
|
* applied athena-update-branch patchGravatar Karl Ramm2007-12-25
|
* debian patch applied and reconciled, version unfinalizedGravatar Karl Ramm2007-07-20
|
* Changes from CMU:Gravatar Garry Zacheiss2001-02-26
| | | | | | * Some memset 0 cleanliness. * Support enhanced 'zstat -s' output.
* Some RCS ID cleanup: delete $Log$ and replace other RCS keywords with $Id$.Gravatar Greg Hudson1999-01-22
|
* Keep track of how responsive clients have been and don't time out good ones.Gravatar Greg Hudson1998-09-02
|
* Eliminate some cruft: nuke two unused fields in the client structureGravatar Greg Hudson1998-07-16
| | | | | and rename client_which_client() to client_find() and make the second argument a port instead of a notice.
* ZEPHYR_USES_KERBEROS -> HAVE_KRB4; ZEPHYR_USES_HESIOD -> HAVE_HESIODGravatar Greg Hudson1997-10-25
|
* Pull in sources from zephyr locker. See /mit/zephyr/repository forGravatar Greg Hudson1997-09-14
| | | | detailed change information.
* The ADMIN_LOST_CLIENT message was being recorded in the server->clientGravatar Greg Hudson1994-12-20
| | | | | | nack list, so the wrong list was being searched when the other server acks the packet. I added a flag to send_msg_list to decide whether it's being sent to a client or another server.
* Check the right nacklist.Gravatar Greg Hudson1994-10-31
|
* Don't do signal blocking; simply set a semaphore flag indicating it isGravatar Richard Basch1994-08-01
| | | | | in critical code, and let the main loop deal with the flag being set. This saves on context switches into the kernel for this rare condition.
* Changed bzero/bcopy to memset/memcpy [ANSI]Gravatar Richard Basch1993-11-19
|
* Changed bcopy/bzero to _BCOPY/_BZERO (defined in <zephyr/zephyr_conf.h>)Gravatar Richard Basch1993-09-24
| | | | Added POSIX signal handling
* Forgot to ack the ADMIN_LOST_CLT opcode.Gravatar Richard Basch1993-05-05
|
* Changed some of the logging levelsGravatar Richard Basch1993-03-22
|
* Changed log level of recover_clt messages to LOG_INFO (happen frequently)Gravatar Richard Basch1993-03-22
|
* saber complains about pure assignment statements in ifs-Gravatar Lucien Van Elsen1992-08-14
|
* turn of extra debugging info (for speed)Gravatar Lucien Van Elsen1992-01-17
|
* Converted back to ANSI C (with ifdef's for standard C)Gravatar Lucien Van Elsen1991-12-04
|
* log more info when killing clientGravatar Kenneth G Raeburn1991-05-13
|
* Made some messages more informative; enabled/disabled some. Use newGravatar Kenneth G Raeburn1991-03-08
| | | | | | inet_ntoa inline, or ZServerDesc_t `addr' elt. Changed some `static' decls for (global) friends of ZServerDesc_t. Increment counters for various notice types.
* (admin_dispatch): If a bdump is in progress, discard offers.Gravatar Kenneth G Raeburn1991-01-28
| | | | | (send_stats): Add more machine specific info. (all routines): Use new/delete for ZHostList_t.
* kill_clt now takes ZServerDesc_t argument, address logged in errorGravatar Kenneth G Raeburn1990-12-11
| | | | messages. Callers changed.
* Cleaned up some Hesiod code for C++.Gravatar Kenneth G Raeburn1990-11-14
|
* C++ conversion and lots of modifications from summer & fall workGravatar Kenneth G Raeburn1990-11-13
|
* fix syslogs of recover_cltGravatar John Kohl1989-12-14
|
* fix bug with freeing a bogus pointer.Gravatar John Kohl1989-12-06
|
* add counters for old supportGravatar John Kohl1989-10-27
|
* add NeXT to known typesGravatar John Kohl1989-10-19
|