Commit Graph

47 Commits

Author SHA1 Message Date
Alexander Barton a13bb78b1e Update copyright notices of recently changed files 2014-03-17 12:22:00 +01:00
Alexander Barton b130b35f48 Update #include's: remove unused and add missing ones
The "deheader" tool (<http://www.catb.org/~esr/deheader/>) has been
used to find unused #include directives as well as missing ones.

Tested on:

- A/UX 3.1.1
- ArchLinux (2014-03-17)
- Debian GNU/Hurd
- Debian GNU/Linux 6.0.9
- Debian GNU/Linux 7.4
- Fedora 20
- FreeBSD 9.2
- OpenBSD 4.8
- OpenBSD 5.1
- OS X 10.9
- Solaris 11
2014-03-17 11:37:25 +01:00
Alexander Barton 259c314d14 Remove imp.h and exp.h header files
These include files don't have a function any more, remove them.
2014-03-17 00:17:02 +01:00
Federico G. Schwindt 51e5ba94b3 Ensure there is enough space for the mask
As pointed by Alex while strl{cat,cpy} take the full length
we need to leave space to ensure a proper mask is always created
so revert the removal of - N from my last change.
2013-04-20 10:53:16 +01:00
Federico G. Schwindt b4d0a40383 Better description for Lists_CheckReason() 2013-04-20 00:44:05 +01:00
Federico G. Schwindt 3ab00e3a11 Change Lists_MakeMask() to receive a buffer for the mask
Change callers accordingly so they don't rely on a global buffer and
rename Mask to Pattern where it makes sense since some functions
where indeed receiving a pattern and not a mask.
2013-04-20 00:43:47 +01:00
Federico G. Schwindt cde2e8a277 Fix use-after-free on Lists_CheckReason()
Change Lists_CheckReason() to receive a buffer where the reason
will be stored and its length.  Change callers accordingly.

Change Class_GetMemberReason() (and its callers) in a similar way
so it doesn't rely on a global buffer for the rejected reason.
2013-04-20 00:43:35 +01:00
Sebastian Köhler 0131e1e00b Lists_CheckReason(): Check for Client_MaskCloaked()
Look for possible cloaked Masks in Lists. Users with +x usermode can be
banned with their cloaked hostname now.
2013-03-20 03:40:31 +01:00
Alexander Barton 48326e061a Spelling fix: "nick name" -> "nickname" 2012-11-02 14:30:19 +01:00
Alexander Barton d67d077a71 Fix 8ec17063: "Lists_Add(): use size of destination when copying data"
Thanks to Florian Westphal for spotting my silliness ...
2012-04-18 17:54:54 +02:00
Alexander Barton 8ec17063a6 Lists_Add(): use size of destination when copying data
This fixes the following warning of clang:

/src/ngircd/lists.c:152:44:
 warning: size argument in 'strlcpy' call appears to be size of the
 source; expected the size of the destination [-Wstrlcpy-strlcat-size]

But it isn't a real problem, because the size of the source always is the
same than the size of the destination ...
2012-04-17 12:54:38 +02:00
Alexander Barton 6e28f4a7d1 New function Lists_CheckReason() to get reason of list entries 2012-01-22 18:11:24 +01:00
Alexander Barton 2f7d0c0839 Limit channel invite and ban lists to 50 entries
- New function Lists_Count().
 - New limit #define MAX_HNDL_CHANNEL_LISTS = 50.
 - New numeric #define ERR_LISTFULL_MSG(478).
 - Adjust numeric RPL_ISUPPORT2_MSG(005) accordingly ("MAXLIST")
2012-01-16 00:29:36 +01:00
Florian Westphal abfc5c6e27 lists: don't crash if reason ptr is NULL
commit 15fec92ed7
(Update list item, if it already exists) can make ngircd
crash because 'Reason' can be NULL, as reported by
Cahata on the ngircd mailing list.

Doesn't affect any released ngircd versions.

Also, make sure that we do not pass NULL as arguments
to a '%s' printf-like function.
2012-01-02 23:43:13 +01:00
Alexander Barton 9cbb8f3bb8 Remove unused "time_t now" from Lists_Check()
This fixes:

 lists.c: In function ‘Lists_Check’:
 lists.c:330:9: warning: variable ‘now’ set but not used
2011-12-30 01:03:59 +01:00
Alexander Barton 15fec92ed7 Update list item, if it already exists
This updates the "validity" (timeout) as well as the "reason" text,
if given.
2011-12-25 19:43:00 +01:00
Alexander Barton 1e4a00f94f Lists_CheckDupeMask(): return pointer to already existing item
The old behavior of returning true/false is compatible to this change,
so there are no other code changes required.
2011-12-25 19:42:03 +01:00
Alexander Barton ae5ebfb9f0 New functions Lists_Expire() and Class_Expire()
GLINE and KLINE lists are cleared automatically now, not when they are
checked. So "STATS g" and "STATS k" no longer show expired entries :-)
2011-12-25 17:44:20 +01:00
Alexander Barton 2b95c69ea1 lists.{c|h}: code cleanup; more documentation 2011-12-25 14:48:13 +01:00
Alexander Barton af70c3dbc9 List and class handling: add optional "reason" text
Adjust Lists_Add() and Class_AddMask() accordingly, implement
Lists_GetReason() and Lists_GetValidity().
2011-12-25 14:19:45 +01:00
Alexander Barton fea2194fc0 Lists: change "only once" property into "valid until"
The old "only once" true/false behavior is still supported, so there
are no other code changes required.
2011-12-24 13:34:25 +01:00
Alexander Barton 2a7dd06ebd Code cleanup: mostly removing empty lines 2011-02-13 17:52:38 +01:00
Alexander Barton 03628dbeaf Add Doxygen @file documentation to each source and header file 2011-02-13 17:52:38 +01:00
Florian Westphal 4a5dfcc3ac channel: fix confusing "adding to invite list" debug output
adding entries to ban list produced 'invite list' debug output...
2010-12-31 11:35:40 +01:00
Alexander Barton 5462c6c50f Don't #include client.h when conn.h/conn-func.h is already included
conn.h and cinn-func.h both already #include client.h, so it is
not needed to do it twice.
2010-06-30 23:49:52 +02:00
Florian Westphal b36fc3b095 Constify Lists_MakeMask argument and return type. 2008-04-19 14:11:25 +02:00
Florian Westphal c93d089736 return false instead of NULL in error path 2007-01-29 21:13:26 +00:00
Florian Westphal fa7bb2790a moved invite/ban lists to channel structure 2006-12-07 17:57:20 +00:00
Florian Westphal 0eccdbc137 -whitespace damage 2006-08-12 11:56:24 +00:00
Alexander Barton 77f54693ef Removed unnecessary #define of "LOCAL", now use plain C "static" instead. 2005-07-31 20:13:07 +00:00
Florian Westphal 8adff59223 Remove INT, LONG, BOOLEAN, STATIC, CONST, CHAR datatypes.
use stdbool.h / inttypes.h if available.
2005-03-19 18:43:48 +00:00
Alexander Barton 2440ed080c Fixed a buffer overflow that could cause the daemon to crash. Bug found
by Florian Westphal, <westphal@foo.fh-furtwangen.de>.
2005-01-26 13:23:24 +00:00
Alexander Barton 6b1e322865 New functions: Lists_SendInvites(), Lists_IsInviteEntry(), 2004-04-25 15:40:19 +00:00
Alexander Barton 64d330b726 Fixed handling of already existent entries in invite and ban lists:
the attempt to add an already existent entry is no error, it must
be propagated across servers (but not added to the list!).
2004-04-09 21:41:52 +00:00
Alexander Barton cb76d96efb Fixed some warnings of non-gcc-compilers (e. g. original Apple compiler on
A/UX): "warning: illegal pointer combination, op =".
2004-03-11 22:16:31 +00:00
Alexander Barton 57c7e23622 Added #include for strings.h to fix compiler warnings. 2004-01-17 03:17:49 +00:00
Alexander Barton 0ced4181b0 - replaced all strncpy()'s and strncat()'s with strlcpy() and strlcat(). 2002-12-26 16:25:43 +00:00
Alexander Barton 490f28ffd1 - new file header format (in english);
- new file ident semantics.
2002-12-12 12:24:18 +00:00
Alexander Barton 74ff9828de - kleinere "code cleanups". 2002-10-03 21:49:59 +00:00
Alexander Barton 05fc4a4cb7 - Parameter von List_Add{Invited|Banned}() erweitert.
- neue Funktion Already_Registered().
- doppelte Ban- und Invite-Eintraege werden nun vermieden.
2002-09-08 17:06:07 +00:00
Alexander Barton 592565aef5 - neu: Check_List(), Check_List(), Lists_AddInvited(), Lists_DelInvited(), Lists_ShowInvites, Lists_AddBanned(), Lists_DelBanned(), Lists_ShowBanned und Lists_MakeMask().
- einige Bug-Fixes, bessere Debug-Meldungen.
2002-09-08 00:55:45 +00:00
Alexander Barton 7d30c8cebc - Hmpf. "Verfruehtes" CVS-Update einiger Source-Files zurueckgenommen ... 2002-08-26 23:47:58 +00:00
Alexander Barton d645ce86e9 - Bei einem JOIN in einen persistenten Channel werden nun evtl. zu setzende
User-Modes korrekt in den Channel gemeldet.
2002-08-26 23:39:22 +00:00
Alexander Barton 81a26d988a - Lists_AddInvited() kann nun einen Fehler liefern. 2002-07-15 16:35:21 +00:00
Alexander Barton 31a8dd2f2f - Invite-Lists weiter implementiert.
- Flag "OnlyOnce" bei Lists_AddInvited() ergaenzt.
- Neue Funktion Lists_DeleteChannel().
2002-06-09 13:18:23 +00:00
Alexander Barton 6d28127154 - neue Funktion Lists_AddInvited(). 2002-06-02 15:23:16 +00:00
Alexander Barton 9dc44d9bab - neues Modul "lists" begonnen. 2002-05-27 11:22:39 +00:00