]> arthur.barton.de Git - ngircd-alex.git/blob - src/ngircd/irc.c
Allow ERROR command on server and service links only
[ngircd-alex.git] / src / ngircd / irc.c
1 /*
2  * ngIRCd -- The Next Generation IRC Daemon
3  * Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors.
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  * Please read the file COPYING, README and AUTHORS for more information.
10  */
11
12 #include "portab.h"
13
14 /**
15  * @file
16  * IRC commands
17  */
18
19 #include "imp.h"
20 #include <assert.h>
21 #include <stdio.h>
22 #include <string.h>
23
24 #include "ngircd.h"
25 #include "conn-func.h"
26 #include "conf.h"
27 #include "channel.h"
28 #include "conn-encoding.h"
29 #include "defines.h"
30 #include "irc-write.h"
31 #include "log.h"
32 #include "match.h"
33 #include "messages.h"
34 #include "parse.h"
35 #include "tool.h"
36
37 #include "exp.h"
38 #include "irc.h"
39
40
41 static char *Option_String PARAMS((CONN_ID Idx));
42 static bool Send_Message PARAMS((CLIENT *Client, REQUEST *Req, int ForceType,
43                                  bool SendErrors));
44 static bool Send_Message_Mask PARAMS((CLIENT *from, char *command,
45                                       char *targetMask, char *message,
46                                       bool SendErrors));
47
48
49 /**
50  * Check if a list limit is reached and inform client accordingly.
51  *
52  * @param From The client.
53  * @param Count Reply item count.
54  * @param Limit Reply limit.
55  * @param Name Name of the list.
56  * @return true if list limit has been reached; false otherwise.
57  */
58 GLOBAL bool
59 IRC_CheckListTooBig(CLIENT *From, const int Count, const int Limit,
60                     const char *Name)
61 {
62         assert(From != NULL);
63         assert(Count >= 0);
64         assert(Limit > 0);
65         assert(Name != NULL);
66
67         if (Count < Limit)
68                 return false;
69
70         (void)IRC_WriteStrClient(From,
71                                  "NOTICE %s :%s list limit (%d) reached!",
72                                  Client_ID(From), Name, Limit);
73         IRC_SetPenalty(From, 2);
74         return true;
75 }
76
77
78 GLOBAL bool
79 IRC_ERROR( CLIENT *Client, REQUEST *Req )
80 {
81         assert( Client != NULL );
82         assert( Req != NULL );
83
84         if (Client_Type(Client) != CLIENT_GOTPASS
85             && Client_Type(Client) != CLIENT_GOTPASS_2813
86             && Client_Type(Client) != CLIENT_UNKNOWNSERVER
87             && Client_Type(Client) != CLIENT_SERVER
88             && Client_Type(Client) != CLIENT_SERVICE) {
89                 LogDebug("Ignored ERROR command from \"%s\" ...",
90                          Client_Mask(Client));
91                 IRC_SetPenalty(Client, 2);
92                 return CONNECTED;
93         }
94
95         if (Req->argc < 1)
96                 Log(LOG_NOTICE, "Got ERROR from \"%s\"!",
97                     Client_Mask(Client));
98         else
99                 Log(LOG_NOTICE, "Got ERROR from \"%s\": \"%s\"!",
100                     Client_Mask(Client), Req->argv[0]);
101
102         return CONNECTED;
103 } /* IRC_ERROR */
104
105
106 /**
107  * Handler for the IRC "KILL" command.
108  *
109  * This function implements the IRC command "KILL" wich is used to selectively
110  * disconnect clients. It can be used by IRC operators and servers, for example
111  * to "solve" nick collisions after netsplits. See RFC 2812 section 3.7.1.
112  *
113  * Please note that this function is also called internally, without a real
114  * KILL command being received over the network! Client is Client_ThisServer()
115  * in this case, and the prefix in Req is NULL.
116  *
117  * @param Client        The client from which this command has been received
118  *                      or Client_ThisServer() when generated interanlly.
119  * @param Req           Request structure with prefix and all parameters.
120  * @returns             CONNECTED or DISCONNECTED.
121  */
122 GLOBAL bool
123 IRC_KILL( CLIENT *Client, REQUEST *Req )
124 {
125         CLIENT *prefix, *c;
126         char reason[COMMAND_LEN], *msg;
127         CONN_ID my_conn, conn;
128
129         assert (Client != NULL);
130         assert (Req != NULL);
131
132         if (Client_Type(Client) != CLIENT_SERVER && !Client_OperByMe(Client))
133                 return IRC_WriteStrClient(Client, ERR_NOPRIVILEGES_MSG,
134                                           Client_ID(Client));
135
136         if (Req->argc != 2)
137                 return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
138                                           Client_ID(Client), Req->command);
139
140         /* Get prefix (origin); use the client if no prefix is given. */
141         if (Req->prefix)
142                 prefix = Client_Search(Req->prefix);
143         else
144                 prefix = Client;
145
146         /* Log a warning message and use this server as origin when the
147          * prefix (origin) is invalid. */
148         if (!prefix) {
149                 Log(LOG_WARNING, "Got KILL with invalid prefix: \"%s\"!",
150                     Req->prefix );
151                 prefix = Client_ThisServer();
152         }
153
154         if (Client != Client_ThisServer())
155                 Log(LOG_NOTICE|LOG_snotice,
156                     "Got KILL command from \"%s\" for \"%s\": %s",
157                     Client_Mask(prefix), Req->argv[0], Req->argv[1]);
158
159         /* Build reason string: Prefix the "reason" if the originator is a
160          * regular user, so users can't spoof KILLs of servers. */
161         if (Client_Type(Client) == CLIENT_USER)
162                 snprintf(reason, sizeof(reason), "KILLed by %s: %s",
163                          Client_ID(Client), Req->argv[1]);
164         else
165                 strlcpy(reason, Req->argv[1], sizeof(reason));
166
167         /* Inform other servers */
168         IRC_WriteStrServersPrefix(Client, prefix, "KILL %s :%s",
169                                   Req->argv[0], reason);
170
171         /* Save ID of this connection */
172         my_conn = Client_Conn( Client );
173
174         /* Do we host such a client? */
175         c = Client_Search( Req->argv[0] );
176         if( c )
177         {
178                 if(( Client_Type( c ) != CLIENT_USER ) &&
179                    ( Client_Type( c ) != CLIENT_GOTNICK ))
180                 {
181                         /* Target of this KILL is not a regular user, this is
182                          * invalid! So we ignore this case if we received a
183                          * regular KILL from the network and try to kill the
184                          * client/connection anyway (but log an error!) if the
185                          * origin is the local server. */
186
187                         if( Client != Client_ThisServer( ))
188                         {
189                                 /* Invalid KILL received from remote */
190                                 if( Client_Type( c ) == CLIENT_SERVER )
191                                         msg = ERR_CANTKILLSERVER_MSG;
192                                 else
193                                         msg = ERR_NOPRIVILEGES_MSG;
194                                 return IRC_WriteStrClient( Client, msg,
195                                         Client_ID( Client ));
196                         }
197
198                         Log( LOG_ERR, "Got KILL for invalid client type: %d, \"%s\"!",
199                              Client_Type( c ), Req->argv[0] );
200                 }
201
202                 /* Kill the client NOW:
203                  *  - Close the local connection (if there is one),
204                  *  - Destroy the CLIENT structure for remote clients.
205                  * Note: Conn_Close() removes the CLIENT structure as well. */
206                 conn = Client_Conn( c );
207                 if(conn > NONE)
208                         Conn_Close(conn, NULL, reason, true);
209                 else
210                         Client_Destroy(c, NULL, reason, false);
211         }
212         else
213                 Log( LOG_NOTICE, "Client with nick \"%s\" is unknown here.", Req->argv[0] );
214
215         /* Are we still connected or were we killed, too? */
216         if(( my_conn > NONE ) && ( Conn_GetClient( my_conn )))
217                 return CONNECTED;
218         else
219                 return DISCONNECTED;
220 } /* IRC_KILL */
221
222
223 /**
224  * Handler for the IRC command NOTICE.
225  */
226 GLOBAL bool
227 IRC_NOTICE(CLIENT *Client, REQUEST *Req)
228 {
229         return Send_Message(Client, Req, CLIENT_USER, false);
230 } /* IRC_NOTICE */
231
232
233 /**
234  * Handler for the IRC command PRIVMSG.
235  */
236 GLOBAL bool
237 IRC_PRIVMSG(CLIENT *Client, REQUEST *Req)
238 {
239         return Send_Message(Client, Req, CLIENT_USER, true);
240 } /* IRC_PRIVMSG */
241
242
243 /**
244  * Handler for the IRC command SQUERY.
245  */
246 GLOBAL bool
247 IRC_SQUERY(CLIENT *Client, REQUEST *Req)
248 {
249         return Send_Message(Client, Req, CLIENT_SERVICE, true);
250 } /* IRC_SQUERY */
251
252
253 GLOBAL bool
254 IRC_TRACE( CLIENT *Client, REQUEST *Req )
255 {
256         CLIENT *from, *target, *c;
257         CONN_ID idx, idx2;
258         char user[CLIENT_USER_LEN];
259
260         assert( Client != NULL );
261         assert( Req != NULL );
262
263         /* Bad number of arguments? */
264         if( Req->argc > 1 ) return IRC_WriteStrClient( Client, ERR_NORECIPIENT_MSG, Client_ID( Client ), Req->command );
265
266         /* Search sender */
267         if( Client_Type( Client ) == CLIENT_SERVER ) from = Client_Search( Req->prefix );
268         else from = Client;
269         if( ! from ) return IRC_WriteStrClient( Client, ERR_NOSUCHNICK_MSG, Client_ID( Client ), Req->prefix );
270
271         /* Search target */
272         if( Req->argc == 1 ) target = Client_Search( Req->argv[0] );
273         else target = Client_ThisServer( );
274         
275         /* Forward command to other server? */
276         if( target != Client_ThisServer( ))
277         {
278                 if(( ! target ) || ( Client_Type( target ) != CLIENT_SERVER )) return IRC_WriteStrClient( from, ERR_NOSUCHSERVER_MSG, Client_ID( from ), Req->argv[0] );
279
280                 /* Send RPL_TRACELINK back to initiator */
281                 idx = Client_Conn( Client ); assert( idx > NONE );
282                 idx2 = Client_Conn( Client_NextHop( target )); assert( idx2 > NONE );
283                 if( ! IRC_WriteStrClient( from, RPL_TRACELINK_MSG, Client_ID( from ), PACKAGE_NAME, PACKAGE_VERSION, Client_ID( target ), Client_ID( Client_NextHop( target )), Option_String( idx2 ), time( NULL ) - Conn_StartTime( idx2 ), Conn_SendQ( idx ), Conn_SendQ( idx2 ))) return DISCONNECTED;
284
285                 /* Forward command */
286                 IRC_WriteStrClientPrefix( target, from, "TRACE %s", Req->argv[0] );
287                 return CONNECTED;
288         }
289
290         /* Infos about all connected servers */
291         c = Client_First( );
292         while( c )
293         {
294                 if( Client_Conn( c ) > NONE )
295                 {
296                         /* Local client */
297                         if( Client_Type( c ) == CLIENT_SERVER )
298                         {
299                                 /* Server link */
300                                 strlcpy( user, Client_User( c ), sizeof( user ));
301                                 if( user[0] == '~' ) strlcpy( user, "unknown", sizeof( user ));
302                                 if( ! IRC_WriteStrClient( from, RPL_TRACESERVER_MSG, Client_ID( from ), Client_ID( c ), user, Client_Hostname( c ), Client_Mask( Client_ThisServer( )), Option_String( Client_Conn( c )))) return DISCONNECTED;
303                         }
304                         if(( Client_Type( c ) == CLIENT_USER ) && ( strchr( Client_Modes( c ), 'o' )))
305                         {
306                                 /* IRC Operator */
307                                 if( ! IRC_WriteStrClient( from, RPL_TRACEOPERATOR_MSG, Client_ID( from ), Client_ID( c ))) return DISCONNECTED;
308                         }
309                 }
310                 c = Client_Next( c );
311         }
312
313         IRC_SetPenalty( Client, 3 );
314         return IRC_WriteStrClient( from, RPL_TRACEEND_MSG, Client_ID( from ), Conf_ServerName, PACKAGE_NAME, PACKAGE_VERSION, NGIRCd_DebugLevel );
315 } /* IRC_TRACE */
316
317
318 GLOBAL bool
319 IRC_HELP( CLIENT *Client, REQUEST *Req )
320 {
321         COMMAND *cmd;
322
323         assert( Client != NULL );
324         assert( Req != NULL );
325
326         /* Bad number of arguments? */
327         if( Req->argc > 0 ) return IRC_WriteStrClient( Client, ERR_NORECIPIENT_MSG, Client_ID( Client ), Req->command );
328
329         cmd = Parse_GetCommandStruct( );
330         while( cmd->name )
331         {
332                 if( ! IRC_WriteStrClient( Client, "NOTICE %s :%s", Client_ID( Client ), cmd->name )) return DISCONNECTED;
333                 cmd++;
334         }
335         
336         IRC_SetPenalty( Client, 2 );
337         return CONNECTED;
338 } /* IRC_HELP */
339
340
341 static char *
342 #ifdef ZLIB
343 Option_String(CONN_ID Idx)
344 #else
345 Option_String(UNUSED CONN_ID Idx)
346 #endif
347 {
348         static char option_txt[8];
349 #ifdef ZLIB
350         UINT16 options;
351
352         options = Conn_Options(Idx);
353 #endif
354
355         strcpy(option_txt, "F");        /* No idea what this means, but the
356                                          * original ircd sends it ... */
357 #ifdef ZLIB
358         if(options & CONN_ZIP)          /* zlib compression supported. */
359                 strcat(option_txt, "z");
360 #endif
361
362         return option_txt;
363 } /* Option_String */
364
365
366 static bool
367 Send_Message(CLIENT * Client, REQUEST * Req, int ForceType, bool SendErrors)
368 {
369         CLIENT *cl, *from;
370         CL2CHAN *cl2chan;
371         CHANNEL *chan;
372         char *currentTarget = Req->argv[0];
373         char *lastCurrentTarget = NULL;
374         char *message = NULL;
375
376         assert(Client != NULL);
377         assert(Req != NULL);
378
379         if (Req->argc == 0) {
380                 if (!SendErrors)
381                         return CONNECTED;
382                 return IRC_WriteStrClient(Client, ERR_NORECIPIENT_MSG,
383                                           Client_ID(Client), Req->command);
384         }
385         if (Req->argc == 1) {
386                 if (!SendErrors)
387                         return CONNECTED;
388                 return IRC_WriteStrClient(Client, ERR_NOTEXTTOSEND_MSG,
389                                           Client_ID(Client));
390         }
391         if (Req->argc > 2) {
392                 if (!SendErrors)
393                         return CONNECTED;
394                 return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
395                                           Client_ID(Client), Req->command);
396         }
397
398         if (Client_Type(Client) == CLIENT_SERVER)
399                 from = Client_Search(Req->prefix);
400         else
401                 from = Client;
402         if (!from)
403                 return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG,
404                                           Client_ID(Client), Req->prefix);
405
406 #ifdef ICONV
407         if (Client_Conn(Client) > NONE)
408                 message = Conn_EncodingFrom(Client_Conn(Client), Req->argv[1]);
409         else
410 #endif
411                 message = Req->argv[1];
412
413         /* handle msgtarget = msgto *("," msgto) */
414         currentTarget = strtok_r(currentTarget, ",", &lastCurrentTarget);
415         ngt_UpperStr(Req->command);
416
417         while (currentTarget) {
418                 /* Check for and handle valid <msgto> of form:
419                  * RFC 2812 2.3.1:
420                  *   msgto =  channel / ( user [ "%" host ] "@" servername )
421                  *   msgto =/ ( user "%" host ) / targetmask
422                  *   msgto =/ nickname / ( nickname "!" user "@" host )
423                  */
424                 if (strchr(currentTarget, '!') == NULL)
425                         /* nickname */
426                         cl = Client_Search(currentTarget);
427                 else
428                         cl = NULL;
429
430                 if (cl == NULL) {
431                         /* If currentTarget isn't a nickname check for:
432                          * user ["%" host] "@" servername
433                          * user "%" host
434                          * nickname "!" user "@" host
435                          */
436                         char target[COMMAND_LEN];
437                         char * nick = NULL;
438                         char * user = NULL;
439                         char * host = NULL;
440                         char * server = NULL;
441
442                         strlcpy(target, currentTarget, COMMAND_LEN);
443                         server = strchr(target, '@');
444                         if (server) {
445                                 *server = '\0';
446                                 server++;
447                         }
448                         host = strchr(target, '%');
449                         if (host) {
450                                 *host = '\0';
451                                 host++;
452                         }
453                         user = strchr(target, '!');
454                         if (user) {
455                                 /* msgto form: nick!user@host */
456                                 *user = '\0';
457                                 user++;
458                                 nick = target;
459                                 host = server; /* not "@server" but "@host" */
460                         } else {
461                                 user = target;
462                         }
463
464                         for (cl = Client_First(); cl != NULL; cl = Client_Next(cl)) {
465                                 if (Client_Type(cl) != CLIENT_USER &&
466                                     Client_Type(cl) != CLIENT_SERVICE)
467                                         continue;
468                                 if (nick != NULL && host != NULL) {
469                                         if (strcasecmp(nick, Client_ID(cl)) == 0 &&
470                                             strcasecmp(user, Client_User(cl)) == 0 &&
471                                             strcasecmp(host, Client_HostnameDisplayed(cl)) == 0)
472                                                 break;
473                                         else
474                                                 continue;
475                                 }
476                                 if (strcasecmp(user, Client_User(cl)) != 0)
477                                         continue;
478                                 if (host != NULL && strcasecmp(host,
479                                                 Client_HostnameDisplayed(cl)) != 0)
480                                         continue;
481                                 if (server != NULL && strcasecmp(server,
482                                                 Client_ID(Client_Introducer(cl))) != 0)
483                                         continue;
484                                 break;
485                         }
486                 }
487
488                 if (cl) {
489                         /* Target is a user, enforce type */
490 #ifndef STRICT_RFC
491                         if (Client_Type(cl) != ForceType &&
492                             !(ForceType == CLIENT_USER &&
493                               (Client_Type(cl) == CLIENT_USER ||
494                                Client_Type(cl) == CLIENT_SERVICE))) {
495 #else
496                         if (Client_Type(cl) != ForceType) {
497 #endif
498                                 if (SendErrors && !IRC_WriteStrClient(
499                                     from, ERR_NOSUCHNICK_MSG,Client_ID(from),
500                                     currentTarget))
501                                         return DISCONNECTED;
502                                 goto send_next_target;
503                         }
504
505 #ifndef STRICT_RFC
506                         if (ForceType == CLIENT_SERVICE &&
507                             (Conn_Options(Client_Conn(Client_NextHop(cl)))
508                              & CONN_RFC1459)) {
509                                 /* SQUERY command but RFC 1459 link: convert
510                                  * request to PRIVMSG command */
511                                 Req->command = "PRIVMSG";
512                         }
513 #endif
514                         if (Client_HasMode(cl, 'b') &&
515                             !Client_HasMode(from, 'R') &&
516                             !Client_HasMode(from, 'o') &&
517                             !(Client_Type(from) == CLIENT_SERVER) &&
518                             !(Client_Type(from) == CLIENT_SERVICE)) {
519                                 if (SendErrors && !IRC_WriteStrClient(from,
520                                                 ERR_NONONREG_MSG,
521                                                 Client_ID(from), Client_ID(cl)))
522                                         return DISCONNECTED;
523                                 goto send_next_target;
524                         }
525
526                         if (Client_HasMode(cl, 'C')) {
527                                 cl2chan = Channel_FirstChannelOf(cl);
528                                 while (cl2chan) {
529                                         chan = Channel_GetChannel(cl2chan);
530                                         if (Channel_IsMemberOf(chan, from))
531                                                 break;
532                                         cl2chan = Channel_NextChannelOf(cl, cl2chan);
533                                 }
534                                 if (!cl2chan) {
535                                         if (SendErrors && !IRC_WriteStrClient(
536                                             from, ERR_NOTONSAMECHANNEL_MSG,
537                                             Client_ID(from), Client_ID(cl)))
538                                                 return DISCONNECTED;
539                                         goto send_next_target;
540                                 }
541                         }
542
543                         if (SendErrors && (Client_Type(Client) != CLIENT_SERVER)
544                             && strchr(Client_Modes(cl), 'a')) {
545                                 /* Target is away */
546                                 if (!IRC_WriteStrClient(from, RPL_AWAY_MSG,
547                                                         Client_ID(from),
548                                                         Client_ID(cl),
549                                                         Client_Away(cl)))
550                                         return DISCONNECTED;
551                         }
552                         if (Client_Conn(from) > NONE) {
553                                 Conn_UpdateIdle(Client_Conn(from));
554                         }
555                         if (!IRC_WriteStrClientPrefix(cl, from, "%s %s :%s",
556                                                       Req->command, Client_ID(cl),
557                                                       message))
558                                 return DISCONNECTED;
559                 } else if (ForceType != CLIENT_SERVICE
560                            && (chan = Channel_Search(currentTarget))) {
561                         if (!Channel_Write(chan, from, Client, Req->command,
562                                            SendErrors, message))
563                                         return DISCONNECTED;
564                 } else if (ForceType != CLIENT_SERVICE
565                         /* $#: server/target mask, RFC 2812, sec. 3.3.1 */
566                            && strchr("$#", currentTarget[0])
567                            && strchr(currentTarget, '.')) {
568                         /* targetmask */
569                         if (!Send_Message_Mask(from, Req->command, currentTarget,
570                                                message, SendErrors))
571                                 return DISCONNECTED;
572                 } else {
573                         if (!SendErrors)
574                                 return CONNECTED;
575                         if (!IRC_WriteStrClient(from, ERR_NOSUCHNICK_MSG,
576                                                 Client_ID(from), currentTarget))
577                                 return DISCONNECTED;
578                 }
579
580         send_next_target:
581                 currentTarget = strtok_r(NULL, ",", &lastCurrentTarget);
582                 if (currentTarget)
583                         Conn_SetPenalty(Client_Conn(Client), 1);
584         }
585
586         return CONNECTED;
587 } /* Send_Message */
588
589
590 static bool
591 Send_Message_Mask(CLIENT * from, char * command, char * targetMask,
592                   char * message, bool SendErrors)
593 {
594         CLIENT *cl;
595         bool client_match;
596         char *mask = targetMask + 1;
597         const char *check_wildcards;
598
599         cl = NULL;
600
601         if (strchr(Client_Modes(from), 'o') == NULL) {
602                 if (!SendErrors)
603                         return true;
604                 return IRC_WriteStrClient(from, ERR_NOPRIVILEGES_MSG,
605                                           Client_ID(from));
606         }
607
608         /*
609          * RFC 2812, sec. 3.3.1 requires that targetMask have at least one
610          * dot (".") and no wildcards ("*", "?") following the last one.
611          */
612         check_wildcards = strrchr(targetMask, '.');
613         assert(check_wildcards != NULL);
614         if (check_wildcards &&
615                 check_wildcards[strcspn(check_wildcards, "*?")])
616         {
617                 if (!SendErrors)
618                         return true;
619                 return IRC_WriteStrClient(from, ERR_WILDTOPLEVEL, targetMask);
620         }
621
622         /* #: hostmask, see RFC 2812, sec. 3.3.1 */
623         if (targetMask[0] == '#') {
624                 for (cl = Client_First(); cl != NULL; cl = Client_Next(cl)) {
625                         if (Client_Type(cl) != CLIENT_USER)
626                                 continue;
627                         client_match = MatchCaseInsensitive(mask, Client_Hostname(cl));
628                         if (client_match)
629                                 if (!IRC_WriteStrClientPrefix(cl, from, "%s %s :%s",
630                                                 command, Client_ID(cl), message))
631                                         return false;
632                 }
633         } else {
634                 assert(targetMask[0] == '$'); /* $: server mask, see RFC 2812, sec. 3.3.1 */
635                 for (cl = Client_First(); cl != NULL; cl = Client_Next(cl)) {
636                         if (Client_Type(cl) != CLIENT_USER)
637                                 continue;
638                         client_match = MatchCaseInsensitive(mask,
639                                         Client_ID(Client_Introducer(cl)));
640                         if (client_match)
641                                 if (!IRC_WriteStrClientPrefix(cl, from, "%s %s :%s",
642                                                 command, Client_ID(cl), message))
643                                         return false;
644                 }
645         }
646         return CONNECTED;
647 } /* Send_Message_Mask */
648
649
650 /* -eof- */