Commit Graph

528 Commits

Author SHA1 Message Date
psychon
6a36100447 Move CZNC::FindModPath() to CModules
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1611 726aef4b-f618-498e-8847-2d620e286838
2009-08-23 11:05:22 +00:00
psychon
495c196a82 Fix out-of-tree builds
Instead of using sed to strip away the source dir this now uses make's notdir.
$(notdir this/is/an/example) results in example.

This also moved the generated dependency files from .depend/extra into .depend/

Since we need the extra/ path prefix for the modules from modules/extra, that
one is added back via addprefix.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1610 726aef4b-f618-498e-8847-2d620e286838
2009-08-22 16:03:51 +00:00
psychon
61449c6f97 Import SilverLeo's modtcl from znc-extra
The configure and Makefile stuff was taken from there, too. By default modtcl is
disabled, use --enable-extra --enable-tcl to get it.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1609 726aef4b-f618-498e-8847-2d620e286838
2009-08-22 15:45:32 +00:00
psychon
a675e474e5 Whoops fix a minor makefile dependency error
modules/Makefile didn't include the dependency information for modules/extra/*


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1608 726aef4b-f618-498e-8847-2d620e286838
2009-08-20 21:12:44 +00:00
psychon
658e529c96 Import most of znc-extra
This imports all modules from znc-extra except modtcl under modules/extra.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1606 726aef4b-f618-498e-8847-2d620e286838
2009-08-20 19:54:27 +00:00
psychon
0b7576a474 Add support for extra modules
This commits adds the necessary build system fun for extra modules in
modules/extra which can be enabled with --enable-extra.

This is a preparation for the import of znc-extra.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1605 726aef4b-f618-498e-8847-2d620e286838
2009-08-20 19:49:21 +00:00
psychon
8cc6b19bca route_replies: Don't route 250
/lusers can cause a 250 "Highest connection count" reply, but sadly some IRC
daemons don't send this numeric. Since there is no easy way to handle this, we
will just assume that 266 is the last numeric reply to /lusers.

*If* there is a 250 reply, it will be broadcasted to all connected clients. This
is still better than the "This module hit a timeout" we generate on some ircds
currently.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1600 726aef4b-f618-498e-8847-2d620e286838
2009-08-17 18:01:59 +00:00
psychon
8e4a752f84 route_replies: Generic "not enough arguments" support
This teaches route_replies how to parse 461 numerics to find out which command
caused them. This way we don't have to add this numeric to all the requests we
route by hand.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1598 726aef4b-f618-498e-8847-2d620e286838
2009-08-17 17:56:26 +00:00
psychon
7efd863063 Import the adminlog module znc-extra
This module logs events like failed and successful logins and IRC disconnects to
a log file and/or syslog.

Original module author is SilverLeo, thanks.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1595 726aef4b-f618-498e-8847-2d620e286838
2009-08-10 18:16:03 +00:00
psychon
f478df3ecf Import the route_replies module from znc-extra
This module fixes some issues if multiple clients are connected to the same ZNC
user. ZNC itself would send replies to e.g. /who to all connected clients and
this modules makes the reply go to the client which sent the request.

Thanks to SilverLeo, tomaw and Vadtec for finding missing numerics.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1594 726aef4b-f618-498e-8847-2d620e286838
2009-08-07 19:36:31 +00:00
psychon
4e18ebf07a Import the autoreply module from znc-extra
This module automatically replies to queries and private notices if no user is
connected to ZNC.

Svedrin submitted an initial version of this module, but due to my own
stupidness I later rewrote it.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1593 726aef4b-f618-498e-8847-2d620e286838
2009-08-07 19:33:29 +00:00
psychon
75a342304c Import the buffextras module from znc-extra
This module adds topic changes, nick changes, parts, joins, quits, kicks and
mode changes to the buffer playback.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1592 726aef4b-f618-498e-8847-2d620e286838
2009-08-07 19:29:43 +00:00
psychon
046c4ac5b5 Import the fixfreenode module from znc-extra
Thanks to tomaw for the additional identify-ctcp "support"


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1591 726aef4b-f618-498e-8847-2d620e286838
2009-08-07 19:28:12 +00:00
psychon
5abf6b9c05 Fix VHost and MOTD input box in graphiX and dark-clouds
They squashed everything into one line which obviously is not good.

Thanks to flakes for the patch.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1588 726aef4b-f618-498e-8847-2d620e286838
2009-08-06 20:46:42 +00:00
psychon
bec752077b Add "make uninstall" target
(And some minor fixes to "make install")


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1580 726aef4b-f618-498e-8847-2d620e286838
2009-07-26 15:04:59 +00:00
psychon
6c1014f200 Fix a webadmin bug which was introduced in r1569
The directory prefix checking which prevents path traversal exploits had a logic
error that made it always fail.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1574 726aef4b-f618-498e-8847-2d620e286838
2009-07-21 21:04:49 +00:00
psychon
c7583c4946 Fix a low impact directory traversal bug
A common pattern for checking directories in ZNC is the following:

	sAbsolutePath = CDir::ChangeDir(sAllowedPath, sFile);
	if (sAbsolutePath.Left(sAllowedPath.length()) != sAllowedPath)
		Error;

But there is a problem: If sAllowedPath doesn't end with a slash, we are
vulnerable to an attack. If e.g. sAllowedPath = "/foo/bar", then
sFile = "../bartender" would result in sAbsolutePath = "/foo/bartender". Since
this path does begin with sAllowedPath, the code allowed it.

There shouldn't be any places where this can be exploited currently, but it is
still a security bug (path traversal).


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1569 726aef4b-f618-498e-8847-2d620e286838
2009-07-21 18:36:33 +00:00
psychon
1d03b50d73 fail2ban: Clear all bans on rehash
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1564 726aef4b-f618-498e-8847-2d620e286838
2009-07-15 18:28:03 +00:00
psychon
39364f057f Add a "swap" command to perform to change the order of commands
Patch by KiNgMaR, thanks.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1560 726aef4b-f618-498e-8847-2d620e286838
2009-07-08 20:17:47 +00:00
psychon
338e52af9c Add /msg *perform execute
This command lets perform send the perform lines now. This can be useful for
testing.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1558 726aef4b-f618-498e-8847-2d620e286838
2009-07-06 16:36:03 +00:00
psychon
79a80cefb2 I suck (I broke the build!)
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1555 726aef4b-f618-498e-8847-2d620e286838
2009-07-01 09:11:33 +00:00
psychon
d3b95a0b3d Nickserv: Add a clear command
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1554 726aef4b-f618-498e-8847-2d620e286838
2009-07-01 09:06:29 +00:00
psychon
442aee2baf Add and use CZNCSock instead of Csock everywhere
This class will be used to implement async DNS in a later commit.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1550 726aef4b-f618-498e-8847-2d620e286838
2009-06-29 11:26:19 +00:00
psychon
5678220d34 Remove some useless casts
Classes derived from Csock* can be casted implicitly to their base class, this
explicit casts are rather pointless.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1548 726aef4b-f618-498e-8847-2d620e286838
2009-06-26 18:13:40 +00:00
sebastinas
af13278f4f made string, boolean and integer static
Made string, boolean and integer in PrintHelp static sinve vars
is static too.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1542 726aef4b-f618-498e-8847-2d620e286838
2009-06-10 19:16:20 +00:00
psychon
220aab468d admin: Require a username argument
This patch makes set, setchan and addserver require a username argument.
(One can just use $me)


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1541 726aef4b-f618-498e-8847-2d620e286838
2009-06-10 14:41:50 +00:00
psychon
87a7672638 I fail (fix the admin module)
Thanks SilverLeo :(


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1540 726aef4b-f618-498e-8847-2d620e286838
2009-06-10 12:21:37 +00:00
psychon
062989595c Admin: Some minor cleanup
Move some code from GetUser()'s callers into GetUser() itself.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1539 726aef4b-f618-498e-8847-2d620e286838
2009-06-10 11:40:14 +00:00
prozacx
c4a6f39b53 Pulled in CString changes from my common repository to help facilitate the upcoming webmods changes
Changes include...

- CString -
Addition of LCString typedef to list<CString>

Added four more args to CString::Token()...
	bool bAllowEmpty = false        <-- This default of false is NOT backward compatible but seems way more intuitive
	const CString& sLeft = ""
	const CString& sRight = ""
	bool bTrimQuotes = true

Added CString::OptionSplit()
Added CString::QuoteSplit()

Added two new args to CString::Split()...
	bool bTrimQuotes = true,
	bool bTrimWhiteSpace = false

- CTemplate -
Added new class CTemplateTagHandler to provide capability to add custom tags and vars
Added var name pointer dereferencing in the form of <? VAR Name=*other_var ?> (use ** to start with a literal star)
Added a list of paths that can be used to look for a given filename in multiple locations
Added CTemplate::PrependPath()
Added CTemplate::AppendPath()
Added CTemplate::RemovePath()
Added CTemplate::ClearPath()
Added CTemplate::PrintString() for filling a CString& instead of a stream
Added <? LT ?> which outputs a literal "<?"
Added <? GT ?> which outputs a literal "?>"
Added <? SETBLOCK ?> and <? ENDSETBLOCK ?> for setting a variable's value to the contents between the tags
Added <? EXPAND ?> for expanding a filename to a path using the settable list of paths
Added <? BREAK ?> and <? CONTINUE ?> inner loop tags
Added <? EXIT ?> tag to stop processing
Added <? DEBUG ?> tag for printing to DEBUG()
Added REVERSE keyword to the <? LOOP ?> tag



git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1537 726aef4b-f618-498e-8847-2d620e286838
2009-06-10 05:48:12 +00:00
psychon
2206e19ad2 admin: Add set/get Nick/Altnick to help
Dunno why these commands weren't documented before...


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1535 726aef4b-f618-498e-8847-2d620e286838
2009-06-06 18:09:07 +00:00
psychon
9c1f2ee462 stickychan: Accept a channel list as module arguments
If you now load stickychan with "#chan1,#chan2 bla" as its argument, both
channels are stuck where "bla" is the channel key for #chan2.

Thanks to FB-eYe for the suggestion.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1534 726aef4b-f618-498e-8847-2d620e286838
2009-06-05 19:56:23 +00:00
psychon
aa4425bda5 Fix webadmin favicons
r1481 moved the /img/ subdir into /data/, but forgot to fix the path which
is used for the favicon, which meant we generated a 404 for the favicon.
Fix this by using the correct path and everyone is happy again.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1524 726aef4b-f618-498e-8847-2d620e286838
2009-05-27 10:59:36 +00:00
psychon
4e31d49209 CAuthBase: Use a Csock* instead of a CString "sRemoteIP"
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1511 726aef4b-f618-498e-8847-2d620e286838
2009-05-20 09:30:19 +00:00
silverleo
70b28b9ae5 Fix for the new OFTC syntax "authenticate yourself to services with the IDENTIFY command."
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1502 726aef4b-f618-498e-8847-2d620e286838
2009-05-02 12:48:13 +00:00
psychon
9f1f8950f8 Fix crash bug in stickychan
When you are already in #znc and you did 'stick znc' (# prefix missing!),
stickychan caused segfaults or different weird behavior. This happened because
stickychan didn't handle errors from CUser::AddChan(). AddChan() can only error
out if the channel already exists, but since stickychan already checked this,
were does the error come from?
CChan's constructor does some sanity checks on the channel name. It
automatically adds the proper channel prefix (most likely #) if it's missing.
This means when stickychan checked for the channel "znc" it correctly didn't
find one. When it then tried to add "znc", it really tried adding "#znc" which
could fail if the channel was already added.

Thanks to DM8Mydog for finding this.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1500 726aef4b-f618-498e-8847-2d620e286838
2009-04-27 18:56:03 +00:00
psychon
dfd95078dd modperl also needs -Wno-missing-declarations
Now ZNC compiles with -Wmissing-declarations :)
(BTW I hate the perl headers, could some fix them app so that they cause
less warnings?)


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1499 726aef4b-f618-498e-8847-2d620e286838
2009-04-26 10:14:42 +00:00
psychon
c4972caafe fail2ban: Add number of allowed failed logins
This adds a new, second argument to fail2ban which is the number of failed
logins one is allowed before being banned. Each login attempt resets the
timeout. This value defaults to 2.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1489 726aef4b-f618-498e-8847-2d620e286838
2009-04-11 20:06:13 +00:00
psychon
424e6c1820 partyline: Fix the KICK sent for deleted users
Before this, the KICK message was missing a target which was kicked.
Now the user kicks himself. :)

Thanks to JoeK for reporting this bug.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1486 726aef4b-f618-498e-8847-2d620e286838
2009-04-09 08:22:20 +00:00
psychon
2f64dffee3 Partyline: Add defines for the used channel prefix
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1485 726aef4b-f618-498e-8847-2d620e286838
2009-04-07 16:14:14 +00:00
psychon
02d6546a0b Add support for per-channel settings to admin
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1484 726aef4b-f618-498e-8847-2d620e286838
2009-04-07 11:38:17 +00:00
psychon
3b9a9c2b80 Webadmin: Make this work with the browser cache
This moves all static webadmin files (images, css) to the data/ subdirectory
of the skin dir. The webadmin module is changed to redirect requests to
/<skin name>/ to that data directory. The skins are changed to use the
new URL when linking to their stuff. (I only needed to change the path to
the main.css file in each Header.tmpl. Since the .css and the images are now
in the same directory, relative URLs work just fine).

This means that we now generate different URLs after changing the webadmin
skins and the browser cache can do its thing.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1481 726aef4b-f618-498e-8847-2d620e286838
2009-04-06 16:00:23 +00:00
psychon
694b60d53b Admin: Use CString's constructor instead of reinventing the wheel
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1480 726aef4b-f618-498e-8847-2d620e286838
2009-04-06 06:45:19 +00:00
psychon
8bc4b736cd Fix a compiler warning in email
Now that GetMTime() returns a time_t...


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1479 726aef4b-f618-498e-8847-2d620e286838
2009-04-05 19:09:03 +00:00
psychon
c80690a9fc admin: DelUser can now handle spaces in user names
The new CloneUser command allows one to create a user with a space in
its name and the code for reading znc.conf allows spaces too. So now
one can even get rid of this users again...


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1478 726aef4b-f618-498e-8847-2d620e286838
2009-04-04 18:43:24 +00:00
psychon
5618aa2a47 admin: Add a CloneUser command
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1477 726aef4b-f618-498e-8847-2d620e286838
2009-04-04 18:41:14 +00:00
psychon
43e401d483 webadmin: Remove some completely useless argument to IsAdmin()
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1473 726aef4b-f618-498e-8847-2d620e286838
2009-04-02 12:34:13 +00:00
psychon
63b437374d Don't ask me, I don't know
That false/true thing makes no sense and pUser was passed in to a bool
argument which means it was always true... weird...


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1472 726aef4b-f618-498e-8847-2d620e286838
2009-03-31 15:49:49 +00:00
psychon
a6300e37fa Some more const_iterator instead of iterator
Thanks KiNgMaR again.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1456 726aef4b-f618-498e-8847-2d620e286838
2009-03-30 14:42:03 +00:00
psychon
8429f1274f autoop: Use const_iterator instead of iterator where it makes sense
Thanks to KiNgMaR for the patch.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1451 726aef4b-f618-498e-8847-2d620e286838
2009-03-29 12:23:59 +00:00
sebastinas
dcc49f9c6f Admin module: some cosmetic fixes
Use ToUInt to convert the string, since we're actually using an
unsigned integer. And use ToBool for consistency.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1440 726aef4b-f618-498e-8847-2d620e286838
2009-03-23 20:43:11 +00:00