This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Antiproxy by metroid

Support & discussion of released scripts, and announcements of new releases.
Z
Zircon
Op
Posts: 191
Joined: Mon Aug 21, 2006 4:22 am
Location: Montreal

Post by Zircon »

nah, i MEANT the flag +h, it s never used and then has no effect ;)
I prefer +h to +f :lol:
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

That is beside the obvious point that it is considdered bad coding to use reserved keywords/flags/etc.

You might not use it, neither many others. That still does'nt mean that noone uses it. Also, it has a documented function within eggdrop, causing ambigous function of the flag. If you personally choose to use h in your private scripts is pretty much up to you, but using it in publically posted patches for other scripts is not advisable.
NML_375
Z
Zircon
Op
Posts: 191
Joined: Mon Aug 21, 2006 4:22 am
Location: Montreal

Post by Zircon »

the situation is that we want to exempt ppl that dont have acces to the bot. The flag +h can have an effect if the users are registered in the bot. Knowing that even if they are registred in the bot, the +h is rarely given, means that we can use it with no bad result....so here it has no effect. And like i said in previous post in this thread, it s not an elegant solution, but, it works. And my point was that in this case +h, or any other flag that wa are sure we wont use for other purpose, is preferable to +f. And yes of course, it s better to use the custom flags if we want to avoid any confusion, but here t doesnt make any difference. +f isnt a custom flag
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Zircon: you really are not getting it!
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Z
Zircon
Op
Posts: 191
Joined: Mon Aug 21, 2006 4:22 am
Location: Montreal

Post by Zircon »

Zircon: you're not getting it are you?
lol.

Did you get that in this situation, it makes no difference ? Did you get that using +h is better that +f ? Read the thread from the beginning, i m sure u ll get my point this time.
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

nml375 wrote:That is beside the obvious point that it is considdered bad coding to use reserved keywords/flags/etc.
Zircon: You're referred back to the above.

PS: I'm a stickler for correctness. :wink:
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Z
Zircon
Op
Posts: 191
Joined: Mon Aug 21, 2006 4:22 am
Location: Montreal

Post by Zircon »

And i refer you back to all the posts i made in this thread ;)
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Zircon: Drop the pride...
You're only making yourself looking even worse a coder by defending the improper use of h.

As said, I could'nt care less if you used h in your private scripts, but please considder using proper coding in code released publicly - Especially when you're making changes to others works.

Also worth noting, the range of flags a-z has some dependancies, such as owners will always have master privileges, masters will always have op privileges, etc... As of recently, op also implies halfop: When this change was introduced in 1.6.16, people who upgraded would see their botnets fall to pieces as there was an "undocumented feature" in the userflag l (would double as botflag l - leaf).
The list of dependancies may be changed from version to version of eggdrop, and who knows, maybe h will imply p in the future? It probably won't, but we can never know for sure. All we do know is that a-z are reserved for internal use, whereas A-Z are free to grab...
NML_375
Z
Zircon
Op
Posts: 191
Joined: Mon Aug 21, 2006 4:22 am
Location: Montreal

Post by Zircon »

Hello nml375

Me a coder ? of course not. I m far from being of coder, otherwise i would add an exemption list and a real solution to this problem. I m just a user of this script ( that i like ) that care to help some1, when the experienced ppl didnt care, or didnt have time. By the way, i gave the solution that worked for me, and like i said, it s not an elegant solution, but it worked for me. A temporary solution before some1 help us to add an exemption list to this script. Saying that +h isnt good knowing that the proposed flag was +f, isnt relevant in my opinion. Can you say that in this case +h will be a major problem ? You know better that it wont be the case. Dont you agree that in this case +h is better than +f, so we can exempt some ppl from being taken for proxies, but still ban them if they make any other offense ? By the way, i really meant +h in the solution i proposed, coz i wasnt knowing that we can custom other flags, but in this case, it doesnt make a big difference +h/+H. ppl that really care, bring real solutions, or at least they try. Keeping criticising ppl that care to help, isnt very constructive. For sure it makes higher the number of posts, but without a real substance. I m not talkin about you, your posts are relevant, full of real substance, the last thread i have in mind is the one where you had the patience and helped really sydneybabe. But in general, when we focus on the marginal, we lose the fundamental.

By the way, it s not about pride, it just make me laugh :) ok ok i m out of this thread :)
Last edited by Zircon on Fri Dec 14, 2007 4:03 pm, edited 1 time in total.
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

The issue is that some ppl may ask that eggdrop help-info is stripped of formatting characters (bold, underline, colors), while others may ask it to be left in there. This is exactly what the h-flag is used for, and when used as intended (and it is), would cause ambigious behaviour with your suggested modification. Having f-flag in the list does not cause that issue, since "f" is denoted as "friend" (exempt from various protective countermeasures).

We don't critizise that you used "h", we pointed out that you should use "H" instead. I would call that constructive. We are here to help eachother and share our knowledge, part of that is pointing out when something is done improperly - and how it should be corrected.
NML_375
Z
Zircon
Op
Posts: 191
Joined: Mon Aug 21, 2006 4:22 am
Location: Montreal

Post by Zircon »

The issue is that some ppl may ask that eggdrop help-info is stripped of formatting characters (bold, underline, colors), while others may ask it to be left in there. This is exactly what the h-flag is used for, and when used as intended (and it is), would cause ambigious behaviour with your suggested modification. Having f-flag in the list does not cause that issue, since "f" is denoted as "friend" (exempt from various protective countermeasures).
In the situation we are talkin about, we want to exempt ppl that arent users on the bot, so no chance they can have +h flag or any other kind of flags....They arent friends, we just want them to not be banned due to the inaccuracy of some proxies databases. So we want to exempt them only from being takin for proxies, but we still want to ban them if they make any other kind of offense.....so +f isnt good at all ! is +h perfect ? nope, but acceptable in this situation. Is +H better, of course it is, that s what i said in a previous post if you read it.
By the way, i wasnt talkin about you, your posts are relevant, full of real substance, the last thread i have in mind is the one where you had the patience and helped really sydneybabe.
nml375, your knowledge is greater than +h/+H, so since you follow this thread, i m gonna ask you if you can point me an idea or fragments of ideas that i can start with to add an exemption list within this script.
m
minted
Halfop
Posts: 64
Joined: Wed Jul 20, 2005 9:58 am

Post by minted »

Zircon wrote:In the situation we are talkin about, we want to exempt ppl that arent users on the bot, so no chance they can have +h flag or any other kind of flags....They arent friends, we just want them to not be banned due to the inaccuracy of some proxies databases.
but what if somebody wants to exempt a user who IS on the bot. what if that user doesnt want +h enabled. The point being made to you is that there are circumstances where using an uncommon flag as a quick fix when there are proper ways to go about it, is not the best policy. Though your right that +f probably shouldn't be used as it exempts them from all kinds of other stuff, using +h instead isn't much better.
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

The first question would then be, is the list of exempts masks or "full strings" (will there be any wildcards in the list-entries)?

If you can avoid the use of wildcards, it could easily be facilitated by building a (sorted) tcllist of strings, and then use the optimized lsearch to look for any matching entries in the list.

If you do need wildcards, the standard-approach would be something like this:

Code: Select all

set exempted-list [list "mask1" \
"mask2" \
...]

...
foreach mask $::exempted-list {
 if {[string match -nocase $mask $whattotest]} {
  set exempted 1
  break
 }
}
if {[info exists exempted]} {
 #found matching exempt
} {
 #No exempts matched
}
Keep in mind that this approach will not be very performace-effective, and you should try to keep your exempt-lists as small as possible.
NML_375
Z
Zircon
Op
Posts: 191
Joined: Mon Aug 21, 2006 4:22 am
Location: Montreal

Post by Zircon »

@minted :
is +h perfect ? nope, but acceptable in this situation. Is +H better, of course it is, that s what i said in a previous post if you read it.
@nml375 : i thought to exempt masks like this :
*!*@41.2??.*
*!*@*.ca
*!*@196.2*

In fact, i want to modify this proc, so it can take in account the exemption list :

Code: Select all

proc proxy::checkuser {nickname hostname handle channel} {
 checkstats $channel
 if {[channel get $channel antiproxy] && [botisop $channel] && ![string match *users.quakenet.org* $hostname] && ![matchattr $handle fomn|fomn $channel] && ![isbotnick $nickname]} {
  channel set $channel antijoins "[expr [channel get $channel antijoins] + 1]"
  regexp {.*\@(.*)} $hostname -> hostname
  if [regexp {[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$} $hostname] {
   [namespace current]::check $hostname $hostname 1 $nickname $hostname $channel 
  } else {
   dnslookup $hostname [namespace current]::check $nickname $hostname $channel
  }
 }
}
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

nml375 has provided you with the tools to do what you want (you do however need to run your excemption list twice if you want to excempt IPs aswell as hostnames)

edit: Scratch that, if a user doesn't have his IP resolved then the hostname wouldn't be looked up anyway.

You should _only_ use IPs for your list and run it in the proc that deals with IP checking (which is not the proc you want to modify)
Post Reply