Fix oper-on-connect to correctly broadcast +o to neighbour servers.
authorpk910 <philipp@zoelle1.de>
Tue, 28 Jun 2011 13:43:30 +0000 (15:43 +0200)
committerpk910 <philipp@zoelle1.de>
Tue, 28 Jun 2011 13:43:30 +0000 (15:43 +0200)
ircd/s_user.c

index 87c006d77396183992b008a34489a1fbf9e86520..d2342620e8f812fedd5b96dfbd12ef9d929e85de 100644 (file)
@@ -491,7 +491,15 @@ int register_user(struct Client *cptr, struct Client *sptr)
   if (IsOper(sptr))
     ++UserStats.opers;
   if (MyUser(sptr))
-    client_set_uprivs(sptr, cli_confs(sptr)->value.aconf);
+  {
+    if(IsOper(sptr)) {
+      FlagSet(&cli_confs(sptr)->value.aconf->conn_class->privs_dirty, PRIV_PROPAGATE);
+      client_set_privs(sptr, cli_confs(sptr)->value.aconf);
+      cli_handler(sptr) = OPER_HANDLER;
+    }
+    else
+      client_set_uprivs(sptr, cli_confs(sptr)->value.aconf);
+  }
   if (MyUser(sptr) && HasPriv(sptr, PRIV_SEE_IDLETIME))
     SetSeeIdletime(sptr);
 
@@ -531,13 +539,10 @@ int register_user(struct Client *cptr, struct Client *sptr)
 
     if(IsOper(sptr)) {
       send_reply(sptr, RPL_YOUREOPER);
-      FlagSet(&cli_confs(sptr)->value.aconf->conn_class->privs_dirty, PRIV_PROPAGATE);
-      client_set_privs(sptr, cli_confs(sptr)->value.aconf);
       sendto_opmask_butone(0, SNO_OLDSNO, "%s (%s@%s) is now operator (%c)",
                            cli_name(sptr), cli_user(sptr)->username, cli_sockhost(sptr),
                            IsOper(sptr) ? 'O' : 'o');
       log_write(LS_OPER, L_INFO, 0, "OPER (<OOC>) by (%#C)", sptr);
-      cli_handler(sptr) = OPER_HANDLER;
     }
     
     if(*cli_connclass(sptr))