Commits

William Pitcock  committed 67fdd5d Merge

Automatic branch merge from 'origin/freenode/ircd-seven-merge-to-3.2' to 'trunk'.

  • Participants
  • Parent commits 853acc5, 92079b2

Comments (0)

Files changed (4)

File modules/m_chghost.c

 clean_host(const char *host)
 {
 	int len = 0;
+	const char *last_slash = 0;
 	
 	if (*host == '\0' || *host == ':')
 		return 0;
 
 		if(!IsHostChar(*host))
 			return 0;
+		if(*host == '/')
+			last_slash = host;
 	}
 
 	if(len > HOSTLEN)
 		return 0;
 
+	if(last_slash && IsDigit(last_slash[1]))
+		return 0;
+
 	return 1;
 }
 

File src/chmode.c

 		if(*t != '\0')
 			user = t;
 	}
-	else if(strchr(mask, '.') != NULL || strchr(mask, ':') != NULL)
+	else if(strchr(mask, '.') != NULL || strchr(mask, ':') != NULL || strchr(mask, '/') != NULL)
 	{
 		if(*mask != '\0')
 			host = mask;
 /* , */ PRINT_C | NONEOS_C,
 /* - */ PRINT_C | NICK_C | CHAN_C | NONEOS_C | USER_C | HOST_C,
 /* . */ PRINT_C | KWILD_C | CHAN_C | NONEOS_C | USER_C | HOST_C | SERV_C,
-/* / */ PRINT_C | CHAN_C | NONEOS_C,
+/* / */ PRINT_C | CHAN_C | NONEOS_C | HOST_C,
 /* 0 */ PRINT_C | DIGIT_C | NICK_C | CHAN_C | NONEOS_C | USER_C | HOST_C,
 /* 1 */ PRINT_C | DIGIT_C | NICK_C | CHAN_C | NONEOS_C | USER_C | HOST_C,
 /* 2 */ PRINT_C | DIGIT_C | NICK_C | CHAN_C | NONEOS_C | USER_C | HOST_C,

File src/s_user.c

 int
 valid_hostname(const char *hostname)
 {
-	const char *p = hostname;
+	const char *p = hostname, *last_slash = 0;
 	int found_sep = 0;
 
 	s_assert(NULL != p);
 	if(hostname == NULL)
 		return NO;
 
-	if('.' == *p || ':' == *p)
+	if('.' == *p || ':' == *p || '/' == *p)
 		return NO;
 
 	while (*p)
 			return NO;
                 if(*p == '.' || *p == ':')
   			found_sep++;
+		else if(*p == '/')
+		{
+			found_sep++;
+			last_slash = p;
+		}
 		p++;
 	}
 
 	if(found_sep == 0)
-		return(NO);
+		return NO;
 
-	return (YES);
+	if(last_slash && IsDigit(last_slash[1]))
+		return NO;
+
+	return YES;
 }
 
 /*