Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv14627/src
Modified Files:
nickserv.c nickserv.h
Log Message:
Don't read, assign, or write numeric account IDs unless compiling with Bahamut support.
Index: nickserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/nickserv.c,v
retrieving revision 1.209
retrieving revision 1.210
diff -C2 -r1.209 -r1.210
*** nickserv.c 16 Oct 2002 03:36:10 -0000 1.209
--- nickserv.c 21 Oct 2002 02:31:08 -0000 1.210
***************
*** 320,325 ****
{
struct handle_info *hi;
- char id_base64[IDLEN + 1];
do
{
--- 320,326 ----
{
struct handle_info *hi;
+ #ifdef WITH_PROTOCOL_BAHAMUT
+ char id_base64[IDLEN + 1];
do
{
***************
*** 344,350 ****
}
} while(!id);
hi = calloc(1, sizeof(*hi));
- hi->id = id;
hi->userlist_style = HI_DEFAULT_STYLE;
hi->announcements = '?';
--- 345,353 ----
}
} while(!id);
+ #else
+ (void)id;
+ #endif
hi = calloc(1, sizeof(*hi));
hi->userlist_style = HI_DEFAULT_STYLE;
hi->announcements = '?';
***************
*** 353,357 ****
--- 356,365 ----
hi->infoline = NULL;
dict_insert(nickserv_handle_dict, hi->handle, hi);
+
+ #ifdef WITH_PROTOCOL_BAHAMUT
+ hi->id = id;
dict_insert(nickserv_id_dict, strdup(id_base64), hi);
+ #endif
+
return hi;
}
***************
*** 427,432 ****
--- 435,446 ----
struct userNode *un, *next;
struct handle_info *hi = vhi;
+
+ #ifdef WITH_PROTOCOL_BAHAMUT
char id[IDLEN + 1];
+ inttobase64(id, hi->id, IDLEN);
+ dict_remove(nickserv_id_dict, id);
+ #endif
+
free_string_list(hi->masks);
for (un = hi->users; un; un = next) {
***************
*** 435,440 ****
un->next_authed = NULL;
}
! inttobase64(id, hi->id, IDLEN);
! dict_remove(nickserv_id_dict, id);
while (hi->nicks) delete_nick(hi->nicks);
if (hi->infoline) free(hi->infoline);
--- 449,453 ----
un->next_authed = NULL;
}
!
while (hi->nicks) delete_nick(hi->nicks);
if (hi->infoline) free(hi->infoline);
***************
*** 787,795 ****
if (stamp) {
! #ifndef WITH_PROTOCOL_P10
/* Stamp users with their account ID. */
char id[IDLEN + 1];
inttobase64(id, hi->id, IDLEN);
! #else
/* Stamp users with their account name. */
char *id = hi->handle;
--- 800,808 ----
if (stamp) {
! #ifdef WITH_PROTOCOL_BAHAMUT
/* Stamp users with their account ID. */
char id[IDLEN + 1];
inttobase64(id, hi->id, IDLEN);
! #else if WITH_PROTOCOL_P10
/* Stamp users with their account name. */
char *id = hi->handle;
***************
*** 1117,1121 ****
--- 1130,1136 ----
nickserv_notice(user, NSMSG_HANDLEINFO_ON, hi->handle);
+ #ifdef WITH_PROTOCOL_BAHAMUT
nickserv_notice(user, NSMSG_HANDLEINFO_ID, hi->id);
+ #endif
nickserv_notice(user, NSMSG_HANDLEINFO_REGGED, ctime(&hi->registered));
***************
*** 2291,2295 ****
--- 2306,2312 ----
for (it = dict_first(nickserv_handle_dict); it; it = iter_next(it)) {
hi = iter_data(it);
+ #ifdef WITH_PROTOCOL_BAHAMUT
assert(hi->id);
+ #endif
saxdb_start_record(ctx, iter_key(it), 0);
if (hi->announcements != '?') {
***************
*** 2327,2331 ****
--- 2344,2350 ----
saxdb_write_string(ctx, KEY_FLAGS, flags);
}
+ #ifdef WITH_PROTOCOL_BAHAMUT
saxdb_write_int(ctx, KEY_ID, hi->id);
+ #endif
if (hi->infoline) saxdb_write_string(ctx, KEY_INFO, hi->infoline);
if (hi->last_authed_host[0]) saxdb_write_string(ctx, KEY_LAST_AUTHED_HOST, hi->last_authed_host);
Index: nickserv.h
===================================================================
RCS file: /cvsroot/srvx/services/src/nickserv.h,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -r1.38 -r1.39
*** nickserv.h 21 Aug 2002 05:42:45 -0000 1.38
--- nickserv.h 21 Oct 2002 02:31:09 -0000 1.39
***************
*** 73,77 ****
--- 73,79 ----
struct handle_info {
+ #ifdef WITH_PROTOCOL_BAHAMUT
unsigned long int id;
+ #endif
struct nick_info *nicks; /* linked list of owned nicks */
struct string_list *masks;
|