[srvx-commits] CVS: services/src proto-p10.c,1.63,1.64
Brought to you by:
entrope
|
From: Entrope <en...@us...> - 2003-06-13 00:46:40
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv32180/src
Modified Files:
proto-p10.c
Log Message:
protect ourselves from boneheaded admins (I dub this "the Byte special")
Index: proto-p10.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-p10.c,v
retrieving revision 1.63
retrieving revision 1.64
diff -C2 -r1.63 -r1.64
*** proto-p10.c 2 Jun 2003 03:23:33 -0000 1.63
--- proto-p10.c 13 Jun 2003 00:46:36 -0000 1.64
***************
*** 1350,1354 ****
{
const char *str, *desc;
! int numnick, usermask;
char numer[COMBO_NUMERIC_LEN+1];
--- 1350,1354 ----
{
const char *str, *desc;
! int numnick, usermask, max_users;
char numer[COMBO_NUMERIC_LEN+1];
***************
*** 1367,1371 ****
numnick = atoi(str);
str = conf_get_data("server/max_users", RECDB_QSTRING);
! usermask = (str ? atoi(str) : 4096) - 1;
if ((numnick < 64) && (usermask < 4096) && !force_n2k) {
inttobase64(numer, (numnick << 12) + (usermask & 0x00fff), 3);
--- 1367,1373 ----
numnick = atoi(str);
str = conf_get_data("server/max_users", RECDB_QSTRING);
! max_users = str ? atoi(str) : 4096;
! for (usermask = 4; usermask < max_users; usermask <<= 1) ;
! usermask--;
if ((numnick < 64) && (usermask < 4096) && !force_n2k) {
inttobase64(numer, (numnick << 12) + (usermask & 0x00fff), 3);
|