Skip to content
Browse files

* Disabling "BAD_CHL"

* Fix : CHANNEL raw was sent twice when trying to force a user to join a channel during a "adduser" event or a "CONNECT" hook
  • Loading branch information...
1 parent d7906d2 commit 260da96b365e92d739ec992d09510f896e4688a4 @paraboul paraboul committed Jun 17, 2011
Showing with 15 additions and 7 deletions.
  1. +1 −1 build.sh
  2. +11 −3 src/cmd.c
  3. +3 −3 src/raw.c
View
2 build.sh
@@ -30,7 +30,7 @@ fi
cd ./deps/udns-0.0.9/
make clean && ./configure && make
cd ../js/src/
-./configure && make
+./configure && make -j8
cd ../../../
make
cd ./modules/ && make
View
14 src/cmd.c
@@ -216,16 +216,19 @@ int process_cmd(json_item *ijson, struct _cmd_process *pc, subuser **iuser, acet
}
- if (pc->guser != NULL && sub != NULL && (jchl = json_lookup(ijson->jchild.child, "chl")) != NULL && jchl->jval.vu.integer_value > sub->current_chl) {
+ if (pc->guser != NULL && sub != NULL && (jchl = json_lookup(ijson->jchild.child, "chl")) != NULL /*&& jchl->jval.vu.integer_value > sub->current_chl*/) {
sub->current_chl = jchl->jval.vu.integer_value;
- } else if (pc->guser != NULL && sub != NULL) {
+ }
+ #if 0
+ else if (pc->guser != NULL && sub != NULL) {
/* if a bad challenge is detected, we are stoping walking on cmds */
send_error(pc->guser, "BAD_CHL", "250", g_ape);
sub->state = ALIVE;
return (CONNECT_KEEPALIVE);
}
+ #endif
cp.param = json_lookup(ijson->jchild.child, "params");
cp.client = (cp.client != NULL ? cp.client : pc->client);
@@ -388,8 +391,13 @@ unsigned int cmd_connect(callbackp *callbacki)
callbacki->call_user = nuser;
- subuser_restor(getsubuser(callbacki->call_user, callbacki->host), callbacki->g_ape);
+ jstr = json_new_object();
+ json_set_property_objN(jstr, "user", 4, get_json_object_user(callbacki->call_user));
+ newraw = forge_raw("IDENT", jstr);
+ newraw->priority = RAW_PRI_HI;
+ post_raw_sub(newraw, callbacki->call_subuser, callbacki->g_ape);
+
jstr = json_new_object();
json_set_property_strN(jstr, "sessid", 6, nuser->sessid, 32);
View
6 src/raw.c
@@ -47,7 +47,7 @@ RAW *forge_raw(const char *raw, json_item *jlist)
string = json_to_string(jstruct, NULL, 1);
new_raw = xmalloc(sizeof(*new_raw));
- new_raw->len = string->len;
+ new_raw->len = string->len;
new_raw->next = NULL;
new_raw->priority = RAW_PRI_LO;
new_raw->refcount = 0;
@@ -79,9 +79,9 @@ RAW *copy_raw(RAW *input)
new_raw->next = input->next;
new_raw->priority = input->priority;
new_raw->refcount = 0;
- new_raw->data = xmalloc(sizeof(char) * (new_raw->len + 1));
+ new_raw->data = xmalloc(sizeof(char) * (new_raw->len + 1));
- memcpy(new_raw->data, input->data, new_raw->len + 1);
+ memcpy(new_raw->data, input->data, new_raw->len + 1);
return new_raw;
}

0 comments on commit 260da96

Please sign in to comment.
Something went wrong with that request. Please try again.