Anope Bug Tracker - Anope Stable (2.0.x series)
View Issue Details
0001662Anope Stable (2.0.x series)[All Projects] Generalpublic2015-09-23 16:552015-12-14 02:43
capitaine 
Adam 
normalminoralways
resolvedfixed 
0001662: Accesses zero or negative are allowed
Anope previous version used levels NOJOIN and AUTODEOP which were negative by default.

Now they're gone, but negative accesses add confusion, because Chanserv acts like if they're actually zero, and it's a change of behaviour.

So I guess command Chanserv ACCESS shoud not allow adding an access of 0 nor negative, and maybe module db_old should delete negative accesses, or print a warning.
/Chanserv LEVELS #channel SET AUTOHALFOP -5
ChanServ - Level for GREET on channel #channel changed to -10.
/Chanserv ACCESS #channel ADD foo -10
ChanServ - foo added to #channel access list at level -5.

When foo joins #channel,
he was not granted anything on Anope 1.8, but is +h on 2.0
No tags attached.
Issue History
2015-09-23 16:55capitaineNew Issue
2015-09-23 23:26AdamNote Added: 0006756
2015-09-24 00:38AdamNote Added: 0006758
2015-09-24 11:55capitaineNote Added: 0006759
2015-09-24 14:01azanderNote Added: 0006761
2015-09-24 23:21AdamNote Added: 0006762
2015-12-14 02:43AdamNote Added: 0006775
2015-12-14 02:43AdamStatusnew => resolved
2015-12-14 02:43AdamResolutionopen => fixed
2015-12-14 02:43AdamAssigned To => Adam

Notes
(0006775)
Adam   
2015-12-14 02:43   
fixed in 3da2cdb49604f6814e0357e3372389326b1a9152
(0006762)
Adam   
2015-09-24 23:21   
This is because a negative level matches anyone. I'm not sure why, it used to be only -1 matched everyone.
(0006761)
azander   
2015-09-24 14:01   
They are not meaningless. I still use negative access levels to control non-registered users in my help channels.

They are useful for dealing with game channels where many, if not most, of the users never register their nicks but keep their host mask.
(0006759)
capitaine   
2015-09-24 11:55   
Ok you're right for 0, sorry. I was mistaken by that message, when do :

/Chanserv ACCESS #channel ADD foo -10000
ChanServ - Access level must be between -9999 and 10000 inclusive.

However negative accesses don't make sense, because the ACCESS help says :
"any unregistered user has a user level -1"
So, even if negative levels are actually useful, adding a neg access is not needed actually, as it must be done for a registered user and it's quite confusing.

For the reproducing steps, you're also right. I've done too many tests and just mixed the replies.
My bad... but here they are :

Anope 1.8

/Chanserv LEVELS #channel SET NOJOIN -100
ChanServ - Level for NOJOIN on channel #channel changed to -100.
/Chanserv LEVELS #channel SET AUTOHALFOP -5
ChanServ - Level for AUTOHALFOP on channel #channel changed to -5.
/Chanserv ACCESS #channel ADD foo -10
ChanServ - foo added to #channel access list at level -10.

:foo!user@---97EFBFD9 JOIN :#channel
:ChanServ!services@example.com MODE #channel -o :foo


Then Anope 2.0

/Chanserv LEVELS #channel SET AUTOHALFOP -5
ChanServ - Level for AUTOHALFOP on channel #channel changed to -5.
/Chanserv ACCESS #channel ADD foo -10
ChanServ - foo added to #channel access list at level -10.

:foo!user@---97EFBFD9 JOIN :#channel
:ChanServ!services@example.com MODE #channel +rh-o foo :foo


Finally, that -1 to -9999 access range has been inherited from the previous Anope, and is meaningless now.
(0006758)
Adam   
2015-09-24 00:38   
Also your steps to reproduce makes no sense because:

(18:37:17) <@Adam> for example he sets autohalfop to -5, and the reply from chanserv is greet set to -10
(18:37:22) <@Adam> and then he sets access add foo -10
(18:37:25) <@Adam> and it replies added at level -5
(18:37:36) <@Adam> so.. what
(18:37:41) <@Adam> I cant tell at all what is what
(0006756)
Adam   
2015-09-23 23:26   
ACCESS has never allowed adding an access of 0, if it does now that is a bug. I think it does not because of

                if (!level)
                {
                        source.Reply(_("Access level must be non-zero."));
                        return;
                }

Negative access can be useful with negative levels, so I don't think it should be removed.