2007-01-25 07:40:21 +01:00
|
|
|
/* modules/m_services.c
|
|
|
|
* Copyright (C) 2005 Lee Hardy <lee -at- leeh.co.uk>
|
|
|
|
* Copyright (C) 2005 ircd-ratbox development team
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions are
|
|
|
|
* met:
|
|
|
|
*
|
|
|
|
* 1.Redistributions of source code must retain the above copyright notice,
|
|
|
|
* this list of conditions and the following disclaimer.
|
|
|
|
* 2.Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3.The name of the author may not be used to endorse or promote products
|
|
|
|
* derived from this software without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
|
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
|
|
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
|
|
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
|
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
|
|
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
|
|
|
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
|
|
|
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
* POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
2016-08-13 05:05:54 +02:00
|
|
|
using namespace ircd;
|
|
|
|
|
2016-03-09 08:29:41 +01:00
|
|
|
static const char services_desc[] = "Provides support for running a services daemon";
|
|
|
|
|
2012-05-21 23:03:56 +02:00
|
|
|
static int _modinit(void);
|
|
|
|
static void _moddeinit(void);
|
|
|
|
|
|
|
|
static void mark_services(void);
|
|
|
|
static void unmark_services(void);
|
|
|
|
|
2016-08-23 02:37:07 +02:00
|
|
|
static void me_su(struct MsgBuf *, client::client &, client::client &, int, const char **);
|
|
|
|
static void me_login(struct MsgBuf *, client::client &, client::client &, int, const char **);
|
|
|
|
static void me_rsfnc(struct MsgBuf *, client::client &, client::client &, int, const char **);
|
|
|
|
static void me_nickdelay(struct MsgBuf *, client::client &, client::client &, int, const char **);
|
2007-01-25 07:40:21 +01:00
|
|
|
|
|
|
|
static void h_svc_server_introduced(hook_data_client *);
|
|
|
|
static void h_svc_whois(hook_data_client *);
|
|
|
|
static void h_svc_stats(hook_data_int *);
|
2012-05-21 23:03:56 +02:00
|
|
|
static void h_svc_conf_read_start(void *);
|
|
|
|
static void h_svc_conf_read_end(void *);
|
2007-01-25 07:40:21 +01:00
|
|
|
|
|
|
|
struct Message su_msgtab = {
|
2016-02-19 23:42:40 +01:00
|
|
|
"SU", 0, 0, 0, 0,
|
2007-01-25 07:40:21 +01:00
|
|
|
{mg_ignore, mg_ignore, mg_ignore, mg_ignore, {me_su, 2}, mg_ignore}
|
|
|
|
};
|
|
|
|
struct Message login_msgtab = {
|
2016-02-19 23:42:40 +01:00
|
|
|
"LOGIN", 0, 0, 0, 0,
|
2007-01-25 07:40:21 +01:00
|
|
|
{mg_ignore, mg_ignore, mg_ignore, mg_ignore, {me_login, 2}, mg_ignore}
|
|
|
|
};
|
|
|
|
struct Message rsfnc_msgtab = {
|
2016-02-19 23:42:40 +01:00
|
|
|
"RSFNC", 0, 0, 0, 0,
|
2007-01-25 07:40:21 +01:00
|
|
|
{mg_ignore, mg_ignore, mg_ignore, mg_ignore, {me_rsfnc, 4}, mg_ignore}
|
|
|
|
};
|
|
|
|
struct Message nickdelay_msgtab = {
|
2016-02-19 23:42:40 +01:00
|
|
|
"NICKDELAY", 0, 0, 0, 0,
|
2007-01-25 07:40:21 +01:00
|
|
|
{mg_unreg, mg_ignore, mg_ignore, mg_ignore, {me_nickdelay, 3}, mg_ignore}
|
|
|
|
};
|
|
|
|
|
2014-03-03 05:25:47 +01:00
|
|
|
mapi_clist_av1 services_clist[] = {
|
2007-01-25 07:40:21 +01:00
|
|
|
&su_msgtab, &login_msgtab, &rsfnc_msgtab, &nickdelay_msgtab, NULL
|
|
|
|
};
|
|
|
|
mapi_hfn_list_av1 services_hfnlist[] = {
|
|
|
|
{ "doing_stats", (hookfn) h_svc_stats },
|
|
|
|
{ "doing_whois", (hookfn) h_svc_whois },
|
|
|
|
{ "doing_whois_global", (hookfn) h_svc_whois },
|
|
|
|
{ "server_introduced", (hookfn) h_svc_server_introduced },
|
2012-05-21 23:03:56 +02:00
|
|
|
{ "conf_read_start", (hookfn) h_svc_conf_read_start },
|
|
|
|
{ "conf_read_end", (hookfn) h_svc_conf_read_end },
|
2007-01-25 07:40:21 +01:00
|
|
|
{ NULL, NULL }
|
|
|
|
};
|
|
|
|
|
2016-03-07 09:05:28 +01:00
|
|
|
DECLARE_MODULE_AV2(services, _modinit, _moddeinit, services_clist, NULL, services_hfnlist, NULL, NULL, services_desc);
|
2012-05-21 23:03:56 +02:00
|
|
|
|
|
|
|
static int
|
|
|
|
_modinit(void)
|
|
|
|
{
|
|
|
|
mark_services();
|
2016-08-25 09:59:58 +02:00
|
|
|
supported::add("FNC");
|
2014-02-20 00:18:02 +01:00
|
|
|
return 0;
|
2012-05-21 23:03:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_moddeinit(void)
|
|
|
|
{
|
2016-08-25 09:59:58 +02:00
|
|
|
supported::del("FNC");
|
2012-05-21 23:03:56 +02:00
|
|
|
unmark_services();
|
|
|
|
}
|
2007-01-25 07:40:21 +01:00
|
|
|
|
2016-03-09 08:37:03 +01:00
|
|
|
static void
|
2016-08-23 02:37:07 +02:00
|
|
|
me_su(struct MsgBuf *msgbuf_p, client::client &client, client::client &source,
|
2007-01-25 07:40:21 +01:00
|
|
|
int parc, const char *parv[])
|
|
|
|
{
|
2016-08-22 03:57:43 +02:00
|
|
|
client::client *target_p;
|
2007-01-25 07:40:21 +01:00
|
|
|
|
2016-08-23 04:33:36 +02:00
|
|
|
if(!(source.flags & client::flags::SERVICE))
|
2012-05-21 19:27:02 +02:00
|
|
|
{
|
2016-08-26 13:50:12 +02:00
|
|
|
sendto_realops_snomask(sno::GENERAL, L_ALL,
|
2016-08-23 02:37:07 +02:00
|
|
|
"Non-service server %s attempting to execute services-only command SU", source.name);
|
2016-03-09 08:37:03 +01:00
|
|
|
return;
|
2012-05-21 19:27:02 +02:00
|
|
|
}
|
2007-01-25 07:40:21 +01:00
|
|
|
|
|
|
|
if((target_p = find_client(parv[1])) == NULL)
|
2016-03-09 08:37:03 +01:00
|
|
|
return;
|
2007-01-25 07:40:21 +01:00
|
|
|
|
|
|
|
if(!target_p->user)
|
2016-03-09 08:37:03 +01:00
|
|
|
return;
|
2007-01-25 07:40:21 +01:00
|
|
|
|
|
|
|
if(EmptyString(parv[2]))
|
2016-08-22 03:57:43 +02:00
|
|
|
suser(user(*target_p)).clear();
|
2007-01-25 07:40:21 +01:00
|
|
|
else
|
2016-08-22 03:57:43 +02:00
|
|
|
suser(user(*target_p)) = parv[2];
|
2007-01-25 07:40:21 +01:00
|
|
|
|
2015-11-20 05:43:45 +01:00
|
|
|
sendto_common_channels_local_butone(target_p, CLICAP_ACCOUNT_NOTIFY, NOCAPS, ":%s!%s@%s ACCOUNT %s",
|
2010-12-16 06:04:57 +01:00
|
|
|
target_p->name, target_p->username, target_p->host,
|
2016-08-22 03:57:43 +02:00
|
|
|
suser(user(*target_p)).empty()? "*" : suser(user(*target_p)).c_str());
|
2010-12-16 06:04:57 +01:00
|
|
|
|
2016-08-18 07:33:38 +02:00
|
|
|
chan::invalidate_bancache_user(target_p);
|
2007-01-25 07:40:21 +01:00
|
|
|
}
|
|
|
|
|
2016-03-09 08:37:03 +01:00
|
|
|
static void
|
2016-08-23 02:37:07 +02:00
|
|
|
me_login(struct MsgBuf *msgbuf_p, client::client &client, client::client &source,
|
2007-01-25 07:40:21 +01:00
|
|
|
int parc, const char *parv[])
|
|
|
|
{
|
2016-08-23 04:33:36 +02:00
|
|
|
if(!is_person(source))
|
2016-03-09 08:37:03 +01:00
|
|
|
return;
|
2007-01-25 07:40:21 +01:00
|
|
|
|
2016-08-23 02:37:07 +02:00
|
|
|
suser(user(source)) = parv[1];
|
2007-01-25 07:40:21 +01:00
|
|
|
}
|
|
|
|
|
2016-03-09 08:37:03 +01:00
|
|
|
static void
|
2016-08-23 02:37:07 +02:00
|
|
|
me_rsfnc(struct MsgBuf *msgbuf_p, client::client &client, client::client &source,
|
2007-01-25 07:40:21 +01:00
|
|
|
int parc, const char *parv[])
|
|
|
|
{
|
2016-08-22 03:57:43 +02:00
|
|
|
client::client *target_p;
|
|
|
|
client::client *exist_p;
|
2007-01-25 07:40:21 +01:00
|
|
|
time_t newts, curts;
|
2008-04-01 23:12:16 +02:00
|
|
|
char note[NICKLEN + 10];
|
2007-01-25 07:40:21 +01:00
|
|
|
|
2016-08-23 04:33:36 +02:00
|
|
|
if(!(source.flags & client::flags::SERVICE))
|
2012-05-21 19:27:02 +02:00
|
|
|
{
|
2016-08-26 13:50:12 +02:00
|
|
|
sendto_realops_snomask(sno::GENERAL, L_ALL,
|
2016-08-23 02:37:07 +02:00
|
|
|
"Non-service server %s attempting to execute services-only command RSFNC", source.name);
|
2016-03-09 08:37:03 +01:00
|
|
|
return;
|
2012-05-21 19:27:02 +02:00
|
|
|
}
|
2007-01-25 07:40:21 +01:00
|
|
|
|
2016-08-22 03:57:43 +02:00
|
|
|
if((target_p = client::find_person(parv[1])) == NULL)
|
2016-03-09 08:37:03 +01:00
|
|
|
return;
|
2007-01-25 07:40:21 +01:00
|
|
|
|
2016-08-23 04:33:36 +02:00
|
|
|
if(!my(*target_p))
|
2016-03-09 08:37:03 +01:00
|
|
|
return;
|
2007-01-25 07:40:21 +01:00
|
|
|
|
2016-08-22 03:57:43 +02:00
|
|
|
if(!client::clean_nick(parv[2], 0) || rfc1459::is_digit(parv[2][0]))
|
2016-03-09 08:37:03 +01:00
|
|
|
return;
|
2007-01-25 07:40:21 +01:00
|
|
|
|
|
|
|
curts = atol(parv[4]);
|
|
|
|
|
|
|
|
/* if tsinfo is different from what it was when services issued the
|
|
|
|
* RSFNC, then we ignore it. This can happen when a client changes
|
|
|
|
* nicknames before the RSFNC arrives.. --anfl
|
|
|
|
*/
|
|
|
|
if(target_p->tsinfo != curts)
|
2016-03-09 08:37:03 +01:00
|
|
|
return;
|
2007-01-25 07:40:21 +01:00
|
|
|
|
|
|
|
if((exist_p = find_named_client(parv[2])))
|
|
|
|
{
|
|
|
|
char buf[BUFSIZE];
|
|
|
|
|
|
|
|
/* this would be one hell of a race condition to trigger
|
2014-03-03 05:25:47 +01:00
|
|
|
* this one given the tsinfo check above, but its here for
|
2007-01-25 07:40:21 +01:00
|
|
|
* safety --anfl
|
|
|
|
*/
|
|
|
|
if(target_p == exist_p)
|
2011-07-03 02:52:12 +02:00
|
|
|
goto doit;
|
2007-01-25 07:40:21 +01:00
|
|
|
|
2016-08-23 04:33:36 +02:00
|
|
|
if(my(*exist_p))
|
2007-01-25 07:40:21 +01:00
|
|
|
sendto_one(exist_p, ":%s KILL %s :(Nickname regained by services)",
|
|
|
|
me.name, exist_p->name);
|
|
|
|
|
2016-08-23 04:33:36 +02:00
|
|
|
exist_p->flags |= client::flags::KILLED;
|
2007-01-25 07:40:21 +01:00
|
|
|
/* Do not send kills to servers for unknowns -- jilles */
|
2016-08-23 04:33:36 +02:00
|
|
|
if(is_client(*exist_p))
|
2011-06-25 15:56:22 +02:00
|
|
|
{
|
2007-01-25 07:40:21 +01:00
|
|
|
kill_client_serv_butone(NULL, exist_p, "%s (Nickname regained by services)",
|
|
|
|
me.name);
|
2016-08-26 13:50:12 +02:00
|
|
|
sendto_realops_snomask(sno::SKILL, L_ALL,
|
2011-06-25 15:56:22 +02:00
|
|
|
"Nick collision due to services forced nick change on %s",
|
|
|
|
parv[2]);
|
|
|
|
}
|
2007-01-25 07:40:21 +01:00
|
|
|
|
2016-02-10 02:25:32 +01:00
|
|
|
snprintf(buf, sizeof(buf), "Killed (%s (Nickname regained by services))",
|
2007-01-25 07:40:21 +01:00
|
|
|
me.name);
|
|
|
|
exit_client(NULL, exist_p, &me, buf);
|
|
|
|
}
|
|
|
|
|
2011-07-03 02:52:12 +02:00
|
|
|
doit:
|
2007-01-25 07:40:21 +01:00
|
|
|
newts = atol(parv[3]);
|
|
|
|
|
|
|
|
/* timestamp is older than 15mins, ignore it */
|
2008-04-02 01:53:20 +02:00
|
|
|
if(newts < (rb_current_time() - 900))
|
|
|
|
newts = rb_current_time() - 900;
|
2007-01-25 07:40:21 +01:00
|
|
|
|
|
|
|
target_p->tsinfo = newts;
|
|
|
|
|
|
|
|
monitor_signoff(target_p);
|
|
|
|
|
2016-08-18 07:33:38 +02:00
|
|
|
chan::invalidate_bancache_user(target_p);
|
2007-01-25 07:40:21 +01:00
|
|
|
|
2016-08-26 13:50:12 +02:00
|
|
|
sendto_realops_snomask(sno::NCHANGE, L_ALL,
|
2007-01-25 07:40:21 +01:00
|
|
|
"Nick change: From %s to %s [%s@%s]",
|
|
|
|
target_p->name, parv[2], target_p->username,
|
|
|
|
target_p->host);
|
|
|
|
|
2015-11-20 05:43:45 +01:00
|
|
|
sendto_common_channels_local(target_p, NOCAPS, NOCAPS, ":%s!%s@%s NICK :%s",
|
2007-01-25 07:40:21 +01:00
|
|
|
target_p->name, target_p->username,
|
|
|
|
target_p->host, parv[2]);
|
|
|
|
|
2016-08-25 04:52:37 +02:00
|
|
|
whowas::add(*target_p);
|
2007-01-25 07:40:21 +01:00
|
|
|
sendto_server(NULL, NULL, CAP_TS6, NOCAPS, ":%s NICK %s :%ld",
|
|
|
|
use_id(target_p), parv[2], (long) target_p->tsinfo);
|
|
|
|
|
|
|
|
del_from_client_hash(target_p->name, target_p);
|
2011-11-29 22:50:54 +01:00
|
|
|
rb_strlcpy(target_p->name, parv[2], NICKLEN);
|
2007-01-25 07:40:21 +01:00
|
|
|
add_to_client_hash(target_p->name, target_p);
|
|
|
|
|
|
|
|
monitor_signon(target_p);
|
|
|
|
|
|
|
|
del_all_accepts(target_p);
|
|
|
|
|
2016-02-10 02:25:32 +01:00
|
|
|
snprintf(note, NICKLEN + 10, "Nick: %s", target_p->name);
|
2008-04-01 23:12:16 +02:00
|
|
|
rb_note(target_p->localClient->F, note);
|
2007-01-25 07:40:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
** me_nickdelay
|
|
|
|
** parv[1] = duration in seconds (0 to remove)
|
|
|
|
** parv[2] = nick
|
|
|
|
*/
|
2016-03-09 08:37:03 +01:00
|
|
|
static void
|
2016-08-23 02:37:07 +02:00
|
|
|
me_nickdelay(struct MsgBuf *msgbuf_p, client::client &client, client::client &source, int parc, const char *parv[])
|
2007-01-25 07:40:21 +01:00
|
|
|
{
|
|
|
|
int duration;
|
|
|
|
struct nd_entry *nd;
|
|
|
|
|
2016-08-23 04:33:36 +02:00
|
|
|
if(!(source.flags & client::flags::SERVICE))
|
2012-05-21 19:27:02 +02:00
|
|
|
{
|
2016-08-26 13:50:12 +02:00
|
|
|
sendto_realops_snomask(sno::GENERAL, L_ALL,
|
2016-08-23 02:37:07 +02:00
|
|
|
"Non-service server %s attempting to execute services-only command NICKDELAY", source.name);
|
2016-03-09 08:37:03 +01:00
|
|
|
return;
|
2012-05-21 19:27:02 +02:00
|
|
|
}
|
2007-01-25 07:40:21 +01:00
|
|
|
|
|
|
|
duration = atoi(parv[1]);
|
|
|
|
if (duration <= 0)
|
|
|
|
{
|
2016-07-13 07:17:21 +02:00
|
|
|
nd = (nd_entry *)rb_dictionary_retrieve(nd_dict, parv[2]);
|
2007-01-25 07:40:21 +01:00
|
|
|
if (nd != NULL)
|
|
|
|
free_nd_entry(nd);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (duration > 86400)
|
|
|
|
duration = 86400;
|
|
|
|
add_nd_entry(parv[2]);
|
2016-07-13 07:17:21 +02:00
|
|
|
nd = (nd_entry *)rb_dictionary_retrieve(nd_dict, parv[2]);
|
2007-01-25 07:40:21 +01:00
|
|
|
if (nd != NULL)
|
2008-04-02 01:53:20 +02:00
|
|
|
nd->expire = rb_current_time() + duration;
|
2007-01-25 07:40:21 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
h_svc_server_introduced(hook_data_client *hdata)
|
|
|
|
{
|
2008-04-01 22:18:48 +02:00
|
|
|
rb_dlink_node *ptr;
|
2007-01-25 07:40:21 +01:00
|
|
|
|
2008-04-01 22:18:48 +02:00
|
|
|
RB_DLINK_FOREACH(ptr, service_list.head)
|
2007-01-25 07:40:21 +01:00
|
|
|
{
|
|
|
|
if(!irccmp((const char *) ptr->data, hdata->target->name))
|
|
|
|
{
|
2016-08-23 04:33:36 +02:00
|
|
|
hdata->target->flags |= client::flags::SERVICE;
|
2007-01-25 07:40:21 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
h_svc_whois(hook_data_client *data)
|
|
|
|
{
|
2016-08-22 03:57:43 +02:00
|
|
|
auto &target(*data->target);
|
|
|
|
|
|
|
|
if (suser(user(target)).empty())
|
2016-08-21 02:51:50 +02:00
|
|
|
return;
|
|
|
|
|
|
|
|
/* Try to strip off any leading digits as this may be used to
|
|
|
|
* store both an ID number and an account name in one field.
|
|
|
|
* If only digits are present, leave as is.
|
|
|
|
*/
|
2016-08-22 03:57:43 +02:00
|
|
|
const char *p(suser(user(target)).c_str());
|
2016-08-21 02:51:50 +02:00
|
|
|
while(rfc1459::is_digit(*p))
|
|
|
|
p++;
|
|
|
|
|
|
|
|
if(*p == '\0')
|
2016-08-22 03:57:43 +02:00
|
|
|
p = suser(user(target)).c_str();
|
2016-08-21 02:51:50 +02:00
|
|
|
|
|
|
|
sendto_one_numeric(data->client, RPL_WHOISLOGGEDIN,
|
|
|
|
form_str(RPL_WHOISLOGGEDIN),
|
|
|
|
data->target->name,
|
|
|
|
p);
|
2007-01-25 07:40:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
h_svc_stats(hook_data_int *data)
|
|
|
|
{
|
|
|
|
char statchar = (char) data->arg2;
|
2008-04-01 22:18:48 +02:00
|
|
|
rb_dlink_node *ptr;
|
2007-01-25 07:40:21 +01:00
|
|
|
|
2016-08-24 00:25:09 +02:00
|
|
|
if (statchar == 'U' && is(*data->client, umode::OPER))
|
2007-01-25 07:40:21 +01:00
|
|
|
{
|
2008-04-01 22:18:48 +02:00
|
|
|
RB_DLINK_FOREACH(ptr, service_list.head)
|
2007-01-25 07:40:21 +01:00
|
|
|
{
|
|
|
|
sendto_one_numeric(data->client, RPL_STATSULINE,
|
|
|
|
form_str(RPL_STATSULINE),
|
2011-11-13 00:22:09 +01:00
|
|
|
(const char *)ptr->data, "*", "*", "s");
|
2007-01-25 07:40:21 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2012-05-21 23:03:56 +02:00
|
|
|
|
|
|
|
static void
|
|
|
|
h_svc_conf_read_start(void *dummy)
|
|
|
|
{
|
|
|
|
unmark_services();
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
unmark_services(void)
|
|
|
|
{
|
2016-08-22 03:57:43 +02:00
|
|
|
client::client *target_p;
|
2012-05-21 23:03:56 +02:00
|
|
|
rb_dlink_node *ptr;
|
|
|
|
|
|
|
|
RB_DLINK_FOREACH(ptr, global_serv_list.head)
|
|
|
|
{
|
2016-08-22 03:57:43 +02:00
|
|
|
target_p = (client::client *)ptr->data;
|
2012-05-21 23:03:56 +02:00
|
|
|
|
2016-08-23 04:33:36 +02:00
|
|
|
target_p->flags &= ~client::flags::SERVICE;
|
2012-05-21 23:03:56 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
h_svc_conf_read_end(void *dummy)
|
|
|
|
{
|
|
|
|
mark_services();
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
mark_services(void)
|
|
|
|
{
|
2016-08-22 03:57:43 +02:00
|
|
|
client::client *target_p;
|
2012-05-21 23:03:56 +02:00
|
|
|
rb_dlink_node *ptr;
|
|
|
|
|
|
|
|
RB_DLINK_FOREACH(ptr, service_list.head)
|
|
|
|
{
|
|
|
|
target_p = find_server(NULL, (const char *)ptr->data);
|
|
|
|
|
|
|
|
if (target_p)
|
2016-08-23 04:33:36 +02:00
|
|
|
target_p->flags |= client::flags::SERVICE;
|
2012-05-21 23:03:56 +02:00
|
|
|
}
|
|
|
|
}
|