[srvx-commits] CVS: services/src proto-common.c,1.22,1.23 tools.c,1.118,1.119
Brought to you by:
entrope
|
From: Entrope <en...@us...> - 2002-11-22 04:29:49
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv5056/src
Modified Files:
proto-common.c tools.c
Log Message:
export hidden_host_suffix, so that it is possible to...
make user_matches_glob() compare against hidden_host too
Index: proto-common.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-common.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -r1.22 -r1.23
*** proto-common.c 31 Oct 2002 03:46:20 -0000 1.22
--- proto-common.c 22 Nov 2002 04:29:46 -0000 1.23
***************
*** 35,38 ****
--- 35,39 ----
struct io_fd *socket_io_fd;
int force_n2k;
+ const char *hidden_host_suffix;
static char replay_line[MAXLEN+80];
***************
*** 41,45 ****
static int replay_connected;
static unsigned int nicklen = NICKLEN; /* how long do we think servers allow nicks to be? */
- static const char *hidden_host_suffix;
extern struct cManagerNode cManager;
--- 42,45 ----
Index: tools.c
===================================================================
RCS file: /cvsroot/srvx/services/src/tools.c,v
retrieving revision 1.118
retrieving revision 1.119
diff -C2 -r1.118 -r1.119
*** tools.c 24 Sep 2002 19:19:43 -0000 1.118
--- tools.c 22 Nov 2002 04:29:46 -0000 1.119
***************
*** 21,24 ****
--- 21,25 ----
#include "hash.h"
#include "log.h"
+ #include "nickserv.h"
#include "policer.h"
#include "recdb.h"
***************
*** 285,292 ****
--- 286,296 ----
}
+ extern const char *hidden_host_suffix;
+
int
user_matches_glob(struct userNode *user, const char *orig_glob, int include_nick)
{
char *glob, *marker;
+
/* Make a writable copy of the glob */
glob = alloca(strlen(orig_glob)+1);
***************
*** 317,320 ****
--- 321,329 ----
return match_ircglob(userip, glob);
} else {
+ if (hidden_host_suffix && user->handle_info) {
+ char hidden_host[HOSTLEN+1];
+ snprintf(hidden_host, sizeof(hidden_host), "%s.%s", user->handle_info->handle, hidden_host_suffix);
+ if (match_ircglob(hidden_host, glob)) return 1;
+ }
/* The host part of the mask isn't IP-based */
return match_ircglob(user->hostname, glob);
|