]> jfr.im git - solanum.git/blobdiff - modules/m_grant.c
Kill Travis
[solanum.git] / modules / m_grant.c
index 116d5782e1352976ef5536f599396f526a786444..0021b7c00348b04f43e768f37dbd1befc08b9a1b 100644 (file)
@@ -75,14 +75,6 @@ me_grant(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source
                return;
        }
 
-       if(!find_shared_conf(source_p->username, source_p->host,
-                               source_p->servptr->name, SHARED_GRANT))
-       {
-               sendto_one(source_p, ":%s NOTICE %s :You don't have an appropriate shared"
-                       "block to grant privilege on this server.", me.name, source_p->name);
-               return;
-       }
-
        do_grant(source_p, target_p, parv[2]);
 }
 
@@ -92,14 +84,13 @@ static int do_grant(struct Client *source_p, struct Client *target_p, const char
        int dooper = 0, dodeoper = 0;
        struct PrivilegeSet *privset = 0;
 
-       if (!strcmp(new_privset, "deoper"))
+       if (!strcasecmp(new_privset, "deoper"))
        {
                if (!IsOper(target_p))
                {
                        sendto_one_notice(source_p, ":You can't deoper someone who isn't an oper.");
                        return 0;
                }
-               new_privset = "default";
                dodeoper = 1;
 
                sendto_one_notice(target_p, ":%s is deopering you.", source_p->name);
@@ -118,6 +109,12 @@ static int do_grant(struct Client *source_p, struct Client *target_p, const char
                        sendto_one_notice(source_p, ":%s already has privilege set %s.", target_p->name, target_p->user->privset->name);
                        return 0;
                }
+
+               if (ConfigFileEntry.oper_secure_only && !IsSecureClient(target_p))
+               {
+                       sendto_one_notice(source_p, ":Cannot GRANT %s, opers must be using secure connections.", target_p->name);
+                       return 0;
+               }
        }
 
        if (!dodeoper)
@@ -151,10 +148,8 @@ static int do_grant(struct Client *source_p, struct Client *target_p, const char
 
        if (dooper)
        {
-               struct oper_conf oper;
+               struct oper_conf oper = {0};
                oper.name = "<grant>";
-               oper.umodes = 0;
-               oper.snomask = 0;
                oper.privset = privset;
 
                oper_up(target_p, &oper);