+2004-05-16 Michael Poole <mdpoole@troius.org>
+
+ Get rid of CONF_LOCOP; use PRIV_PROPAGATE instead.
+
+ * ircd/ircd_parser.y (invert): New variable.
+ (operlocal): Remove production.
+ (operpriv): Use "invert" variable.
+ (privtype): Add LOCAL alternative production.
+
+ * ircd/m_oper.c (m_oper): Remove references to CONF_LOCOP; replace
+ with CONF_OPERATOR or PRIV_PROPAGATE checks, as appropriate.
+
+ * ircd/s_conf.c (AuthorizationCheckResult, find_conf_exact):
+ Likewise.
+
+ * ircd/s_stats.c (report_array, statsinfo): Likewise.
+
+ * ircd/s_user.c (set_user_mode): Likewise.
+
2004-05-15 Michael Poole <mdpoole@troilus.org>
* patches/diffs/astralnet.diff, patches/diffs/nocfv.diff: Remove
#define CONF_MATCH 0x40000000
#define CONF_CLIENT 0x0002
#define CONF_SERVER 0x0004
-#define CONF_LOCOP 0x0010
#define CONF_OPERATOR 0x0020
#define CONF_LEAF 0x1000
#define CONF_HUB 0x4000
#define CONF_UWORLD 0x8000
-#define CONF_OPS (CONF_OPERATOR | CONF_LOCOP)
-#define CONF_CLIENT_MASK (CONF_CLIENT | CONF_OPS | CONF_SERVER)
+#define CONF_CLIENT_MASK (CONF_CLIENT | CONF_OPERATOR | CONF_SERVER)
#define IsIllegal(x) ((x)->status & CONF_ILLEGAL)
int yylex(void);
/* Now all the globals we need :/... */
- int tping, tconn, maxlinks, sendq, port;
+ int tping, tconn, maxlinks, sendq, port, invert;
int stringno;
char *name, *pass, *host;
char *stringlist[MAX_STRINGS];
}
};
operitems: operitem | operitems operitem;
-operitem: opername | operpass | operlocal | operhost | operclass | operpriv | error;
+operitem: opername | operpass | operhost | operclass | operpriv | error;
opername: NAME '=' QSTRING ';'
{
DupString(aconf->passwd, yylval.text);
};
-operlocal: LOCAL '=' YES ';'
-{
- /* XXX it would be good to get rid of local operators and add same
- * permission values here. But for now, I am just going with local
- * opers... */
- aconf->status = CONF_LOCOP;
-} | LOCAL '=' NO ';'
-{
- aconf->status = CONF_OPERATOR;
-};
-
operhost: HOST '=' QSTRING ';'
{
MyFree(aconf->host);
operpriv: privtype '=' yesorno ';'
{
- if ($3 == 1)
- {
- PrivSet(&aconf->privs_dirty, $1);
+ PrivSet(&aconf->privs_dirty, $1);
+ if (($3 == 1) ^ invert)
PrivSet(&aconf->privs, $1);
- }
else
- {
- PrivSet(&aconf->privs_dirty, $1);
PrivClr(&aconf->privs, $1);
- }
+ invert = 0;
};
privtype: TPRIV_CHAN_LIMIT { $$ = PRIV_CHAN_LIMIT; } |
TPRIV_UNLIMIT_QUERY { $$ = PRIV_UNLIMIT_QUERY; } |
TPRIV_DISPLAY { $$ = PRIV_DISPLAY; } |
TPRIV_SEE_OPERS { $$ = PRIV_SEE_OPERS; } |
- TPRIV_WIDE_GLINE { $$ = PRIV_WIDE_GLINE; };
+ TPRIV_WIDE_GLINE { $$ = PRIV_WIDE_GLINE; } |
+ LOCAL { $$ = PRIV_PROPAGATE; invert = 1; };
yesorno: YES { $$ = 1; } | NO { $$ = 0; };
if (EmptyString(name) || EmptyString(password))
return need_more_params(sptr, "OPER");
- aconf = find_conf_exact(name, cli_username(sptr), cli_sockhost(sptr), CONF_OPS);
+ aconf = find_conf_exact(name, cli_username(sptr), cli_sockhost(sptr), CONF_OPERATOR);
if (!aconf)
aconf = find_conf_exact(name, cli_username(sptr),
- ircd_ntoa((const char*) &(cli_ip(cptr))), CONF_OPS);
+ ircd_ntoa((const char*) &(cli_ip(cptr))), CONF_OPERATOR);
if (!aconf || IsIllegal(aconf))
{
parv[0], cli_user(sptr)->username, cli_sockhost(sptr));
return 0;
}
- assert(0 != (aconf->status & CONF_OPS));
+ assert(0 != (aconf->status & CONF_OPERATOR));
if (oper_password_match(password, aconf->passwd))
{
cli_sockhost(sptr));
return 0;
}
- if (CONF_LOCOP == aconf->status) {
+ if (!PrivHas(&aconf->privs, PRIV_PROPAGATE)) {
ClearOper(sptr);
SetLocOp(sptr);
}
return ACR_ALREADY_AUTHORIZED;
if (IsIllegal(aconf))
return ACR_NO_AUTHORIZATION;
- if ((aconf->status & (CONF_LOCOP | CONF_OPERATOR | CONF_CLIENT)) &&
+ if ((aconf->status & (CONF_OPERATOR | CONF_CLIENT)) &&
ConfLinks(aconf) >= ConfMaxLinks(aconf) && ConfMaxLinks(aconf) > 0)
return ACR_TOO_MANY_IN_CLASS; /* Use this for printing error message */
lp = make_link();
*/
if (match(tmp->host, userhost))
continue;
- if (tmp->status & (CONF_OPERATOR | CONF_LOCOP)) {
+ if (tmp->status & CONF_OPERATOR) {
if (tmp->clients < MaxLinks(tmp->conn_class))
return tmp;
else
{CONF_LEAF, RPL_STATSLLINE, 'L'},
{CONF_OPERATOR, RPL_STATSOLINE, 'O'},
{CONF_HUB, RPL_STATSHLINE, 'H'},
- {CONF_LOCOP, RPL_STATSOLINE, 'o'},
{CONF_UWORLD, RPL_STATSULINE, 'U'},
{0, 0}
};
stats_commands, 0,
"Message usage information." },
{ 'o', STAT_FLAG_OPERFEAT, FEAT_HIS_STATS_o,
- stats_configured_links, CONF_OPS,
+ stats_configured_links, CONF_OPERATOR,
"Operator information." },
{ 'p', (STAT_FLAG_OPERFEAT | STAT_FLAG_VARPARAM), FEAT_HIS_STATS_p,
show_ports, 0,
{
if ((FlagHas(&setflags, FLAG_OPER) || FlagHas(&setflags, FLAG_LOCOP)) &&
!IsAnOper(sptr))
- det_confs_butmask(sptr, CONF_CLIENT & ~CONF_OPS);
+ det_confs_butmask(sptr, CONF_CLIENT & ~CONF_OPERATOR);
if (SendServNotice(sptr))
{