(void *)chl);
}
-/* Checks string for bad characters and returns TRUE if they are found. */
-
-bool silc_server_name_bad_chars(const char *name, SilcUInt32 name_len)
-{
- int i;
-
- for (i = 0; i < name_len; i++) {
- if (!isascii(name[i]))
- return TRUE;
- if (name[i] <= 32) return TRUE;
- if (name[i] == ' ') return TRUE;
- if (name[i] == '*') return TRUE;
- if (name[i] == '?') return TRUE;
- if (name[i] == ',') return TRUE;
- if (name[i] == '@') return TRUE;
- if (name[i] == '!') return TRUE;
- }
-
- return FALSE;
-}
-
-/* Same as silc_server_name_bad_chars but check for channel names. */
-
-bool silc_server_name_bad_chchars(const char *name, SilcUInt32 name_len)
-{
- int i;
-
- for (i = 0; i < name_len; i++) {
- if (!isascii(name[i]))
- return TRUE;
- if (name[i] <= 32) return TRUE;
- if (name[i] == ' ') return TRUE;
- if (name[i] == '*') return TRUE;
- if (name[i] == '?') return TRUE;
- if (name[i] == ',') return TRUE;
- }
-
- return FALSE;
-}
-
-/* Modifies the `name' if it includes bad characters and returns new
- allocated name that does not include bad characters. */
-
-char *silc_server_name_modify_bad(const char *name, SilcUInt32 name_len)
-{
- int i;
- char *newname = strdup(name);
-
- for (i = 0; i < name_len; i++) {
- if (!isascii(newname[i])) newname[i] = '_';
- if (newname[i] <= 32) newname[i] = '_';
- if (newname[i] == ' ') newname[i] = '_';
- if (newname[i] == '*') newname[i] = '_';
- if (newname[i] == '?') newname[i] = '_';
- if (newname[i] == ',') newname[i] = '_';
- }
-
- return newname;
-}
-
/* Find number of sockets by IP address indicated by `ip'. Returns 0 if
socket connections with the IP address does not exist. */
for (i = 0, count = 0; i < server->config->param.connections_max; i++) {
if (server->sockets[i] && !SILC_IS_LISTENER(server->sockets[i]) &&
+ !SILC_IS_HOST_LOOKUP(server->sockets[i]) &&
!strcmp(server->sockets[i]->ip, ip) &&
server->sockets[i]->type == type)
count++;
for (i = 0, count = 0; i < server->config->param.connections_max; i++) {
if (server->sockets[i] && !SILC_IS_LISTENER(server->sockets[i]) &&
+ !SILC_IS_HOST_LOOKUP(server->sockets[i]) &&
((ip && !strcmp(server->sockets[i]->ip, ip)) ||
(hostname && !strcmp(server->sockets[i]->hostname, hostname))) &&
server->sockets[i]->port == port &&
int i;
for (i = 0; i < server->config->param.connections_max; i++) {
- if (!server->sockets[i])
+ if (!server->sockets[i] || SILC_IS_HOST_LOOKUP(server->sockets[i]))
continue;
if (!strcmp(server->sockets[i]->ip, ip) &&
(!port || server->sockets[i]->port == port) &&
tmp = silc_argument_get_first_arg(args, &type, &len);
while (tmp) {
if (type == 1) {
- /* Check validity of the string */
+ /* Check validity of the string. Actually we should parse the
+ whole string and verify all components individually. */
if (!silc_utf8_valid(tmp, len) || !len) {
tmp = silc_argument_get_next_arg(args, &type, &len);
continue;
}
+ if (strchr(tmp, ',')) {
+ tmp = silc_argument_get_next_arg(args, &type, &len);
+ continue;
+ }
/* Check if the string is added already */
silc_hash_table_list(list, &htl);
tmp = silc_argument_get_first_arg(args, &type, &len);
while (tmp) {
if (type == 1) {
- /* Check validity of the string */
+ /* Check validity of the string. Actually we should parse the
+ whole string and verify all components individually. */
if (!silc_utf8_valid(tmp, len)) {
tmp = silc_argument_get_next_arg(args, &type, &len);
continue;
}
+ if (strchr(tmp, ',')) {
+ tmp = silc_argument_get_next_arg(args, &type, &len);
+ continue;
+ }
/* Delete from the list */
silc_hash_table_list(list, &htl);
if (type == 0x00) {
/* Add new public key to channel public key list */
- SILC_LOG_DEBUG(("Add new channel public key to channel %s",
- channel->channel_name));
+ SILC_LOG_DEBUG(("Add new channel public key %s to channel %s",
+ chpk->identifier, channel->channel_name));
/* Check for resource limit */
if (silc_hash_table_count(channel->channel_pubkeys) > 64) {