X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/3471ceb507af2356af085a40d45df049a72183a3..9d393c9052eed3ccdc83f6b9fe75fd7d258ced57:/src/s_user.c diff --git a/src/s_user.c b/src/s_user.c index f9984f4..71c9b8d 100644 --- a/src/s_user.c +++ b/src/s_user.c @@ -712,7 +712,7 @@ introduce_client(struct Client *client_p, struct Client *source_p, struct User * 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); @@ -720,7 +720,7 @@ valid_hostname(const char *hostname) if(hostname == NULL) return NO; - if('.' == *p || ':' == *p) + if('.' == *p || ':' == *p || '/' == *p) return NO; while (*p) @@ -729,13 +729,21 @@ valid_hostname(const char *hostname) 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; } /* @@ -882,7 +890,6 @@ show_other_user_mode(struct Client *source_p, struct Client *target_p) * user_mode - set get current users mode * * m_umode() added 15/10/91 By Darren Reed. - * parv[0] - sender * parv[1] - username to change mode for * parv[2] - modes to change */