From: <dia...@us...> - 2003-10-25 20:34:46
|
Update of /cvsroot/genericircd/gircd2.0/ircd In directory sc8-pr-cvs1:/tmp/cvs-serv15256/ircd Modified Files: ircd_features.c s_user.c Log Message: Added USER CLOAK Feature. Index: ircd_features.c =================================================================== RCS file: /cvsroot/genericircd/gircd2.0/ircd/ircd_features.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ircd_features.c 11 Oct 2003 13:59:19 -0000 1.2 --- ircd_features.c 25 Oct 2003 20:30:24 -0000 1.3 *************** *** 258,261 **** --- 258,263 ---- F_B(CONNEXIT_NOTICES, 0, 0, 0), F_B(TOPIC_BURST, 0, 0, 0), + F_B(USERCLOAK, 0, 1, 0), + F_S(USER_CLOAK_HOST, FEAT_CASE, "cloak.genericnet.org", 0), /* features that probably should not be touched */ Index: s_user.c =================================================================== RCS file: /cvsroot/genericircd/gircd2.0/ircd/s_user.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** s_user.c 15 Oct 2003 11:55:04 -0000 1.2 --- s_user.c 25 Oct 2003 20:30:24 -0000 1.3 *************** *** 733,736 **** --- 733,751 ---- ircd_strncpy(cli_user(new_client)->host, host, HOSTLEN); } + if (!account && HasHiddenHost(new_client)) { + char *ip_to_hide; + ip_to_hide = (char*)ircd_ntoa((const char*) &(cli_ip(new_client))); + char *cloaked_host; + cloaked_host = crypt(ip_to_hide, "AA"); + int cuc=0; + while ( cloaked_host[cuc] ) { + if ((int)cloaked_host[cuc] == '/') cloaked_host[cuc]=(char)'G'; + if ((int)cloaked_host[cuc] == '.') cloaked_host[cuc]=(char)'G'; + cuc++; + } + cloaked_host+=6; + ircd_snprintf(0, cli_user(new_client)->host, HOSTLEN, "user-%s.%s", cloaked_host, feature_str(FEAT_USER_CLOAK_HOST)); + } + } *************** *** 1089,1103 **** } ! if (((flag == FLAG_HIDDENHOST) && !HasFlag(cptr, FLAG_ACCOUNT)) ! || ((flag == FLAG_ACCOUNT) && !HasFlag(cptr, FLAG_HIDDENHOST))) { ! /* The user doesn't have both flags, don't change the hostmask */ SetFlag(cptr, flag); - return 0; } - - sendcmdto_common_channels_butone(cptr, CMD_QUIT, cptr, ":Registered"); - ircd_snprintf(0, cli_user(cptr)->host, HOSTLEN, "%s.%s", - cli_user(cptr)->account, feature_str(FEAT_HIDDEN_HOST)); - SetFlag(cptr, flag); /* ok, the client is now fully hidden, so let them know -- hikari */ --- 1104,1139 ---- } ! /* New code to add the random user cloak when setting +x and user is not logged in @ the channel services - Diaboliq */ ! if (!feature_bool(FEAT_USERCLOAK)) { ! if (((flag == FLAG_HIDDENHOST) && !HasFlag(cptr, FLAG_ACCOUNT)) ! || ((flag == FLAG_ACCOUNT) && !HasFlag(cptr, FLAG_HIDDENHOST))) { ! /* The user doesn't have both flags, don't change the hostmask */ ! SetFlag(cptr, flag); ! return 0; ! } ! } ! /* If the user set +x but has no account insert the random host */ ! if (HasFlag(cptr, FLAG_ACCOUNT)) { ! sendcmdto_common_channels_butone(cptr, CMD_QUIT, cptr, ":Registered"); ! ircd_snprintf(0, cli_user(cptr)->host, HOSTLEN, "%s.%s", ! cli_user(cptr)->account, feature_str(FEAT_HIDDEN_HOST)); ! SetFlag(cptr, flag); ! } ! else { ! sendcmdto_common_channels_butone(cptr, CMD_QUIT, cptr, ":User cloaking in progress..."); ! char *ip_to_hide; ! ip_to_hide = (char*)ircd_ntoa((const char*) &(cli_ip(cptr))); ! char *cloaked_host; ! cloaked_host = crypt(ip_to_hide, "AA"); ! int cuc=0; ! while ( cloaked_host[cuc] ) { ! if ((int)cloaked_host[cuc] == '/') cloaked_host[cuc]=(char)'G'; ! if ((int)cloaked_host[cuc] == '.') cloaked_host[cuc]=(char)'G'; ! cuc++; ! } ! cloaked_host+=6; ! ircd_snprintf(0, cli_user(cptr)->host, HOSTLEN, "user-%s.%s", cloaked_host, feature_str(FEAT_USER_CLOAK_HOST)); SetFlag(cptr, flag); } /* ok, the client is now fully hidden, so let them know -- hikari */ |