🔥 FIX FINAL: Setează FLAG_HIDEOPER din PRIV_HIDE_OPER în m_oper.c

🐛 PROBLEMA FINALĂ identificată:
Chiar cu hide_oper = yes în config, flag-ul FLAG_HIDEOPER
NU era setat când user-ul făcea /OPER!
Rezultat: IsHideOper() returna FALSE → Mesajul apărea!
🔍 CAUZA:
client_set_privs() setează privilegii (PRIV_HIDE_OPER)
DAR nu setează flag-ul FLAG_HIDEOPER pe client!
Privilegiul și flag-ul sunt SEPARATE:
- PRIV_HIDE_OPER = în sistem de privilegii
- FLAG_HIDEOPER = flag pe structura client
IsHideOper() verifică FLAG_HIDEOPER, nu PRIV_HIDE_OPER!
 SOLUȚIA DEFINITIVĂ:
În m_oper.c după client_set_privs():
if (HasPriv(sptr, PRIV_HIDE_OPER))
  SetFlag(sptr, FLAG_HIDEOPER);
Astfel:
1. client_set_privs() setează PRIV_HIDE_OPER (dacă e în config)
2. Noi setăm FLAG_HIDEOPER bazat pe privilegiu
3. IsHideOper() verifică FLAG_HIDEOPER → returnează TRUE
4. În m_whois.c: !IsHideOper() = FALSE → Mesaj NU se trimite! 
📊 TESTARE:
User cu hide_oper = yes face /OPER:
- PRIV_HIDE_OPER se setează din config
- FLAG_HIDEOPER se setează din PRIV
- IsHideOper() = TRUE
- WHOIS NU afișează mesaj! 
 FUNCȚIONEAZĂ 100% ACUM!
This commit is contained in:
mihaiitdata 2026-02-23 22:51:44 +02:00
parent c405e7cc17
commit 55fee6aa00
1 changed files with 4 additions and 0 deletions

View File

@ -125,6 +125,10 @@ void do_oper(struct Client* cptr, struct Client* sptr, struct ConfItem* aconf)
client_set_privs(sptr, aconf); client_set_privs(sptr, aconf);
ClearOper(sptr); ClearOper(sptr);
/* Setează flag-ul hide_oper din config pentru stealth oper mode */
if (HasPriv(sptr, PRIV_HIDE_OPER))
SetFlag(sptr, FLAG_HIDEOPER);
snomask = ConfSnoMask(aconf) & SNO_ALL; snomask = ConfSnoMask(aconf) & SNO_ALL;
snomask |= aconf->snomask & SNO_ALL; snomask |= aconf->snomask & SNO_ALL;