]> jfr.im git - irc/rizon/znc.git/log
irc/rizon/znc.git
15 years agoIncrease the version number to 0.070 znc-0.070
psychon [Sat, 23 May 2009 10:45:12 +0000 (10:45 +0000)] 
Increase the version number to 0.070

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1516 726aef4b-f618-498e-8847-2d620e286838

15 years agoAdd CListener::GetRealListener()
psychon [Wed, 20 May 2009 11:56:15 +0000 (11:56 +0000)] 
Add CListener::GetRealListener()

This allows access to the Csock* which does the actual listening

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1515 726aef4b-f618-498e-8847-2d620e286838

15 years agoRevert rev 1510 "Ask SSL clients for a ssl cert"
psychon [Wed, 20 May 2009 11:19:17 +0000 (11:19 +0000)] 
Revert rev 1510 "Ask SSL clients for a ssl cert"

This commit breaks webadmin. This was found with firefox. If you got any client
certificates imported into firefox, it will ask you to select which certificate
to use a couple of times per click (once per HTTP request which means also when
loading images etc).

Since webadmin by default shares the listen port with znc, we can't limit this
SSL_VERIFY_PEER to webadmin listening ports. The simplest solution is thus to
just drop this.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1514 726aef4b-f618-498e-8847-2d620e286838

15 years agoRevert rev1504 that introduced an error with modtcl.
silverleo [Wed, 20 May 2009 10:36:34 +0000 (10:36 +0000)] 
Revert rev1504 that introduced an error with modtcl.

Tcl fork()s to create a child process, the child exits and tcl tries to get
the child's exit code via waitpid() but when the child process exits, we get
SIGCHLD, call waitpid() ourselves and thus the exit code (and the whole
zombie) is discarded and tcl can't get the child's exit code.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1513 726aef4b-f618-498e-8847-2d620e286838

15 years agoAdd CAuthBase::GetSocket()
psychon [Wed, 20 May 2009 09:32:28 +0000 (09:32 +0000)] 
Add CAuthBase::GetSocket()

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1512 726aef4b-f618-498e-8847-2d620e286838

15 years agoCAuthBase: Use a Csock* instead of a CString "sRemoteIP"
psychon [Wed, 20 May 2009 09:30:19 +0000 (09:30 +0000)] 
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

15 years agoAsk SSL clients for a ssl cert
psychon [Wed, 20 May 2009 08:48:22 +0000 (08:48 +0000)] 
Ask SSL clients for a ssl cert

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1510 726aef4b-f618-498e-8847-2d620e286838

15 years agoUpdate to latest Csocket
psychon [Wed, 20 May 2009 08:10:00 +0000 (08:10 +0000)] 
Update to latest Csocket

Thanks to Imaginos for implementing this. :)

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1509 726aef4b-f618-498e-8847-2d620e286838

15 years agoAdded a cast to stop the compilier from complaining about signed/unsigned mismatch
prozacx [Mon, 11 May 2009 21:17:38 +0000 (21:17 +0000)] 
Added a cast to stop the compilier from complaining about signed/unsigned mismatch

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1508 726aef4b-f618-498e-8847-2d620e286838

15 years agoFix a wrong cached /mode reply
psychon [Mon, 11 May 2009 16:16:10 +0000 (16:16 +0000)] 
Fix a wrong cached /mode reply

ZNC replies to /mode #chan with the cached channel modes without querying the
IRCd. This was added to avoid traffic spikes to the ircd when a client
logged in.

The logic in this code had a bug that made it also reply with stale cached
values if we once were but aren't anymore in that channel (e.g. after
you've been kicked).

Thanks to tomaw for reporting this.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1507 726aef4b-f618-498e-8847-2d620e286838

15 years agoClose client sockets only after all pending data was sent
psychon [Mon, 11 May 2009 16:06:40 +0000 (16:06 +0000)] 
Close client sockets only after all pending data was sent

Now e.g. the message "Invalid Password" on login even reaches the other end
before the connection shoots itself in the foot.

There is one place in Client.cpp which I didn't change: ReachedMaxBuffer()
If a client is flooding is, why should we wait until we are done answering
that flood?...

Thanks to morelia for making me notice this.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1506 726aef4b-f618-498e-8847-2d620e286838

15 years agoAuto-detect globalness in the re/un/loadmod commands using GetModInfo()
prozacx [Sun, 10 May 2009 09:50:37 +0000 (09:50 +0000)] 
Auto-detect globalness in the re/un/loadmod commands using GetModInfo()

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1505 726aef4b-f618-498e-8847-2d620e286838

15 years agoHandle SIGCHLD for collecting zombie processes
psychon [Mon, 4 May 2009 19:21:26 +0000 (19:21 +0000)] 
Handle SIGCHLD for collecting zombie processes

The old code failed to collect the following command to *shell correctly:
 exec > /dev/null 2> /dev/null < /dev/null ; sleep 10

The timeout in CExecSock::close2() was over before the child processes exited
and a zombie was left behind. Plus we used some ugly busy looping while
waiting for the child to exit. Using SIGCHLD for collecting zombies is
soooooo much nicer.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1504 726aef4b-f618-498e-8847-2d620e286838

15 years agoInstall a file for pkg-config
psychon [Sun, 3 May 2009 11:23:05 +0000 (11:23 +0000)] 
Install a file for pkg-config

configure now generates to files for pkg-config:
znc.pc and znc-uninstalled.pc

This is supposed to replace the znc-config binary. Everything which can be done
with znc-config can now also be done with pkg-config.

znc-uninstalled.pc is only generated by configure, but not installed by the
Makefiles. It's there to fix some kind of bug we have with znc-config.

ZNC can run quite fine from the source, there is no need to ever run
"make install". The only problem is that e.g. znc-extra won't build, since
it gets -I/usr/local/include/znc from znc-config which doesn't work since znc
was never installed.

pkg-config has a nice fix for this: If you ask for "a", but "a-uninstalled"
exists, pkg-config will use the later one instead. This is used in
znc-uninstalled.pc to output a different -I flag which works for the
uninstalled headers.
(You only have to set $PKG_CONFIG_PATH to znc's source dir for this to work)

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1503 726aef4b-f618-498e-8847-2d620e286838

15 years agoFix for the new OFTC syntax "authenticate yourself to services with the IDENTIFY...
silverleo [Sat, 2 May 2009 12:48:13 +0000 (12:48 +0000)] 
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

15 years agoMicro-optimization
psychon [Thu, 30 Apr 2009 19:15:21 +0000 (19:15 +0000)] 
Micro-optimization

!m.empty() might be a littler faster than m.size() > 0, but I doubt one can
measure the difference here...

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1501 726aef4b-f618-498e-8847-2d620e286838

15 years agoFix crash bug in stickychan
psychon [Mon, 27 Apr 2009 18:56:03 +0000 (18:56 +0000)] 
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

15 years agomodperl also needs -Wno-missing-declarations
psychon [Sun, 26 Apr 2009 10:14:42 +0000 (10:14 +0000)] 
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

15 years agoDon't try to use -mimpure-text
psychon [Sun, 26 Apr 2009 10:08:51 +0000 (10:08 +0000)] 
Don't try to use -mimpure-text

This seems to be an unknown compiler flag in some cases.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1498 726aef4b-f618-498e-8847-2d620e286838

15 years agoUtils.h: Include fcntl.h
psychon [Sun, 26 Apr 2009 07:24:57 +0000 (07:24 +0000)] 
Utils.h: Include fcntl.h

fcntl.h is needed for fcntl() and defines like FD_CLOEXEC, F_SETFD and F_GETFD.
This worked so far, because some C++ header pulled in fcntl.h, but there are
systems out there for which this is not true. (Found on solaris)

Thanks to sartek.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1497 726aef4b-f618-498e-8847-2d620e286838

15 years agoFix configure's check for libperl
psychon [Fri, 24 Apr 2009 18:57:25 +0000 (18:57 +0000)] 
Fix configure's check for libperl

perl's LDFLAGS where included in $LIBS when checking for libperl. This meant
that e.g. the -L flag necessary for finding libperl was after the "-lperl"
argument. This made the test fail.

This moves these flags into $LDFLAGS (and later restores the old $LDFLAGS
since only modperl needs those flags, modules/Makefile.in handles that).

Thanks to sartek for reporting this is broken on solaris and testing the patch.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1496 726aef4b-f618-498e-8847-2d620e286838

15 years agoRemove znc --encrypt-pem
psychon [Fri, 24 Apr 2009 16:47:49 +0000 (16:47 +0000)] 
Remove znc --encrypt-pem

ZNC can't read encrypted pem files, so it's kinda pointless that it can
generate those...

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1495 726aef4b-f618-498e-8847-2d620e286838

15 years agoAdded module hooks for when the buffer is being played back
prozacx [Wed, 22 Apr 2009 21:48:58 +0000 (21:48 +0000)] 
Added module hooks for when the buffer is being played back

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1494 726aef4b-f618-498e-8847-2d620e286838

15 years agoRemoved repeat sentence since sModRet already says it was unable to load
prozacx [Wed, 22 Apr 2009 05:10:36 +0000 (05:10 +0000)] 
Removed repeat sentence since sModRet already says it was unable to load

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1493 726aef4b-f618-498e-8847-2d620e286838

15 years agoAdded svn:ignore entries for files created during ./configure and make
prozacx [Sun, 19 Apr 2009 22:37:06 +0000 (22:37 +0000)] 
Added svn:ignore entries for files created during ./configure and make

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1492 726aef4b-f618-498e-8847-2d620e286838

15 years agoFix a crash bug in CNick
psychon [Thu, 16 Apr 2009 10:33:28 +0000 (10:33 +0000)] 
Fix a crash bug in CNick

CNick::GetPermStr() segfaulted if called on e.g. the CNick from OnChanMsg().

Thanks to stebi3 for the bug report via the sf.net bug tracker.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1491 726aef4b-f618-498e-8847-2d620e286838

15 years agoUpdate to latest Csocket
psychon [Mon, 13 Apr 2009 08:18:35 +0000 (08:18 +0000)] 
Update to latest Csocket

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1490 726aef4b-f618-498e-8847-2d620e286838

15 years agofail2ban: Add number of allowed failed logins
psychon [Sat, 11 Apr 2009 20:06:13 +0000 (20:06 +0000)] 
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

15 years agoAdd TCacheMap::GetTTL()
psychon [Sat, 11 Apr 2009 20:04:21 +0000 (20:04 +0000)] 
Add TCacheMap::GetTTL()

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1488 726aef4b-f618-498e-8847-2d620e286838

15 years agoTurn TCacheMap into more of a map
psychon [Sat, 11 Apr 2009 19:24:55 +0000 (19:24 +0000)] 
Turn TCacheMap into more of a map

This adds a second template parameter to TCacheMap which is the value which is
saved in the map. This second parameter can be retrived with the new
TCacheMap::GetItem() and set with a new second argument to TCacheMap::AddItem()

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1487 726aef4b-f618-498e-8847-2d620e286838

15 years agopartyline: Fix the KICK sent for deleted users
psychon [Thu, 9 Apr 2009 08:22:20 +0000 (08:22 +0000)] 
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

15 years agoPartyline: Add defines for the used channel prefix
psychon [Tue, 7 Apr 2009 16:14:14 +0000 (16:14 +0000)] 
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

15 years agoAdd support for per-channel settings to admin
psychon [Tue, 7 Apr 2009 11:38:17 +0000 (11:38 +0000)] 
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

15 years agoPrint more useful error messages when binding a listening port fails
psychon [Tue, 7 Apr 2009 06:48:51 +0000 (06:48 +0000)] 
Print more useful error messages when binding a listening port fails

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1483 726aef4b-f618-498e-8847-2d620e286838

15 years agoGet rid of some now-empty dirs
psychon [Mon, 6 Apr 2009 16:03:53 +0000 (16:03 +0000)] 
Get rid of some now-empty dirs

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1482 726aef4b-f618-498e-8847-2d620e286838

15 years agoWebadmin: Make this work with the browser cache
psychon [Mon, 6 Apr 2009 16:00:23 +0000 (16:00 +0000)] 
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

15 years agoAdmin: Use CString's constructor instead of reinventing the wheel
psychon [Mon, 6 Apr 2009 06:45:19 +0000 (06:45 +0000)] 
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

15 years agoFix a compiler warning in email
psychon [Sun, 5 Apr 2009 19:09:03 +0000 (19:09 +0000)] 
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

15 years agoadmin: DelUser can now handle spaces in user names
psychon [Sat, 4 Apr 2009 18:43:24 +0000 (18:43 +0000)] 
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

15 years agoadmin: Add a CloneUser command
psychon [Sat, 4 Apr 2009 18:41:14 +0000 (18:41 +0000)] 
admin: Add a CloneUser command

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1477 726aef4b-f618-498e-8847-2d620e286838

15 years agoCFile::Close(): check return value of close() for errors
psychon [Sat, 4 Apr 2009 11:49:15 +0000 (11:49 +0000)] 
CFile::Close(): check return value of close() for errors

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1476 726aef4b-f618-498e-8847-2d620e286838

15 years agoAdd KiNgMaR to AUTHORS
psychon [Thu, 2 Apr 2009 13:05:05 +0000 (13:05 +0000)] 
Add KiNgMaR to AUTHORS

He provides native win32 builds of ZNC and writes patches to make
ZNC compile and work there. Plus he knows how to use google ;)

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1475 726aef4b-f618-498e-8847-2d620e286838

15 years agoFirst argument to CHTTPSock::PrintHeader() should be of type off_t
psychon [Thu, 2 Apr 2009 12:54:12 +0000 (12:54 +0000)] 
First argument to CHTTPSock::PrintHeader() should be of type off_t

Thanks to KiNgMaR

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1474 726aef4b-f618-498e-8847-2d620e286838

15 years agowebadmin: Remove some completely useless argument to IsAdmin()
psychon [Thu, 2 Apr 2009 12:34:13 +0000 (12:34 +0000)] 
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

15 years agoDon't ask me, I don't know
psychon [Tue, 31 Mar 2009 15:49:49 +0000 (15:49 +0000)] 
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

15 years agoSwitch some code to use the new return type of GetSize()
psychon [Tue, 31 Mar 2009 15:11:32 +0000 (15:11 +0000)] 
Switch some code to use the new return type of GetSize()

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1471 726aef4b-f618-498e-8847-2d620e286838

15 years agoMark g_LongOpts in main.cpp as const
psychon [Tue, 31 Mar 2009 12:38:02 +0000 (12:38 +0000)] 
Mark g_LongOpts in main.cpp as const

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1470 726aef4b-f618-498e-8847-2d620e286838

15 years agoRemove some places where "znc.conf" is mentioned needlessly
psychon [Tue, 31 Mar 2009 12:34:07 +0000 (12:34 +0000)] 
Remove some places where "znc.conf" is mentioned needlessly

CZNC::ExpandConfigPath() handles an empty string as its argument quite well, so
make all those other places use this.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1469 726aef4b-f618-498e-8847-2d620e286838

15 years agoMake znc --datadir some-dir --makeconf work
psychon [Tue, 31 Mar 2009 12:25:24 +0000 (12:25 +0000)] 
Make znc --datadir some-dir --makeconf work

Without this the restart after the config is written fails, because the file
name it wants to open went through ExpandConfigPath() twice. This lead to a
path like ./some-dir/configs/some-dir/configs.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1468 726aef4b-f618-498e-8847-2d620e286838

15 years agoMention znc --foreground and --debug in the man page
psychon [Tue, 31 Mar 2009 12:13:33 +0000 (12:13 +0000)] 
Mention znc --foreground and --debug in the man page

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1467 726aef4b-f618-498e-8847-2d620e286838

15 years agoFix some brown paper bag bug (I hope nobody notices...)
psychon [Tue, 31 Mar 2009 11:44:22 +0000 (11:44 +0000)] 
Fix some brown paper bag bug (I hope nobody notices...)

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1466 726aef4b-f618-498e-8847-2d620e286838

15 years agoRemove some unneeded magic from CString::Escape_n() (nothing major)
psychon [Tue, 31 Mar 2009 09:32:16 +0000 (09:32 +0000)] 
Remove some unneeded magic from CString::Escape_n() (nothing major)

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1465 726aef4b-f618-498e-8847-2d620e286838

15 years agoMake CUser::PrintLine() a little more readable and fix the return value
psychon [Tue, 31 Mar 2009 09:18:04 +0000 (09:18 +0000)] 
Make CUser::PrintLine() a little more readable and fix the return value

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1464 726aef4b-f618-498e-8847-2d620e286838

15 years agoDCCSock: Make sure we don't cache too much data in memory
psychon [Tue, 31 Mar 2009 09:07:02 +0000 (09:07 +0000)] 
DCCSock: Make sure we don't cache too much data in memory

This now only reads new data from disk if there is less than 1 MiB left to be
sent, which is still a lot. Before this there was no limit and the other end of
the socket could try to make us run out of memory.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1463 726aef4b-f618-498e-8847-2d620e286838

15 years agoMicro optimization
psychon [Tue, 31 Mar 2009 09:04:47 +0000 (09:04 +0000)] 
Micro optimization

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1462 726aef4b-f618-498e-8847-2d620e286838

15 years agoDCC only allows file transfers of up to 4 GiB big files
psychon [Tue, 31 Mar 2009 08:24:34 +0000 (08:24 +0000)] 
DCC only allows file transfers of up to 4 GiB big files

Make CDCCSock use uint32_t to generate the "unsigned, 4 byte integer in network
byte order" which is used to acknowledge the received data. Also make
OpenFile() abort for files bigger than 4 GiB, because we would run into
integer overflows later on. These transfers might work with some remote client,
but ZNC is (no longer?) one of them. ;)

Thanks to KiNgMaR for the original patch and some help with the uint32_t stuff.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1461 726aef4b-f618-498e-8847-2d620e286838

15 years agoSmall fix for ReadLine() for multi-byte line delimiters
psychon [Tue, 31 Mar 2009 07:56:55 +0000 (07:56 +0000)] 
Small fix for ReadLine() for multi-byte line delimiters

(Oh and empty() is better (tm) than size())

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1460 726aef4b-f618-498e-8847-2d620e286838

15 years agoMinor cleanup to CFile::ReadLine(), no behavior changes (I hope)
psychon [Tue, 31 Mar 2009 07:52:24 +0000 (07:52 +0000)] 
Minor cleanup to CFile::ReadLine(), no behavior changes (I hope)

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1459 726aef4b-f618-498e-8847-2d620e286838

15 years agoMake CFile::Seek() take an off_t as param, not an unsigned long
psychon [Tue, 31 Mar 2009 07:34:42 +0000 (07:34 +0000)] 
Make CFile::Seek() take an off_t as param, not an unsigned long

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1458 726aef4b-f618-498e-8847-2d620e286838

15 years agoSome changes to the code rewriting znc.conf
psychon [Mon, 30 Mar 2009 18:28:09 +0000 (18:28 +0000)] 
Some changes to the code rewriting znc.conf

Added some error checking and fixes a bug where the exclusive lock we use on
the config file was removed. This was because we made the kernel allocate a
new inode for the config while our lock was still on the old version of the
config file. This should now be fixed.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1457 726aef4b-f618-498e-8847-2d620e286838

15 years agoSome more const_iterator instead of iterator
psychon [Mon, 30 Mar 2009 14:42:03 +0000 (14:42 +0000)] 
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

15 years agoThe "isSSL" param to some CSockManager functions should be a boolean
psychon [Mon, 30 Mar 2009 09:36:26 +0000 (09:36 +0000)] 
The "isSSL" param to some CSockManager functions should be a boolean

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1455 726aef4b-f618-498e-8847-2d620e286838

15 years agoSwitch some more CFile members to more appropriate return types
psychon [Mon, 30 Mar 2009 09:03:54 +0000 (09:03 +0000)] 
Switch some more CFile members to more appropriate return types

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1454 726aef4b-f618-498e-8847-2d620e286838

15 years agoChange the return type of CFile::Get*Time() to time_t, which is more correct
psychon [Mon, 30 Mar 2009 08:27:23 +0000 (08:27 +0000)] 
Change the return type of CFile::Get*Time() to time_t, which is more correct

Thanks to KiNgMaR for the patch.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1453 726aef4b-f618-498e-8847-2d620e286838

15 years agoRemove some unneeded stuff from the --makeconf code
psychon [Sun, 29 Mar 2009 16:25:17 +0000 (16:25 +0000)] 
Remove some unneeded stuff from the --makeconf code

The ".so" suffix was already stripped in GetAvailableMods().

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1452 726aef4b-f618-498e-8847-2d620e286838

15 years agoautoop: Use const_iterator instead of iterator where it makes sense
psychon [Sun, 29 Mar 2009 12:23:59 +0000 (12:23 +0000)] 
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

15 years agoRemove some unneeded "using" directives from Template.h
psychon [Sun, 29 Mar 2009 12:17:29 +0000 (12:17 +0000)] 
Remove some unneeded "using" directives from Template.h

Template.h directly includes Utils.h which already does these

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1450 726aef4b-f618-498e-8847-2d620e286838

15 years agoMove the iostream stuff and some "using" from main.h into Utils.h
psychon [Sun, 29 Mar 2009 12:12:34 +0000 (12:12 +0000)] 
Move the iostream stuff and some "using" from main.h into Utils.h

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1449 726aef4b-f618-498e-8847-2d620e286838

15 years agoIncrease the version number to 0.069
psychon [Sun, 29 Mar 2009 11:43:35 +0000 (11:43 +0000)] 
Increase the version number to 0.069

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1448 726aef4b-f618-498e-8847-2d620e286838

15 years agoIncrease the version number to 0.068 znc-0.068
psychon [Sun, 29 Mar 2009 11:41:27 +0000 (11:41 +0000)] 
Increase the version number to 0.068

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1446 726aef4b-f618-498e-8847-2d620e286838

15 years agoAdd defines.h for Csocket and make Csocket use ZNC's DEBUG()
psychon [Wed, 25 Mar 2009 17:56:29 +0000 (17:56 +0000)] 
Add defines.h for Csocket and make Csocket use ZNC's DEBUG()

This adds a new file defines.h and moves all the Csocket specific stuff from
main.h into this new file.

Then this makes Csocket use ZNC's DEBUG() macro for its debug output which
means this can now also be enabled by running znc --debug.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1445 726aef4b-f618-498e-8847-2d620e286838

15 years agoUpdate to latest Csocket
psychon [Wed, 25 Mar 2009 15:38:11 +0000 (15:38 +0000)] 
Update to latest Csocket

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1444 726aef4b-f618-498e-8847-2d620e286838

15 years agoUse -D instead of -g as a short form for --debug
psychon [Tue, 24 Mar 2009 18:50:11 +0000 (18:50 +0000)] 
Use -D instead of -g as a short form for --debug

This also cleans up some minor #ifdef for the initial value for bForeground.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1443 726aef4b-f618-498e-8847-2d620e286838

15 years agoAdd znc --debug / znc -g
psychon [Tue, 24 Mar 2009 18:45:03 +0000 (18:45 +0000)] 
Add znc --debug / znc -g

This enables the debug output you get with --enable-debug on --disable-debug
builds. The behaviour if znc was compiled with --disable-debug isn't changed.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1442 726aef4b-f618-498e-8847-2d620e286838

15 years agoAdd znc -f / --foreground
psychon [Tue, 24 Mar 2009 12:03:51 +0000 (12:03 +0000)] 
Add znc -f / --foreground

This argument makes znc not fork into the background. It has no effect if
configure is called with --enable-debug, znc will always stay in the foreground
in this case.

The hunk at the end of main.cpp is just whitespace stuff. The only difference
in there is that #ifdef _DEBUG #else #endif is changed into
if (bForeground) { } else { } (which makes this whitespace stuff necessary).

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1441 726aef4b-f618-498e-8847-2d620e286838

15 years agoAdmin module: some cosmetic fixes
sebastinas [Mon, 23 Mar 2009 20:43:11 +0000 (20:43 +0000)] 
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

15 years agoFix some compiler warnings with -Wmissing-declarations
psychon [Mon, 23 Mar 2009 15:26:26 +0000 (15:26 +0000)] 
Fix some compiler warnings with -Wmissing-declarations

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1439 726aef4b-f618-498e-8847-2d620e286838

15 years agoFix a crash bug with recursion in module calls
psychon [Sun, 22 Mar 2009 19:05:34 +0000 (19:05 +0000)] 
Fix a crash bug with recursion in module calls

This was found via partyline and notify_connect. notify_connect calls
CZNC::Broadcast() in OnClientLogin() which calls the OnBroadcast() module call.
When returning from this module calls, m_pUser and m_pClient was reset to NULL
and all the following modules got their OnClientLogin() called with m_pUser and
m_pClient set to NULL.

This patch fixes this by resetting those vars to their old values instead to
NULL when returning from a module call.

This patch also fixes the bug that m_pUser and m_pClient in modules were reset
to NULL after they caused a module call which called back into the current
module. The fix looks similar to the other one (this one is the Modules.h part).

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1438 726aef4b-f618-498e-8847-2d620e286838

15 years agoRemove some useless tags from a non-tty output.
silverleo [Sun, 22 Mar 2009 14:41:04 +0000 (14:41 +0000)] 
Remove some useless tags from a non-tty output.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1437 726aef4b-f618-498e-8847-2d620e286838

15 years agoSome minor stuff, again found via icc's "remarks"
psychon [Sat, 21 Mar 2009 09:32:50 +0000 (09:32 +0000)] 
Some minor stuff, again found via icc's "remarks"

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1436 726aef4b-f618-498e-8847-2d620e286838

15 years agoRemove/fix some dead code
psychon [Fri, 20 Mar 2009 10:00:31 +0000 (10:00 +0000)] 
Remove/fix some dead code

All of this was found via warnings ("remarks") from icc.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1435 726aef4b-f618-498e-8847-2d620e286838

15 years agoChange CZNC::Loop()'s return type to void
psychon [Thu, 19 Mar 2009 16:25:33 +0000 (16:25 +0000)] 
Change CZNC::Loop()'s return type to void

CZNC::Loop() never returns a value, the only way it can return is through
some throws (e.g. for restart or shutdown).

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1434 726aef4b-f618-498e-8847-2d620e286838

15 years agofixed bug in wrong iterator increment that causes infinite loop
imaginos [Wed, 18 Mar 2009 23:55:56 +0000 (23:55 +0000)] 
fixed bug in wrong iterator increment that causes infinite loop

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1433 726aef4b-f618-498e-8847-2d620e286838

15 years agoGet rid of znc.conf-backup
psychon [Wed, 18 Mar 2009 15:45:43 +0000 (15:45 +0000)] 
Get rid of znc.conf-backup

The old code created a copy of the config file before writing a new version.
This backup is now gone.

With this patch the config is written to a temporary file znc.conf~ and then
fsync()d to make sure the data safely is on the disk. Then the real config file
znc.conf is overwritten with this temporary file via a rename() call.

This should be safer than the old way, plus it gets rid of a unneeded file.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1432 726aef4b-f618-498e-8847-2d620e286838

15 years agoAdd CFile::Sync()
psychon [Wed, 18 Mar 2009 15:40:05 +0000 (15:40 +0000)] 
Add CFile::Sync()

This adds a simple wrapper for fsync() to CFileUtils.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1431 726aef4b-f618-498e-8847-2d620e286838

15 years agoMove the saslauth copyright notice back into saslauth.cpp
psychon [Mon, 16 Mar 2009 11:59:36 +0000 (11:59 +0000)] 
Move the saslauth copyright notice back into saslauth.cpp

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1430 726aef4b-f618-498e-8847-2d620e286838

15 years agoRemove a pretty much useless usleep() on shutdown
psychon [Sun, 15 Mar 2009 07:44:07 +0000 (07:44 +0000)] 
Remove a pretty much useless usleep() on shutdown

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1429 726aef4b-f618-498e-8847-2d620e286838

15 years agoFix an implicit (CFile *) false (this should have been NULL for sure)
psychon [Sat, 14 Mar 2009 18:17:42 +0000 (18:17 +0000)] 
Fix an implicit (CFile *) false (this should have been NULL for sure)

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1428 726aef4b-f618-498e-8847-2d620e286838

15 years agoMakefile: Add -Wno-redundant-decls to modperlFLAGS
psychon [Sat, 14 Mar 2009 14:48:26 +0000 (14:48 +0000)] 
Makefile: Add -Wno-redundant-decls to modperlFLAGS

While experimenting with some warning flags I found another one which breaks
the perl headers. This warning is triggered by code like this:

 void bla();
 void bla();

Sadly, the perl headers do this for some weird reason :(

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1427 726aef4b-f618-498e-8847-2d620e286838

15 years agoRegenerate configure with the newer autoconf 2.63 (was 2.61 before)
psychon [Sat, 14 Mar 2009 11:12:18 +0000 (11:12 +0000)] 
Regenerate configure with the newer autoconf 2.63 (was 2.61 before)

This removes svn:eol-style from configure since it now contains
this in line 4122 (\r is a literal mac line ending):
 ac_cr='\r'
This confused subversion. Bad svn, bad!

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1426 726aef4b-f618-498e-8847-2d620e286838

15 years agoAdded raw 432 processing for illegal and erroneous nicks and changed the condition...
silverleo [Fri, 13 Mar 2009 17:24:36 +0000 (17:24 +0000)] 
Added raw 432 processing for illegal and erroneous nicks and changed the condition to trigger SendAltNick() since ircds like to interpret the standards.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1425 726aef4b-f618-498e-8847-2d620e286838

15 years agoMy bad. Fixed the build error.
sebastinas [Wed, 11 Mar 2009 21:11:58 +0000 (21:11 +0000)] 
My bad. Fixed the build error.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1424 726aef4b-f618-498e-8847-2d620e286838

15 years agoAdmin module: added 'Set Password'
sebastinas [Wed, 11 Mar 2009 19:24:30 +0000 (19:24 +0000)] 
Admin module: added 'Set Password'

The admin module is now able to set a user's password. Furthermore
fixed a bug if now username was specified for the 'Get' or 'Set'
command.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1423 726aef4b-f618-498e-8847-2d620e286838

15 years agoFix for CSmartPtr::GetCount
sebastinas [Wed, 11 Mar 2009 14:32:12 +0000 (14:32 +0000)] 
Fix for CSmartPtr::GetCount

Since CSmartPtr::GetCount returns a pointer to unsigned int it's
possible to manually change the reference count from outside.
Increasing the reference count will result in a memory leak and
decreasing will produce undefined behaviour.

GetCount now returns a pointer to const unsigned int to fix this.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1422 726aef4b-f618-498e-8847-2d620e286838

15 years agoPulled in changes for CSmartPtr which include GetClientCount(), operator bool(),...
prozacx [Tue, 10 Mar 2009 19:36:24 +0000 (19:36 +0000)] 
Pulled in changes for CSmartPtr which include GetClientCount(), operator bool(), and ability to Attach() to NULL pointers

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1421 726aef4b-f618-498e-8847-2d620e286838

15 years agoCheck if the version of a module matches when querying info about it
psychon [Tue, 10 Mar 2009 19:15:08 +0000 (19:15 +0000)] 
Check if the version of a module matches when querying info about it

When the module was compiled for a wrong ZNC version it's description will
say so. Everything which displays a list of available modules together with
their description will display this (--makeconf, /msg *status listavailmods,
webadmin).

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1420 726aef4b-f618-498e-8847-2d620e286838

15 years agoMeh. Today is not a good day -.-
psychon [Mon, 9 Mar 2009 17:42:12 +0000 (17:42 +0000)] 
Meh. Today is not a good day -.-

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1419 726aef4b-f618-498e-8847-2d620e286838

15 years agoAdd /msg *status UpdateMod[ule] which reloads an user module on all users
psychon [Mon, 9 Mar 2009 17:37:35 +0000 (17:37 +0000)] 
Add /msg *status UpdateMod[ule] which reloads an user module on all users

This command allows admins to really reload a module when they have updated it.
Because the dynamic linker does not really reload a shared object until all
handles to this object where dlclose()'d, this new command is necessary.

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1418 726aef4b-f618-498e-8847-2d620e286838

15 years agoRemove a mostly unused flag from CModInfo
psychon [Mon, 9 Mar 2009 17:21:01 +0000 (17:21 +0000)] 
Remove a mostly unused flag from CModInfo

Nobody cares if a module is found in ~/.znc/modules or in /usr/lib/znc/, right?

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1417 726aef4b-f618-498e-8847-2d620e286838

15 years agoFix my previous commit and also display the remote IP for the failed login
psychon [Sat, 7 Mar 2009 12:44:11 +0000 (12:44 +0000)] 
Fix my previous commit and also display the remote IP for the failed login

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1416 726aef4b-f618-498e-8847-2d620e286838