Make opers with no known privset pass IsOperGeneral

This commit is contained in:
Ed Kellett 2020-07-25 16:53:19 +01:00
parent 734e774713
commit 64c9f5093f
No known key found for this signature in database
GPG key ID: CB9986DEF342FABC

View file

@ -147,6 +147,7 @@ extern void cluster_generic(struct Client *, const char *, int cltype,
#define IsOperConfNeedSSL(x) ((x)->flags & OPER_NEEDSSL) #define IsOperConfNeedSSL(x) ((x)->flags & OPER_NEEDSSL)
#define HasPrivilege(x, y) ((x)->user != NULL && (x)->user->privset != NULL && privilegeset_in_set((x)->user->privset, (y))) #define HasPrivilege(x, y) ((x)->user != NULL && (x)->user->privset != NULL && privilegeset_in_set((x)->user->privset, (y)))
#define MayHavePrivilege(x, y) (HasPrivilege((x), (y)) || (IsOper((x)) && (x)->user != NULL && (x)->user->privset == NULL))
#define IsOperGlobalKill(x) (HasPrivilege((x), "oper:global_kill")) #define IsOperGlobalKill(x) (HasPrivilege((x), "oper:global_kill"))
#define IsOperLocalKill(x) (HasPrivilege((x), "oper:local_kill")) #define IsOperLocalKill(x) (HasPrivilege((x), "oper:local_kill"))
@ -165,7 +166,7 @@ extern void cluster_generic(struct Client *, const char *, int cltype,
#define IsOperInvis(x) (HasPrivilege((x), "oper:hidden")) #define IsOperInvis(x) (HasPrivilege((x), "oper:hidden"))
#define IsOperRemoteBan(x) (HasPrivilege((x), "oper:remoteban")) #define IsOperRemoteBan(x) (HasPrivilege((x), "oper:remoteban"))
#define IsOperMassNotice(x) (HasPrivilege((x), "oper:mass_notice")) #define IsOperMassNotice(x) (HasPrivilege((x), "oper:mass_notice"))
#define IsOperGeneral(x) (HasPrivilege((x), "oper:general")) #define IsOperGeneral(x) (MayHavePrivilege((x), "oper:general"))
#define SeesOper(target, source) (IsOper((target)) && ((!ConfigFileEntry.hide_opers && !HasPrivilege((target), "oper:hidden")) || HasPrivilege((source), "auspex:oper"))) #define SeesOper(target, source) (IsOper((target)) && ((!ConfigFileEntry.hide_opers && !HasPrivilege((target), "oper:hidden")) || HasPrivilege((source), "auspex:oper")))