summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorGravatar Greg Hudson <ghudson@mit.edu>1997-10-25 17:47:11 +0000
committerGravatar Greg Hudson <ghudson@mit.edu>1997-10-25 17:47:11 +0000
commit2b03e82ddfe5797dab4a2811cb2755a2b7cc45b7 (patch)
tree337a1256ea163b161c0f66b3b33fe3d88af74fc0 /server
parent304bb68ebcb9682d28b41d86d59e9ac5f9d7d4a3 (diff)
ZEPHYR_USES_KERBEROS -> HAVE_KRB4; ZEPHYR_USES_HESIOD -> HAVE_HESIOD
Diffstat (limited to 'server')
-rw-r--r--server/acl_files.c2
-rw-r--r--server/bdump.c58
-rw-r--r--server/dispatch.c8
-rw-r--r--server/kopt.c4
-rw-r--r--server/main.c20
-rw-r--r--server/realm.c14
-rw-r--r--server/server.c10
-rw-r--r--server/subscr.c10
-rw-r--r--server/zsrv_conf.h4
9 files changed, 65 insertions, 65 deletions
diff --git a/server/acl_files.c b/server/acl_files.c
index 27c7f63..83b6663 100644
--- a/server/acl_files.c
+++ b/server/acl_files.c
@@ -114,7 +114,7 @@ void acl_canonicalize_principal(principal, canon)
canon += len;
*canon++ = '\0';
}
-#ifdef ZEPHYR_USES_KERBEROS
+#ifdef HAVE_KRB4
else if (krb_get_lrealm(canon, 1) != KSUCCESS) {
strcpy(canon, KRB_REALM);
}
diff --git a/server/bdump.c b/server/bdump.c
index 17f99db..5697ab5 100644
--- a/server/bdump.c
+++ b/server/bdump.c
@@ -66,7 +66,7 @@ static int setup_file_pointers __P((void));
static void shutdown_file_pointers __P((void));
static void cleanup __P((Server *server));
-#ifdef ZEPHYR_USES_KERBEROS
+#ifdef HAVE_KRB4
static long ticket_time;
static char my_realm[REALM_SZ];
@@ -77,7 +77,7 @@ static char my_realm[REALM_SZ];
extern C_Block serv_key;
extern Sched serv_ksched;
#endif
-#endif /* ZEPHYR_USES_KERBEROS */
+#endif /* HAVE_KRB4 */
static Timer *bdump_timer;
static int live_socket = -1;
@@ -105,15 +105,15 @@ bdump_offer(who)
{
Code_t retval;
char buf[512], *addr, *lyst[2];
-#ifndef ZEPHYR_USES_KERBEROS
+#ifndef HAVE_KRB4
int bdump_port = IPPORT_RESERVED - 1;
-#endif /* !ZEPHYR_USES_KERBEROS */
+#endif /* !HAVE_KRB4 */
#if 1
zdbug((LOG_DEBUG, "bdump_offer"));
#endif
-#ifdef ZEPHYR_USES_KERBEROS
+#ifdef HAVE_KRB4
/*
- * when using ZEPHYR_USES_KERBEROS server-server authentication, we can
+ * when using HAVE_KRB4 server-server authentication, we can
* use any random local address
*/
bdump_socket = socket(AF_INET, SOCK_STREAM, 0);
@@ -148,9 +148,9 @@ bdump_offer(who)
return;
}
}
-#else /* !ZEPHYR_USES_KERBEROS */
+#else /* !HAVE_KRB4 */
/*
- * when not using ZEPHYR_USES_KERBEROS, we can't use any old port, we use
+ * when not using HAVE_KRB4, we can't use any old port, we use
* Internet reserved ports instead (rresvport)
*/
bdump_socket = rresvport(&bdump_port);
@@ -163,7 +163,7 @@ bdump_offer(who)
bdump_sin.sin_port = htons((unsigned short) bdump_port);
bdump_sin.sin_addr = my_addr;
bdump_sin.sin_family = AF_INET;
-#endif /* ZEPHYR_USES_KERBEROS */
+#endif /* HAVE_KRB4 */
listen(bdump_socket, 1);
@@ -213,12 +213,12 @@ bdump_send()
struct sigaction action;
#endif
-#ifdef ZEPHYR_USES_KERBEROS
+#ifdef HAVE_KRB4
KTEXT_ST ticket;
AUTH_DAT kdata;
#else
unsigned short fromport;
-#endif /* ZEPHYR_USES_KERBEROS */
+#endif /* HAVE_KRB4 */
#if 1
zdbug((LOG_DEBUG, "bdump_send"));
@@ -233,7 +233,7 @@ bdump_send()
sizeof(on)) < 0)
syslog(LOG_WARNING, "bdump_send: setsockopt (SO_KEEPALIVE): %m");
-#ifndef ZEPHYR_USES_KERBEROS
+#ifndef HAVE_KRB4
fromport = ntohs(from.sin_port);
#endif
@@ -274,7 +274,7 @@ bdump_send()
/* Now begin the brain dump. */
-#ifdef ZEPHYR_USES_KERBEROS
+#ifdef HAVE_KRB4
/* receive the authenticator */
retval = GetKerberosData(live_socket, from.sin_addr, &kdata,
SERVER_SERVICE, srvtab_file);
@@ -305,13 +305,13 @@ bdump_send()
cleanup(server);
return;
}
-#else /* !ZEPHYR_USES_KERBEROS */
+#else /* !HAVE_KRB4 */
if (fromport > IPPORT_RESERVED || fromport < IPPORT_RESERVED / 2) {
syslog(LOG_ERR, "bdump_send: bad port from peer: %d", fromport);
cleanup(server);
return;
}
-#endif /* ZEPHYR_USES_KERBEROS */
+#endif /* HAVE_KRB4 */
retval = setup_file_pointers();
if (retval != 0) {
@@ -375,12 +375,12 @@ bdump_get_v12 (notice, auth, who, server)
#ifdef _POSIX_VERSION
struct sigaction action;
#endif
-#ifdef ZEPHYR_USES_KERBEROS
+#ifdef HAVE_KRB4
KTEXT_ST ticket;
AUTH_DAT kdata;
-#else /* !ZEPHYR_USES_KERBEROS */
+#else /* !HAVE_KRB4 */
int reserved_port = IPPORT_RESERVED - 1;
-#endif /* ZEPHYR_USES_KERBEROS */
+#endif /* HAVE_KRB4 */
bdumping = 1;
server->dumping = 1;
@@ -420,7 +420,7 @@ bdump_get_v12 (notice, auth, who, server)
server->dumping = 0;
return;
}
-#ifndef ZEPHYR_USES_KERBEROS
+#ifndef HAVE_KRB4
if (ntohs(from.sin_port) > IPPORT_RESERVED ||
ntohs(from.sin_port) < IPPORT_RESERVED / 2) {
syslog(LOG_ERR, "bdump_get: port not reserved: %d",
@@ -429,9 +429,9 @@ bdump_get_v12 (notice, auth, who, server)
return;
}
live_socket = rresvport(&reserved_port);
-#else /* !ZEPHYR_USES_KERBEROS */
+#else /* !HAVE_KRB4 */
live_socket = socket(AF_INET, SOCK_STREAM, 0);
-#endif /* ZEPHYR_USES_KERBEROS */
+#endif /* HAVE_KRB4 */
if (live_socket < 0) {
syslog(LOG_ERR, "bdump_get: socket: %m");
cleanup(server);
@@ -451,7 +451,7 @@ bdump_get_v12 (notice, auth, who, server)
/* Now begin the brain dump. */
-#ifdef ZEPHYR_USES_KERBEROS
+#ifdef HAVE_KRB4
/* send an authenticator */
if (get_tgt()) {
cleanup(server);
@@ -485,7 +485,7 @@ bdump_get_v12 (notice, auth, who, server)
cleanup(server);
return;
}
-#endif /* ZEPHYR_USES_KERBEROS */
+#endif /* HAVE_KRB4 */
retval = setup_file_pointers();
if (retval != 0) {
syslog(LOG_WARNING, "bdump_get: can't set up file pointers: %s",
@@ -681,7 +681,7 @@ cleanup(server)
server->dumping = 0;
}
-#ifdef ZEPHYR_USES_KERBEROS
+#ifdef HAVE_KRB4
int
get_tgt()
{
@@ -743,7 +743,7 @@ get_tgt()
}
return(0);
}
-#endif /* ZEPHYR_USES_KERBEROS */
+#endif /* HAVE_KRB4 */
/*
* The braindump offer wasn't taken, so we retract it.
@@ -784,10 +784,10 @@ bdump_recv_loop(server)
Code_t retval;
Client *client = NULL;
struct sockaddr_in who;
-#ifdef ZEPHYR_USES_KERBEROS
+#ifdef HAVE_KRB4
char *cp;
C_Block cblock;
-#endif /* ZEPHYR_USES_KERBEROS */
+#endif /* HAVE_KRB4 */
Realm *realm = NULL;
#if 1
@@ -867,7 +867,7 @@ bdump_recv_loop(server)
syslog(LOG_ERR,"brl failed: %s", error_message(retval));
return retval;
}
-#ifdef ZEPHYR_USES_KERBEROS
+#ifdef HAVE_KRB4
memset(client->session_key, 0, sizeof(C_Block));
if (*notice.z_class_inst) {
/* a C_Block is there */
@@ -885,7 +885,7 @@ bdump_recv_loop(server)
#endif
}
}
-#endif /* ZEPHYR_USES_KERBEROS */
+#endif /* HAVE_KRB4 */
} else if (strcmp(notice.z_opcode, CLIENT_SUBSCRIBE) == 0) {
/* a subscription packet */
if (!client) {
diff --git a/server/dispatch.c b/server/dispatch.c
index 084a1bc..5523e1b 100644
--- a/server/dispatch.c
+++ b/server/dispatch.c
@@ -599,7 +599,7 @@ xmit(notice, dest, auth, client)
we are distributing authentic and
we have a pointer to auth info
*/
-#ifdef ZEPHYR_USES_KERBEROS
+#ifdef HAVE_KRB4
retval = ZFormatAuthenticNotice(notice, noticepack, packlen, &packlen,
client->session_key);
if (retval != ZERR_NONE) {
@@ -607,7 +607,7 @@ xmit(notice, dest, auth, client)
free(noticepack);
return;
}
-#else /* !ZEPHYR_USES_KERBEROS */
+#else /* !HAVE_KRB4 */
notice->z_auth = 1;
retval = ZFormatSmallRawNotice(notice, noticepack, &packlen);
if (retval != ZERR_NONE) {
@@ -615,7 +615,7 @@ xmit(notice, dest, auth, client)
free(noticepack);
return;
}
-#endif /* ZEPHYR_USES_KERBEROS */
+#endif /* HAVE_KRB4 */
} else {
notice->z_auth = 0;
notice->z_authent_len = 0;
@@ -1023,7 +1023,7 @@ control_dispatch(notice, auth, who, server)
clt_ack(notice, who, AUTH_FAILED);
return ZERR_NONE;
}
-#ifdef ZEPHYR_USES_KERBEROS
+#ifdef HAVE_KRB4
/* in case it's changed */
memcpy(client->session_key, ZGetSession(), sizeof(C_Block));
#endif
diff --git a/server/kopt.c b/server/kopt.c
index 30cddff..3017217 100644
--- a/server/kopt.c
+++ b/server/kopt.c
@@ -26,7 +26,7 @@ static const char *rcsid_rd_req_c =
#endif /* lint */
#endif /* SABER */
-#ifdef ZEPHYR_USES_KERBEROS
+#ifdef HAVE_KRB4
#ifndef NOENCRYPTION
/* Byte ordering */
@@ -610,5 +610,5 @@ decomp_ticket(tkt, flags, pname, pinstance, prealm, paddress, session,
return(KSUCCESS);
}
-#endif /* ZEPHYR_USES_KERBEROS */
+#endif /* HAVE_KRB4 */
diff --git a/server/main.c b/server/main.c
index af0d91c..413bbe3 100644
--- a/server/main.c
+++ b/server/main.c
@@ -91,10 +91,10 @@ unsigned short hm_srv_port; /* host manager server sending port */
char *programname; /* set to the basename of argv[0] */
char myname[MAXHOSTNAMELEN]; /* my host name */
-#ifndef ZEPHYR_USES_HESIOD
+#ifndef HAVE_HESIOD
char list_file[128];
#endif
-#ifdef ZEPHYR_USES_KERBEROS
+#ifdef HAVE_KRB4
char srvtab_file[128];
char my_realm[REALM_SZ];
static char tkt_file[128];
@@ -139,10 +139,10 @@ main(argc, argv)
extern char *optarg;
extern int optind;
-#ifndef ZEPHYR_USES_HESIOD
+#ifndef HAVE_HESIOD
sprintf(list_file, "%s/%s", SYSCONFDIR, SERVER_LIST_FILE);
#endif
-#ifdef ZEPHYR_USES_KERBEROS
+#ifdef HAVE_KRB4
sprintf(srvtab_file, "%s/%s", SYSCONFDIR, ZEPHYR_SRVTAB);
sprintf(tkt_file, "%s/%s", SYSCONFDIR, ZEPHYR_TKFILE);
#endif
@@ -168,7 +168,7 @@ main(argc, argv)
nofork = 1;
break;
case 'k':
-#ifdef ZEPHYR_USES_KERBEROS
+#ifdef HAVE_KRB4
strncpy(my_realm, optarg, REALM_SZ);
#endif
break;
@@ -186,7 +186,7 @@ main(argc, argv)
}
}
-#ifdef ZEPHYR_USES_KERBEROS
+#ifdef HAVE_KRB4
/* if there is no readable srvtab and we are not standalone, there
is no possible way we can succeed, so we exit */
@@ -206,7 +206,7 @@ main(argc, argv)
exit(1);
}
}
-#endif /* ZEPHYR_USES_KERBEROS */
+#endif /* HAVE_KRB4 */
#ifndef DEBUG
if (!nofork)
@@ -297,7 +297,7 @@ main(argc, argv)
/* Reinitialize t_local now that initialization is done. */
gettimeofday(&t_local, NULL);
uptime = NOW;
-#ifdef ZEPHYR_USES_KERBEROS
+#ifdef HAVE_KRB4
timer_set_rel(SWEEP_INTERVAL, sweep_ticket_hash_table, NULL);
#endif
@@ -375,7 +375,7 @@ initialize()
server_init();
-#ifdef ZEPHYR_USES_KERBEROS
+#ifdef HAVE_KRB4
krb_set_tkt_string(tkt_file);
#endif
realm_init();
@@ -502,7 +502,7 @@ bye(sig)
{
server_shutdown(); /* tell other servers */
hostm_shutdown(); /* tell our hosts */
-#ifdef ZEPHYR_USES_KERBEROS
+#ifdef HAVE_KRB4
dest_tkt();
#endif
syslog(LOG_NOTICE, "goodbye (sig %d)", sig);
diff --git a/server/realm.c b/server/realm.c
index a6f2577..bba624e 100644
--- a/server/realm.c
+++ b/server/realm.c
@@ -18,7 +18,7 @@ static void rlm_nack_cancel __P((ZNotice_t *notice, struct sockaddr_in *who));
static void rlm_new_ticket __P(());
static void rlm_rexmit __P((void *arg));
static Code_t realm_ulocate_dispatch __P((ZNotice_t *notice,int auth,struct sockaddr_in *who,Server *server,Realm *realm));
-#ifdef ZEPHYR_USES_KERBEROS
+#ifdef HAVE_KRB4
static Code_t ticket_retrieve __P((Realm *realm));
#endif
@@ -448,7 +448,7 @@ realm_init()
abort();
}
memset(&client->addr, 0, sizeof(struct sockaddr_in));
-#ifdef ZEPHYR_USES_KERBEROS
+#ifdef HAVE_KRB4
memset(&client->session_key, 0, sizeof(client->session_key));
#endif
sprintf(rlmprinc, "%s.%s@%s", SERVER_SERVICE, SERVER_INSTANCE, rlm->name);
@@ -566,7 +566,7 @@ realm_handoff(notice, auth, who, realm, ack_to_sender)
Realm *realm;
int ack_to_sender;
{
-#ifdef ZEPHYR_USES_KERBEROS
+#ifdef HAVE_KRB4
Code_t retval;
if (!auth) {
@@ -583,9 +583,9 @@ realm_handoff(notice, auth, who, realm, ack_to_sender)
zdbug((LOG_DEBUG, "realm_sendit to realm %s auth %d", realm->name, auth));
/* valid ticket available now, send the message */
realm_sendit_auth(notice, who, auth, realm, ack_to_sender);
-#else /* ZEPHYR_USES_KERBEROS */
+#else /* HAVE_KRB4 */
realm_sendit(notice, who, auth, realm, ack_to_sender);
-#endif /* ZEPHYR_USES_KERBEROS */
+#endif /* HAVE_KRB4 */
}
static void
@@ -731,7 +731,7 @@ realm_dump_realms(fp)
}
-#ifdef ZEPHYR_USES_KERBEROS
+#ifdef HAVE_KRB4
static void
realm_sendit_auth(notice, who, auth, realm, ack_to_sender)
ZNotice_t *notice;
@@ -1082,5 +1082,5 @@ ticket_retrieve(realm)
return (1);
}
}
-#endif /* ZEPHYR_USES_KERBEROS */
+#endif /* HAVE_KRB4 */
diff --git a/server/server.c b/server/server.c
index 70a06b9..186fbdf 100644
--- a/server/server.c
+++ b/server/server.c
@@ -92,7 +92,7 @@ static Code_t server_register();
#endif
static struct in_addr *get_server_addrs __P((int *number));
-#ifndef ZEPHYR_USES_HESIOD
+#ifndef HAVE_HESIOD
static char **get_server_list __P((char *file));
static void free_server_list __P((char **list));
#endif
@@ -956,7 +956,7 @@ send_stats(who)
/*
* Get a list of server addresses.
-#ifdef ZEPHYR_USES_HESIOD
+#ifdef HAVE_HESIOD
* This list is retrieved from Hesiod.
#else
* This list is read from a file.
@@ -976,7 +976,7 @@ get_server_addrs(number)
struct in_addr *addr;
struct hostent *hp;
-#ifdef ZEPHYR_USES_HESIOD
+#ifdef HAVE_HESIOD
/* get the names from Hesiod */
server_hosts = hes_resolve("zephyr","sloc");
if (!server_hosts)
@@ -1004,13 +1004,13 @@ get_server_addrs(number)
}
}
*number = i;
-#ifndef ZEPHYR_USES_HESIOD
+#ifndef HAVE_HESIOD
free_server_list(server_hosts);
#endif
return addrs;
}
-#ifndef ZEPHYR_USES_HESIOD
+#ifndef HAVE_HESIOD
static int nhosts = 0;
diff --git a/server/subscr.c b/server/subscr.c
index c305c70..140cdf0 100644
--- a/server/subscr.c
+++ b/server/subscr.c
@@ -61,7 +61,7 @@ static const char rcsid_subscr_c[] = "$Id$";
*
*/
-#ifdef ZEPHYR_USES_KERBEROS
+#ifdef HAVE_KRB4
#ifndef NOENCRYPTION
C_Block serv_key;
Sched serv_ksched;
@@ -839,10 +839,10 @@ subscr_send_subs(client)
{
int i = 0;
Destlist *subs;
-#ifdef ZEPHYR_USES_KERBEROS
+#ifdef HAVE_KRB4
char buf[512];
C_Block cblock;
-#endif /* ZEPHYR_USES_KERBEROS */
+#endif /* HAVE_KRB4 */
char buf2[512];
char *list[7 * NUM_FIELDS];
int num = 0;
@@ -855,7 +855,7 @@ subscr_send_subs(client)
list[num++] = buf2;
-#ifdef ZEPHYR_USES_KERBEROS
+#ifdef HAVE_KRB4
#ifdef NOENCRYPTION
memcpy(cblock, client->session_key, sizeof(C_Block));
#else
@@ -873,7 +873,7 @@ subscr_send_subs(client)
zdbug((LOG_DEBUG, "cblock %s", buf));
#endif
}
-#endif /* ZEPHYR_USES_KERBEROS */
+#endif /* HAVE_KRB4 */
retval = bdump_send_list_tcp(SERVACK, &client->addr, ZEPHYR_ADMIN_CLASS,
num > 1 ? "CBLOCK" : "", ADMIN_NEWCLT,
client->principal->string, "", list, num);
diff --git a/server/zsrv_conf.h b/server/zsrv_conf.h
index 2440d1d..9c2cbce 100644
--- a/server/zsrv_conf.h
+++ b/server/zsrv_conf.h
@@ -18,11 +18,11 @@
/* Path names are relative to CONFDIR, except for the class registry. */
-#ifndef ZEPHYR_USES_HESIOD
+#ifndef HAVE_HESIOD
#define SERVER_LIST_FILE "server.list"
#endif
#define REALM_LIST_FILE "realm.list"
-#ifdef ZEPHYR_USES_KERBEROS
+#ifdef HAVE_KRB4
#define ZEPHYR_SRVTAB "srvtab"
#define ZEPHYR_TKFILE "ztkts"
#endif