[srvx-commits] CVS: services/src hash.h,1.102,1.103 proto-common.c,1.29,1.30 proto.h,1.73,1.74
                
                Brought to you by:
                
                    entrope
                    
                
            
            
        
        
        
    | 
      
      
      From: Entrope <en...@us...> - 2003-07-08 01:17:53
      
     | 
| Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv8477/src
Modified Files:
	hash.h proto-common.c proto.h 
Log Message:
make IsChannelName() fail for all channels that contain control characters
Index: hash.h
===================================================================
RCS file: /cvsroot/srvx/services/src/hash.h,v
retrieving revision 1.102
retrieving revision 1.103
diff -C2 -r1.102 -r1.103
*** hash.h	7 Jul 2003 16:29:33 -0000	1.102
--- hash.h	8 Jul 2003 01:17:50 -0000	1.103
***************
*** 214,218 ****
  void reg_del_channel_func(del_channel_func_t handler);
  
- #define IsChannelName(x) ((*(x) == '#' || *(x) == '+') && !strpbrk((x)+1,"\a,"))
  struct chanNode* AddChannel(const char *name, time_t time_, const char *modes, char *banlist);
  void DelChannel(struct chanNode* channel);
--- 214,217 ----
Index: proto-common.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-common.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -r1.29 -r1.30
*** proto-common.c	7 Jul 2003 16:29:33 -0000	1.29
--- proto-common.c	8 Jul 2003 01:17:50 -0000	1.30
***************
*** 616,617 ****
--- 616,630 ----
      return mask;
  }
+ 
+ int
+ IsChannelName(const char *name) {
+     unsigned int ii;
+ 
+     if (*name !='#') return 0;
+     for (ii=1; name[ii]; ++ii) {
+         if (name[ii] <= 32) return 0;
+         if (name[ii] == ',') return 0;
+         if (name[ii] == '\xa0') return 0;
+     }
+     return 1;
+ }
Index: proto.h
===================================================================
RCS file: /cvsroot/srvx/services/src/proto.h,v
retrieving revision 1.73
retrieving revision 1.74
diff -C2 -r1.73 -r1.74
*** proto.h	7 Jul 2003 16:29:33 -0000	1.73
--- proto.h	8 Jul 2003 01:17:51 -0000	1.74
***************
*** 169,172 ****
--- 169,173 ----
  
  /* stuff originally from other headers that is really protocol-specific */
+ int IsChannelName(const char *name);
  int is_valid_nick(const unsigned char *nick);
  struct userNode *AddService(const char *nick, const char *desc);
 |