Commit Graph

214 Commits

Author SHA1 Message Date
Jan Vidar Krey
fc52f0e030 Renamed the hub_sendq and hub_recvq to ioq_send and ioq_recv. 2012-09-28 09:24:04 +02:00
Jan Vidar Krey
845aefc941 Decouple hub and user manager more cleanly. 2012-09-27 15:29:00 +02:00
Jan Vidar Krey
4fcf3ffc83 Add support for configuration options that depend on certain #ifdefs. 2012-09-27 15:28:46 +02:00
Jan Vidar Krey
cba0121574 ADCH++ had a security bug that allowed UCMD extension to be relayed.
uhub did not have this security bug since the hub did not advertise support for the
UCMD extension, but the message was still correctly relayed as specified in the
protocol specification.

However, this commit adds support for the UCMD extension, but only to the extent
that uhub will advertise it and uhub will also drop any such CMD message
generated by a client and will (currently) never issues a CMD message by itself.
2012-07-30 00:08:12 +02:00
Yorhel
b9005b1724 core/probe.c: Fix TLS probe when handshake version != SSL version
GnuTLS sends a handshake with SSL 3.0 (0x0300) in the outer packet, but
mentions TLS 1.2 (0x0303) in the Client Hello. There's no real need for
uhub to validate these fields, as OpenSSL should do that itself already.
Just use the version mentioned in Client Hello for logging output.
2012-06-02 14:46:47 +02:00
Jan Vidar Krey
571abddd98 Cleaned up code generator for config file parsing. 2012-05-23 23:37:42 +02:00
Jan Vidar Krey
3ae6da4a64 Print error message in case of shutting down due to errors loading plugins. 2012-05-14 23:35:53 +02:00
Tilka
9e52ea7eff add on_change_nick() to struct plugin_funcs
It's not called anywhere yet.
Also reorder some typedefs, rename the ip check functions and add
struct {hub,plugin}_user parameter to on_check_ip_late(). Not sure where
to insert a call to that...
2012-05-09 23:33:03 +02:00
Tilka
05fd6bb723 minimal changes 2012-05-09 23:27:06 +02:00
Jan Vidar Krey
3aaabbc543 Fix issue with QUI messages being allowed through the hub 2012-05-06 23:09:02 +02:00
Tilka
d49127b507 changed all calls to assert() to uhub_assert() 2012-05-02 21:06:46 +02:00
Jan Vidar Krey
ccded3f642 Don't strip the U4/U6 port numbers if updated after login. 2012-05-02 20:45:31 +02:00
Jan Vidar Krey
216757a1f4 Fix compile issue with double typedefs. 2012-05-02 00:29:26 +02:00
Jan Vidar Krey
74ca5a0a33 Cleaned up command handling code, by splitting into multiple files. 2012-05-01 20:15:49 +02:00
Tilka
e4cf01ff1f OMG OPTIMIZED 2012-04-21 16:56:22 +02:00
Tilka
b72f5a407a fix double free 2012-04-21 16:51:41 +02:00
Tilka
27ceb7ad33 fix use of uninitialized struct ip_range 2012-04-21 09:46:50 +02:00
Tilka
c5036a3ff8 fix random crashes upon !reload
A struct plugin_hub_internals was falsely casted to struct
plugin_callback_data. This caused the contained commands list pointer to point to
a struct hub_info and commands->size took the value of a pointer to a struct
net_connection. Since size is increased/decreased every time an item is
added to/removed from the list, this resulted in some funny crashes.

This fix is a little dirty as it exports some internals.
2012-04-21 09:22:06 +02:00
Tilka
832277f653 fix command syntax 2012-04-21 06:08:36 +02:00
Tilka
c525e59fa5 use arg parser in !broadcast 2012-04-21 01:56:26 +02:00
Jan Vidar Krey
55030935a7 Merge https://github.com/Tilka/uhub 2012-04-19 23:17:39 +02:00
Tilka
4f0c8e0356 fix multiple optional arguments
Assuming the argument definition "?xy", it was previously not possible
to specify only x. Also, the syntax will now be shown as "[x [y]]"
instead of "[x] [y]".
2012-04-19 03:06:52 +02:00
Tilka
e925db2b98 small cleanup 2012-04-19 02:56:27 +02:00
Tilka
e408ae3eba automatically clean up plugin commands 2012-04-19 02:53:43 +02:00
Jan Vidar Krey
1dba731cc3 Fix bug #158 - Added plugin for setting topic (hub description).
Load plugin mod_topic, and it will provide 3 new user commands:

!topic - set new topic
!cleartopic - reset the topic (use default hub description)
!showtopic - show the current topic
2012-04-19 00:33:38 +02:00
Jan Vidar Krey
df7bbc094f Command arguments handling + cleanups
Fix bug #185 - Args of !commands lost/damaged.
All string arguments were incorrectly freed after being added to the argument list for a command.
Instead this fix makes sure it is properly copied into a new string, and by doing so this requires
a new API for dealing with hub command arguments in a type safe manner, and also allows for each
argument to be cleaned up properly when the command is no longer needed.

This also fixes issues with parse errors for certain types, and optional arguments (previously it was impossible
to tell the difference for an integer with value 0 or if no integer was given).

All arguments can now be accessed through the new functions
hub_command_arg_reset() and hub_command_arg_next().

These functions are also exposed to plug-ins.

The argument type notations for 'n' has changed to mean nick (string),
and 'u' is used for a user (struct hub_user - must be online).
2012-04-18 23:03:05 +02:00
Jan Vidar Krey
8607b40278 Fix bug #180 - Crash after signal SIGHUP. 2012-01-19 02:58:20 +01:00
Jan Vidar Krey
a9b5c6db38 Fixed minor issues found with static code analyzis (Clang). 2012-01-13 01:31:34 +01:00
Jan Vidar Krey
5edf2b60d4 Fixed bug #179 - !broadcast command does not work properly. 2012-01-10 02:21:22 +01:00
Jan Vidar Krey
eee2636582 Added a chat only hub plugin that disables searching and connection setup.
This also deprecates the built-in chat_only configuration option.
If you need this functionality, then load the mod_chat_only plugin (if it is loaded then only operators
are able to search, connect, etc).
2012-01-09 20:58:19 +01:00
Jan Vidar Krey
ca3782c570 Merge branch 'mod_chat_history_work'
Conflicts:
	doc/plugins.conf
2012-01-03 23:22:41 +01:00
Jan Vidar Krey
875f55a401 Added a chat history plugin.
The mod_chat_history plugin provides chat history for all public chat messages.

Can be configured in the following ways:

- history_max: max number of messages stored in history
- history_default: the default number of messages to be returned when invoking !history
- history_connect: if > 0, then this number of messages is automatically sent when connecting to the hub

Removed the built-in !history command in favour of the mod_chat_history plug-in.

Make sure we unescape all chat messages before forwarding any of them to plugins.

Update example plugins.conf in documentation directory.
2012-01-03 23:22:41 +01:00
Jan Vidar Krey
7b392acbf5 Format the help list appropriately (as in older versions). 2011-12-28 10:45:02 +01:00
Jan Vidar Krey
1700a27619 Fix bug #173 - Fix the command parsing errors. 2011-12-22 01:49:21 +01:00
Jan Vidar Krey
2a190859bd Remove the configuration options 'file_motd' and 'file_rules'. Use mod_welcome instead. 2011-12-21 14:44:37 +01:00
Jan Vidar Krey
b24d4b85cd Split out the command buffer code to a generic buffer. 2011-12-21 13:53:53 +01:00
Jan Vidar Krey
f34f0328a3 Removed the PLUGIN_SUPPORT code, since plugin support is now mandatory. 2011-12-21 10:48:37 +01:00
Jan Vidar Krey
f31fc65e1d VS2010 fixes. 2011-12-21 01:42:21 +01:00
Jan Vidar Krey
ba26f4c5e2 Update copyright notices and added licenses to files that were missing it. 2011-12-19 10:54:47 +01:00
Jan Vidar Krey
68dc3cafc7 Removed unused files. 2011-12-19 10:51:45 +01:00
Jan Vidar Krey
93caa9b3c1 Fix compile warning about uninitiaized variable. 2011-12-19 00:36:53 +01:00
Jan Vidar Krey
f2cb84180a Refactored command parsing.
Allows for automatically tested command parsing by splitting parsing
and invokation of the commands.
2011-12-19 00:34:45 +01:00
Jan Vidar Krey
fc5e09aa9e fixup! Fix bug #171 - Race condition could allow two users with same CID or nick to enter the hub. 2011-12-12 12:03:28 +01:00
Jan Vidar Krey
b4779bfb12 Fix bug #171 - Race condition could allow two users with same CID or nick to enter the hub. 2011-12-11 13:38:36 +01:00
Jan Vidar Krey
6d609e18a2 Windows/VS2010 fixes. 2011-12-11 12:53:09 +01:00
Jan Vidar Krey
aec89fc125 Fix memory leaks when parsing user commands. 2011-12-09 16:54:48 +01:00
Jan Vidar Krey
9377fb537a Fix memory leak when unloading plugins. 2011-12-09 16:39:19 +01:00
Jan Vidar Krey
afda1d7b9d Added a LOG_PLUGIN macro for plugin output debug messages.
Converted all TRACE messages related to plugins to LOG_PLUGIN.
2011-12-09 16:38:11 +01:00
Jan Vidar Krey
2352e5a0dd Fix memory leak for built-in commands. 2011-12-09 16:35:42 +01:00
Jan Vidar Krey
1dc79c641c Cleanup: do not use strcat(). 2011-12-09 15:58:58 +01:00