From e73a9312434216fccadf600e8d7785a87c5ec7b1 Mon Sep 17 00:00:00 2001 From: Jan Vidar Krey Date: Fri, 27 Mar 2009 11:12:50 +0100 Subject: [PATCH] Ensure we do not allow update of certain elements. Signed-off-by: Jan Vidar Krey --- src/inf.c | 10 ++++++++++ version.h | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/inf.c b/src/inf.c index b8c92bc..f606209 100644 --- a/src/inf.c +++ b/src/inf.c @@ -222,6 +222,13 @@ int check_network(struct user* user, struct adc_message* cmd) return 0; } +void strip_network(struct user* user, struct adc_message* cmd) +{ + adc_msg_remove_named_argument(cmd, ADC_INF_FLAG_IPV6_ADDR); + adc_msg_remove_named_argument(cmd, ADC_INF_FLAG_IPV6_UDP_PORT); + adc_msg_remove_named_argument(cmd, ADC_INF_FLAG_IPV4_ADDR); + adc_msg_remove_named_argument(cmd, ADC_INF_FLAG_IPV4_UDP_PORT); +} static int nick_length_ok(const char* nick) { @@ -829,7 +836,10 @@ int hub_handle_info(struct user* user, const struct adc_message* cmd_unmodified) /* FIXME - What if limits are not met ? */ check_limits(user, cmd); + strip_network(user, cmd); hub_handle_info_low_bandwidth(user, cmd); + + update_user_info(user, cmd); if (!adc_msg_is_empty(cmd)) diff --git a/version.h b/version.h index e6f347e..7f6b644 100644 --- a/version.h +++ b/version.h @@ -7,7 +7,7 @@ #endif #ifndef VERSION -#define VERSION "0.2.8" +#define VERSION "0.2.9-alpha" #endif #ifndef COPYRIGHT