added back Dynamic U lines, +S umode checking (only from U lined Servers) and dont send a message to a user when they try to +S themselves

This commit is contained in:
fishwaldo 2002-08-14 06:29:46 +00:00
parent 0ef9c1f7fe
commit bcdfb30305
3 changed files with 43 additions and 9 deletions

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: m_nick.c,v 1.2 2002/08/14 06:01:55 fishwaldo Exp $
* $Id: m_nick.c,v 1.3 2002/08/14 06:29:46 fishwaldo Exp $
*/
#include "stdinc.h"
@ -97,7 +97,7 @@ _moddeinit(void)
mod_del_cmd(&client_msgtab);
}
const char *_version = "$Revision: 1.2 $";
const char *_version = "$Revision: 1.3 $";
#endif
/*
@ -692,6 +692,14 @@ nick_from_server(struct Client *client_p, struct Client *source_p, int parc,
if(!(source_p->umodes & FLAGS_OPER) && (flag & FLAGS_OPER))
Count.oper++;
/* we only allow Ulined Servers to set +s */
if ((flag & FLAG_SERVICES) && (!IsUlined(source_p->from)) {
sendto_one(source_p, ":%s NOTICE %s :*** Only Ulined Services can set +S", me.name, source_p->name);
sendto_realops_flags(FLAGS_ALL, L_ALL, "Warning, Non-Ulined Server %s tried to set %s as +S", source_p->from->name), source_p->name);
/* we don't allow them to get +S, so do a continue */
continue;
}
source_p->umodes |= flag & SEND_UMODES;
m++;
}

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: m_server.c,v 1.1 2002/08/14 05:47:41 fishwaldo Exp $
* $Id: m_server.c,v 1.2 2002/08/14 06:29:46 fishwaldo Exp $
*/
#include "stdinc.h"
@ -67,7 +67,7 @@ _moddeinit(void)
{
mod_del_cmd(&server_msgtab);
}
const char *_version = "$Revision: 1.1 $";
const char *_version = "$Revision: 1.2 $";
#endif
int bogus_host(char *host);
@ -245,7 +245,19 @@ static void mr_server(struct Client *client_p, struct Client *source_p,
*/
strlcpy(client_p->name, name, HOSTLEN+1);
/* clear the Ulined flag before looking into the info field for (U) (dynamic Uline) */
client_p->flags &= ~FLAGS_ULINED;
set_server_gecos(client_p, info);
/* if this server is trying to set itself Ulined, its Not allowed, so exit it */
if (IsUlined(client_p)) {
sendto_realops_flags(FLAGS_ALL, L_ALL, "Server %s trying to U line itself. No Way, Nadda, I dun think so", client_p->name);
exit_client(client_p, client_p, client_p, "Got a Gline Instead");
return;
}
client_p->hopcount = hop;
server_estab(client_p);
}
@ -477,7 +489,12 @@ static void ms_server(struct Client *client_p, struct Client *source_p,
strlcpy(target_p->name, name, HOSTLEN+1);
/* clear the Ulined flag before we look at info for (U) */
target_p->flags &= ~FLAGS_ULINED;
set_server_gecos(target_p, info);
if (IsUlined(target_p)) sendto_realops_flags(FLAGS_ALL, L_ALL, "Link %s introduced a dynamic Ulined server %s", client_p->name, target_p->name);
target_p->serv->up = find_or_add(parv[0]);
target_p->servptr = source_p;
@ -582,6 +599,16 @@ static int set_server_gecos(struct Client *client_p, char *info)
else
s = NULL;
}
/* check for (U) which is a U lined Server */
if (!strcmp(s, "(U)"))
{
SetUlined(client_p);
if(p)
s = ++p;
else
s = NULL;
}
else if(p)
*p = ' ';

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* $Id: s_user.c,v 1.2 2002/08/13 14:45:13 fishwaldo Exp $
* $Id: s_user.c,v 1.3 2002/08/14 06:29:46 fishwaldo Exp $
*/
#include "stdinc.h"
@ -74,7 +74,7 @@ struct flag_item
static struct flag_item user_modes[] =
{
{FLAGS_SERVICES, 'S'},
{FLAGS_ADMIN, 'a'},
{FLAGS_ADMIN, 'A'},
{FLAGS_BOTS, 'b'},
{FLAGS_CCONN, 'c'},
{FLAGS_DEBUG, 'd'},
@ -105,7 +105,7 @@ int user_modes_from_c_to_bitmask[] =
/* 0x20 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x2F */
/* 0x30 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x3F */
0, /* @ */
0, /* A */
FLAGS_ADMIN, /* A */
0, /* B */
0, /* C */
0, /* D */
@ -133,7 +133,7 @@ int user_modes_from_c_to_bitmask[] =
0, /* Z 0x5A */
0, 0, 0, 0, 0, /* 0x5F */
/* 0x60 */ 0,
FLAGS_ADMIN, /* a */
0, /* a */
FLAGS_BOTS, /* b */
FLAGS_CCONN, /* c */
FLAGS_DEBUG, /* d */
@ -1117,7 +1117,6 @@ int user_mode(struct Client *client_p, struct Client *source_p, int parc, char *
{
sendto_one(source_p, ":%s NOTICE %s :*** Only Services can set +S",
me.name, parv[0]);
sendto_realops_flags(FLAGS_ALL, L_ALL, "Warning Non-Ulined Server |%s| tried to set %s as Services", source_p->from->name, source_p->name);
source_p->umodes &= ~FLAGS_SERVICES;
}