]> jfr.im git - irc/rqf/shadowircd.git/commitdiff
Add general::default_operhost.
authorB.Greenham <redacted>
Tue, 2 Mar 2010 06:57:25 +0000 (01:57 -0500)
committerB.Greenham <redacted>
Tue, 2 Mar 2010 06:57:25 +0000 (01:57 -0500)
doc/example.conf
doc/reference.conf
include/s_conf.h
modules/m_info.c
src/newconf.c
src/s_conf.c
src/s_user.c

index 1c5c75fce73541551257817795a6f919b7e45a23..1e9234b6407736fdc87846a877d37cc467563500 100755 (executable)
@@ -462,6 +462,7 @@ general {
 
        default_operstring = "is an IRC Operator";
        default_adminstring = "is a Server Administrator";
+       default_operhost = "staff.testnet.net";
        servicestring = "is a Network Service";
        disable_fake_channels = no;
         tkline_expire_notices = no;
index 636800d23e22f0b1412d6851944491b5c702363d..5642ad79e7ec7aface5544c5a9233928b6ae3706 100755 (executable)
@@ -1004,6 +1004,13 @@ general {
         */
        default_adminstring = "is a Server Administrator";
 
+       /* default operhost: defines the default virtual host that
+        * operators will receiving upon opering up. Can be overriden
+        * by the vhost option in individual operator blocks. This
+        * must be a valid hostmask.
+        */
+       default_operhost = "staff.testnet.net";
+
        /* servicestring: defines the response for opered services (+S)
         * in /whois queries, eg "is a Network Service".
         * This is updated on rehash.
index 6e18c42da8771521699d9ec2240164382b6b7397..10f6601c94a395af25e52942561915e3079b1e28 100644 (file)
@@ -138,6 +138,7 @@ struct config_file_entry
 
        char *default_operstring;
        char *default_adminstring;
+       char *default_operhost;
        char *servicestring;
        char *kline_reason;
 
index 36cf629084ae55b98038a8eaf5a2e8e0c1b84a49..e697547b5dfd3366f35391d59cda7f58e6d3fe07 100644 (file)
@@ -151,6 +151,12 @@ static struct InfoStruct info_table[] = {
                &ConfigFileEntry.default_operstring,
                "Default operstring at startup.",
        },
+       {
+               "default_operhost",
+               OUTPUT_STRING,
+               &ConfigFileEntry.default_operhost,
+               "Default vhost for operators to receive upon opering up.",
+       },
        {
                "servicestring",
                OUTPUT_STRING,
index a13841a5f7f6b800959a7bfafc0ad8e0357bd082..ffdc34b8c5372a6700861972a860ef6ef8b9cb81 100644 (file)
@@ -2141,6 +2141,7 @@ static struct ConfEntry conf_general_table[] =
 
        { "default_operstring", CF_QSTRING, NULL, REALLEN,    &ConfigFileEntry.default_operstring },
        { "default_adminstring",CF_QSTRING, NULL, REALLEN,    &ConfigFileEntry.default_adminstring },
+       { "default_operhost",   CF_QSTRING, NULL, REALLEN,    &ConfigFileEntry.default_operhost },
        { "servicestring",      CF_QSTRING, NULL, REALLEN,    &ConfigFileEntry.servicestring },
        { "egdpool_path",       CF_QSTRING, NULL, MAXPATHLEN, &ConfigFileEntry.egdpool_path },
        { "kline_reason",       CF_QSTRING, NULL, REALLEN, &ConfigFileEntry.kline_reason },
index 66d407cef8ba768d5aa33d5e3ac59316b76af9c2..b0e07e67796d6098cb7a984c0651e79aea64a3c1 100644 (file)
@@ -680,6 +680,7 @@ set_default_conf(void)
 
        ConfigFileEntry.default_operstring = rb_strdup("is an IRC operator");
        ConfigFileEntry.default_adminstring = rb_strdup("is a Server Administrator");
+       ConfigFileEntry.default_operhost = rb_strdup("");
        ConfigFileEntry.servicestring = rb_strdup("is a Network Service");
 
        ConfigFileEntry.default_umodes = UMODE_INVISIBLE;       
@@ -876,6 +877,12 @@ validate_conf(void)
                splitchecking = 0;
        }
 
+       if(!valid_hostname(ConfigFileEntry.default_operhost))
+       {
+               conf_report_error("Warning -- invalid default_operhost specified, ignoring.");
+               ConfigFileEntry.default_operhost = rb_strdup("");
+       }
+
        /* Parse the exemptchanops option and set the internal variables
         * that we will use. */
        char * ech;
index c64d50f1e39b22267f5e13806a8434914a426f23..062b0ed12efd61207de82194750c7b1ebb3f4e1e 100644 (file)
@@ -1310,6 +1310,23 @@ oper_up(struct Client *source_p, struct oper_conf *oper_p)
        else
                source_p->umodes |= DEFAULT_OPER_UMODES;
 
+       if(!EmptyString(ConfigFileEntry.default_operhost))
+       {
+               change_nick_user_host(source_p, source_p->name, source_p->username, ConfigFileEntry.default_operhost, 0, "Changing host");
+               
+               sendto_one_numeric(source_p, RPL_HOSTHIDDEN, "%s :is now your hidden host (set by %s)", source_p->host, source_p->servptr->name);
+
+               sendto_server(NULL, NULL,
+                       CAP_EUID | CAP_TS6, NOCAPS, ":%s CHGHOST %s :%s",
+                       use_id(&me), use_id(source_p), source_p->host);
+               sendto_server(NULL, NULL,
+                       CAP_TS6, CAP_EUID, ":%s ENCAP * CHGHOST %s :%s",
+                       use_id(&me), use_id(source_p), source_p->host);
+
+               if (!IsDynSpoof(source_p))
+                       SetDynSpoof(source_p);
+       }
+
        if (oper_p->snomask)
        {
                source_p->snomask |= oper_p->snomask;