Page 1 of 1

<nickservnick>.users.mynetwork.com

Posted: Tue Jan 03, 2006 11:12 pm
by fgeek
Hello,

I tried to search answer a long time from forums and internet, but answer haven't popped up. My problem is this:

Normally host is d5142341.cable.wanadoo.nl and with cloack it is rox-2DCA3201.cable.wanadoo.nl how could i change this to the same way what example Quakenet is using: authname.users.quakenet.org (authname is same as you have registered + authed to Q). I think the smartest way is get the authname -part from nickserv's database, but it is crypted to md5 hashes. Any information to give me?

I am using latest unrealircd and anope services.

Posted: Wed Jan 04, 2006 12:23 am
by Stealth
I am sure there is a services module that can do just that... Or if your network is small enough, use HostServ and set them manually

Posted: Wed Jan 04, 2006 10:24 am
by Mark
Indeed, there is a module for it. Though this one isn't free ;)

http://www.unrealircd.com/index.php?pag ... dule&id=16

Posted: Wed Jan 04, 2006 4:58 pm
by fgeek
Thanks for the replies. I also found nethost.c, but it is for Anope's NickServ

Code: Select all

#include <stdio.h>
#include "module.h"
#define AUTHOR "Certus"
#define VERSION "2.1"

/**
 * network-vhost on nickserv register
 * Date: 11/07/2003
 * Author: Certus <[email protected]>
 **/

/* PLEASE EDIT THIS LINE LIKE YOU WANT IT,
 * BUT REMEMBER: IF EACH USER HAS THE SAME HOST, HOST-BANS WON'T WORK, 
 * SO U BETTER LEAVE IT UNDEFINED; WITH AN UNDEFINED NETHOST, THE NET-
 * WORK VHOST WILL BE <nickname>.<NetworkDomain>, SO MAKE SURE THAT
 * NetworkDomain IS DEFINED IN YOUR SERVICES CONFIG FILE
 */

//#define NETHOST "test.anope.org" 

/* DON'T CHANGE ANY OF THE LINES BELOW, UNLESS YOU REALLY KNOW WHAT YOU DO */


int set_netvhost(User *u);
int set_confirm_netvhost(User *u);
char dilim = ' ';
extern void addHostCore(char *nick, char *vIdent, char *vhost, char *creator, int32 tmp_time);

void AnopeInit(void) {

Command *c;
c=createCommand("register",set_netvhost,NULL,-1,-1,-1,-1,-1);
alog("Loading module hs_nethost.so [Status: %d]",moduleAddCommand(NICKSERV,c,MOD_TAIL));
c=createCommand("group",set_netvhost,NULL,-1,-1,-1,-1,-1);
moduleAddCommand(NICKSERV,c,MOD_TAIL);
c=createCommand("confirm",set_confirm_netvhost,NULL,-1,-1,-1,-1,-1);
moduleAddCommand(NICKSERV,c,MOD_TAIL);
#ifndef NETHOST
if (NetworkDomains[0])
alog("Network vHost: nickname.%s", NetworkDomains[0]);
#else
alog("Network vHost: %s", NETHOST);
#endif
}

void AnopeFini(void) {
alog("Unloading module hs_nethost.so");
}


int set_netvhost(User *u) {

int32 tmp_time;
char *vIdent = NULL;
char *networkhost=NULL;
int len = 0;
tmp_time = time(NULL);

if (!nick_identified(u))
return MOD_CONT;

#ifndef NETHOST
if(NetworkDomains[0]) {
len = strlen(NetworkDomains[0]);
len += strlen(u->nick);
if((networkhost = malloc(sizeof(char)*len+3))!=NULL) {
strcpy(networkhost,u->nick);
strcat(networkhost,".");
strcat(networkhost,NetworkDomains[0]);
} else {
return MOD_CONT;
}
} else {
return MOD_CONT;
}
#else
networkhost = sstrdup(NETHOST);
#endif

if (!isValidHost(networkhost, 3)) {
        notice(s_HostServ, u->nick, "Nick %s contains invalid vhosts characters. The vhost won't be set. [This is not a bug!]", u->nick);
free(networkhost);
return MOD_CONT;
    }
        addHostCore(u->nick, vIdent, networkhost, u->nick, tmp_time);
        notice_lang(s_HostServ, u, HOST_SET, u->nick, networkhost);
do_on_id(u);
free(networkhost);
return MOD_CONT;
}


int set_confirm_netvhost(User *u) {

int32 tmp_time;
char *nick = NULL;
char *vIdent = NULL;
char *networkhost=NULL;
char *command = NULL;
int len = 0;
tmp_time = time(NULL);

command = moduleGetLastBuffer();

if (!NSEmailReg) {
notice(s_NickServ, u->nick, "NSEmailReg is not active");
return MOD_CONT;
}

if (!nick_identified(u)) {
return MOD_CONT;
}

if (is_services_admin(u)) {
nick = myStrGetToken(command, dilim, 0);
if (!nick)
return MOD_CONT;
if (!findnick(nick))
return MOD_CONT;
} else {
nick = u->nick;
}

#ifndef NETHOST
if(NetworkDomains[0]) {
len = strlen(NetworkDomains[0]);
len += strlen(nick);
if((networkhost = malloc(sizeof(char)*len+3))!=NULL) {
strcpy(networkhost,nick);
strcat(networkhost,".");
strcat(networkhost,NetworkDomains[0]);
} else {
return MOD_CONT;
}
} else {
return MOD_CONT;
}
#else
networkhost = sstrdup(NETHOST);
#endif

if (!isValidHost(networkhost, 3)) {
        notice(s_HostServ, u->nick, "Nick %s contains invalid vhosts characters. The vhost won't be set. [This is not a bug!]", nick);
free(networkhost);
return MOD_CONT;
    }
        addHostCore(nick, vIdent, networkhost, nick, tmp_time);
        notice_lang(s_HostServ, u, HOST_SET, nick, networkhost);
if (!is_services_admin(u))
do_on_id(u);
free(networkhost);
return MOD_CONT;
}
I think that will do the job. If it dosen't I will pay for it.

Posted: Wed Aug 09, 2006 3:00 pm
by FleX
the module isnt working here.
i compiled it and tried to load but:
-> *OperServ* MODLOAD hs_nethost
-
-OperServ- Unable to load module hs_nethost
EDIT:

Now its partially working. donkt know why:
-> *OperServ* MODLOAD hs_nethost
-
-irc.lowl.de- *** Global -- from OperServ: FleX loaded module hs_nethost
-
-OperServ- Module hs_nethost loaded
-
-> *OperServ* MODLIST
-
-OperServ- Module: hs_nethost
-
-> *OperServ* MODINFO hs_nethost
-
-OperServ- Module: hs_nethost Version: ? Author: ? loaded: Aug 09 17:19:20 2006 CEST
-
-OperServ- Providing command: /msg NickServ confirm
-
-OperServ- Providing command: /msg NickServ group
-
-OperServ- Providing command: /msg NickServ register
but no VHosts are set :(

EDIT2: And.. can you say me why the Author and Version are not shown? they are in the hs_netload.c but not in the MODINFO output...