*
* Created by: John T. Kohl
*
- * $Id: uloc.c,v 1.60 2001/02/27 04:59:03 zacheiss Exp $
+ * $Id$
*
* Copyright (c) 1987,1988 by the Massachusetts Institute of Technology.
* For copying and distribution information, see the file
#ifndef lint
#ifndef SABER
static const char rcsid_uloc_c[] =
-"$Id: uloc.c,v 1.60 2001/02/27 04:59:03 zacheiss Exp $";
+"$Id$";
#endif /* SABER */
#endif /* lint */
static char **ulogin_marshal_locs __P((ZNotice_t *notice, int *found,
int auth));
-static int ul_equiv __P((Location *l1, Location *l2));
-
static void free_loc __P((Location *loc));
static void ulogin_locate_forward __P((ZNotice_t *notice,
- struct sockaddr_in *who, Realm *realm));
+ struct sockaddr_in *who, ZRealm *realm));
static Location *locations = NULL; /* ptr to first in array */
static int num_locs = 0; /* number in array */
*/
Code_t
-ulogin_dispatch(notice, auth, who, server)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
- Server *server;
+ulogin_dispatch(ZNotice_t *notice,
+ int auth,
+ struct sockaddr_in *who,
+ Server *server)
{
Exposure_type retval;
int err_ret;
login_sendit(notice, auth, who, 1);
}
} else {
- syslog(LOG_ERR, "unknown ulog opcode %s", notice->z_opcode);
+ if (!strcmp(notice->z_opcode, LOGIN_USER_LOGIN)) {
+ zdbug((LOG_DEBUG, "ulog opcode from unknown foreign realm %s",
+ notice->z_opcode));
+ } else {
+ syslog(LOG_ERR, "unknown ulog opcode %s", notice->z_opcode);
+ }
if (server == me_server)
nack(notice, who);
return ZERR_NONE;
}
static void
-login_sendit(notice, auth, who, external)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
- int external;
+login_sendit(ZNotice_t *notice,
+ int auth,
+ struct sockaddr_in *who,
+ int external)
{
ZNotice_t log_notice;
* Dispatch a LOCATE notice.
*/
Code_t
-ulocate_dispatch(notice, auth, who, server)
- ZNotice_t *notice;
- int auth;
- struct sockaddr_in *who;
- Server *server;
+ulocate_dispatch(ZNotice_t *notice,
+ int auth,
+ struct sockaddr_in *who,
+ Server *server)
{
char *cp;
- Realm *realm;
+ ZRealm *realm;
if (!strcmp(notice->z_opcode, LOCATE_LOCATE)) {
/* we are talking to a current-rev client; send an ack */
ulogin_locate(notice, who, auth);
return ZERR_NONE;
} else {
- syslog(LOG_ERR, "unknown uloc opcode %s", notice->z_opcode);
+ syslog(LOG_ERR, "unknown uloc opcode %s", notice->z_opcode);
if (server == me_server)
nack(notice, who);
return ZERR_NONE;
*/
void
-uloc_hflush(addr)
- struct in_addr *addr;
+uloc_hflush(struct in_addr *addr)
{
Location *loc;
int i = 0, new_num = 0;
}
void
-uloc_flush_client(sin)
- struct sockaddr_in *sin;
+uloc_flush_client(struct sockaddr_in *sin)
{
Location *loc;
int i = 0, new_num = 0;
/*ARGSUSED*/
Code_t
-uloc_send_locations()
+uloc_send_locations(void)
{
Location *loc;
int i;
default:
syslog(LOG_ERR,"broken location state %s/%d",
loc->user->string, (int) loc->exposure);
+ exposure_level = EXPOSE_OPSTAFF;
break;
}
retval = bdump_send_list_tcp(ACKED, &loc->addr, LOGIN_CLASS,
*/
static int
-ulogin_add_user(notice, exposure, who)
- ZNotice_t *notice;
- Exposure_type exposure;
- struct sockaddr_in *who;
+ulogin_add_user(ZNotice_t *notice,
+ Exposure_type exposure,
+ struct sockaddr_in *who)
{
Location *loc, *oldlocs, newloc;
int i;
*/
static int
-ulogin_setup(notice, locs, exposure, who)
- ZNotice_t *notice;
- Location *locs;
- Exposure_type exposure;
- struct sockaddr_in *who;
+ulogin_setup(ZNotice_t *notice,
+ Location *locs,
+ Exposure_type exposure,
+ struct sockaddr_in *who)
{
if (ulogin_parse(notice, locs))
return 1;
*/
static int
-ulogin_parse(notice, locs)
- ZNotice_t *notice;
- Location *locs;
+ulogin_parse(ZNotice_t *notice,
+ Location *locs)
{
char *cp, *base;
int nulls = 0;
static Location *
-ulogin_find(user, host, port)
- char *user;
- struct in_addr *host;
- unsigned int port;
+ulogin_find(char *user,
+ struct in_addr *host,
+ unsigned int port)
{
Location *loc;
String *str;
*/
static Location *
-ulogin_find_user(user)
- char *user;
+ulogin_find_user(char *user)
{
int i, rlo, rhi;
int compar;
return &locations[i];
}
-static int
-ul_equiv(l1, l2)
- Location *l1, *l2;
-{
- if (l1->machine != l2->machine)
- return 0;
- if (l1->tty != l2->tty)
- return 0;
- return 1;
-}
-
/*
* remove the user specified in notice from the internal table
*/
static Exposure_type
-ulogin_remove_user(notice, who, err_return)
- ZNotice_t *notice;
- struct sockaddr_in *who;
- int *err_return;
+ulogin_remove_user(ZNotice_t *notice,
+ struct sockaddr_in *who,
+ int *err_return)
{
Location *new_locs, *loc;
int i = 0;
*/
static void
-ulogin_flush_user(notice)
- ZNotice_t *notice;
+ulogin_flush_user(ZNotice_t *notice)
{
Location *loc, *loc2;
int i, j, num_match, num_left;
static void
-ulogin_locate(notice, who, auth)
- ZNotice_t *notice;
- struct sockaddr_in *who;
- int auth;
+ulogin_locate(ZNotice_t *notice,
+ struct sockaddr_in *who,
+ int auth)
{
char **answer;
int found;
*/
static char **
-ulogin_marshal_locs(notice, found, auth)
- ZNotice_t *notice;
- int *found;
- int auth;
+ulogin_marshal_locs(ZNotice_t *notice,
+ int *found,
+ int auth)
{
Location **matches = (Location **) 0;
Location *loc;
}
void
-uloc_dump_locs(fp)
- FILE *fp;
+uloc_dump_locs(FILE *fp)
{
int i;
}
static void
-free_loc(loc)
- Location *loc;
+free_loc(Location *loc)
{
free_string(loc->user);
free_string(loc->machine);
}
static void
-ulogin_locate_forward(notice, who, realm)
- ZNotice_t *notice;
- struct sockaddr_in *who;
- Realm *realm;
+ulogin_locate_forward(ZNotice_t *notice,
+ struct sockaddr_in *who,
+ ZRealm *realm)
{
ZNotice_t lnotice;
}
void
-ulogin_realm_locate(notice, who, realm)
- ZNotice_t *notice;
- struct sockaddr_in *who;
- Realm *realm;
+ulogin_realm_locate(ZNotice_t *notice,
+ struct sockaddr_in *who,
+ ZRealm *realm)
{
char **answer;
int found;
}
void
-ulogin_relay_locate(notice, who)
- ZNotice_t *notice;
- struct sockaddr_in *who;
+ulogin_relay_locate(ZNotice_t *notice,
+ struct sockaddr_in *who)
{
ZNotice_t lnotice;
Code_t retval;
lnotice = *notice;
lnotice.z_opcode = LOCATE_LOCATE;
lnotice.z_kind = ACKED;
+ lnotice.z_auth = 0;
+ lnotice.z_authent_len = 0;
+ lnotice.z_ascii_authent = "";
+ lnotice.z_checksum = 0;
+ lnotice.z_ascii_checksum = "";
if ((retval = ZFormatRawNotice(&lnotice, &pack, &packlen)) != ZERR_NONE) {
syslog(LOG_WARNING, "ulog_relay_loc format: %s",