sethost stuff

This commit is contained in:
fishwaldo 2002-10-16 05:33:22 +00:00
parent 42d230731b
commit 29b3e653ef
2 changed files with 8 additions and 13 deletions

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *
* $Id: m_sethost.c,v 1.4 2002/10/16 05:21:07 fishwaldo Exp $ * $Id: m_sethost.c,v 1.5 2002/10/16 05:33:22 fishwaldo Exp $
*/ */
/* List of ircd includes from ../include/ */ /* List of ircd includes from ../include/ */
@ -79,7 +79,7 @@ _moddeinit(void)
/* When we last modified the file (shown in /modlist), this is usually: /* When we last modified the file (shown in /modlist), this is usually:
*/ */
const char *_version = "$Revision: 1.4 $"; const char *_version = "$Revision: 1.5 $";
#endif #endif
/* /*
@ -98,20 +98,16 @@ static void ms_sethost(struct Client *client_p, struct Client *source_p,
target_p = find_person(parv[1]); target_p = find_person(parv[1]);
/* first find the target that we want to change */ /* first find the target that we want to change */
if (target_p != NULL) { if (target_p != NULL) {
ilog(L_WARN, "Found Target %s", target_p->name);
if (IsServer(source_p)) { if (IsServer(source_p)) {
/* client is changing his own hostname */ /* client is changing his own hostname */
ilog(L_WARN, "Target is source");
/* check its not a client on my server, because this is a error then */ /* check its not a client on my server, because this is a error then */
/* use svshost instead. */ /* use svshost instead. */
if (MyClient(target_p)) { if (MyClient(target_p)) {
ilog(L_WARN, "Target is my client?");
return; return;
} }
ilog(L_WARN, "Setting his own hostname %s", target_p->name);
SetHidden(target_p); SetHidden(target_p);
strncpy(target_p->vhost, parv[2], HOSTLEN); strncpy(target_p->vhost, parv[2], HOSTLEN);
@ -125,11 +121,9 @@ static void ms_sethost(struct Client *client_p, struct Client *source_p,
/* can't change someone else's host. (services use svshost) */ /* can't change someone else's host. (services use svshost) */
sendto_one(source_p, form_str(ERR_NOPRIVILEGES), me.name, parv[0]); sendto_one(source_p, form_str(ERR_NOPRIVILEGES), me.name, parv[0]);
return; return;
} else }
ilog(L_WARN, "shouldn't be here");
} else { } else {
ilog(L_WARN, "Couldn't find target %s", parv[1]); /* we couldn't find the target, jsut return */
/* we couldn't find the target. Just exit */
return; return;
} }
} }

View file

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA * USA
* *
* $Id: s_user.c,v 1.37 2002/10/16 05:21:08 fishwaldo Exp $ * $Id: s_user.c,v 1.38 2002/10/16 05:33:22 fishwaldo Exp $
*/ */
#include "stdinc.h" #include "stdinc.h"
@ -1046,13 +1046,14 @@ user_mode(struct Client *client_p, struct Client *source_p, int parc, char *parv
/* if they are already hidden, don't hide them again /* if they are already hidden, don't hide them again
* of they are not a local client * of they are not a local client
*/ */
SetHidden(target_p); if (IsHidden(target_p)) break;
target_p->umodes |= FLAGS_HIDDEN;
if (MyClient(target_p)) { if (MyClient(target_p)) {
make_virthost(target_p->host, target_p->localClient->sockhost, target_p->vhost); make_virthost(target_p->host, target_p->localClient->sockhost, target_p->vhost);
sendto_server(NULL, target_p, NULL, 0, 0, LL_ICLIENT, ":%s SETHOST %s :%s", me.name, target_p->name, target_p->vhost); sendto_server(NULL, target_p, NULL, 0, 0, LL_ICLIENT, ":%s SETHOST %s :%s", me.name, target_p->name, target_p->vhost);
} }
} else { } else {
ClearHidden(target_p); target_p->umodes &= ~FLAGS_HIDDEN;
strncpy(target_p->vhost, target_p->host, HOSTLEN); strncpy(target_p->vhost, target_p->host, HOSTLEN);
} }
break; break;