Ticket #26523: hspost.patch

File hspost.patch, 1.7 KB (added by akwizgran, 3 weeks ago)

Patch against tor-0.3.4.3-alpha

  • src/or/control.c

    diff --git a/src/or/control.c b/src/or/control.c
    index bb68925f8..09cf833e3 100644
    a b handle_control_hspost(control_connection_t *conn, 
    44494449
    44504450  smartlist_t *args = smartlist_new();
    44514451
    4452   /* If any SERVER= options were specified, try parse the options line */
    4453   if (!strcasecmpstart(argline, opt_server)) {
     4452  /* If any SERVER= or HSADDRESS= options were specified, try to parse
     4453   * the options line. */
     4454  if (!strcasecmpstart(argline, opt_server) ||
     4455      !strcasecmpstart(argline, opt_hsaddress)) {
    44544456    /* encoded_desc begins after a newline character */
    44554457    cp = cp + 1;
    44564458    encoded_desc = cp;
    handle_control_hspost(control_connection_t *conn, 
    44734475          hs_dirs = smartlist_new();
    44744476        smartlist_add(hs_dirs, node->rs);
    44754477      } else if (!strcasecmpstart(arg, opt_hsaddress)) {
    4476         if (!hs_address_is_valid(arg)) {
     4478        const char *address = arg + strlen(opt_hsaddress);
     4479        if (!hs_address_is_valid(address)) {
    44774480          connection_printf_to_buf(conn, "512 Malformed onion address\r\n");
    44784481          goto done;
    44794482        }
    4480         onion_address = arg;
     4483        onion_address = address;
    44814484      } else {
    44824485        connection_printf_to_buf(conn, "512 Unexpected argument \"%s\"\r\n",
    44834486                                 arg);
    handle_control_hspost(control_connection_t *conn, 
    44924495    read_escaped_data(encoded_desc, encoded_desc_len, &desc_str);
    44934496    if (hs_control_hspost_command(desc_str, onion_address, hs_dirs) < 0) {
    44944497      connection_printf_to_buf(conn, "554 Invalid descriptor\r\n");
     4498    } else {
     4499      send_control_done(conn);
    44954500    }
    44964501    tor_free(desc_str);
    44974502    goto done;