Hello community, here is the log from the commit of package booth for openSUSE:Factory checked in at 2014-08-05 21:11:14 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/booth (Old) and /work/SRC/openSUSE:Factory/.booth.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "booth" Changes: -------- --- /work/SRC/openSUSE:Factory/booth/booth.changes 2014-07-26 09:42:24.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.booth.new/booth.changes 2014-08-05 21:11:22.000000000 +0200 @@ -1,0 +2,7 @@ +Mon Aug 4 14:30:56 UTC 2014 - dmuhameda...@suse.com + +- config: prevent segfaults on bad usage +- config: allow configuring more than one ticket (bnc#889806) +- upstream version: 58a2b61 + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ booth.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/.git_info new/booth/.git_info --- old/booth/.git_info 2014-07-25 13:23:19.000000000 +0200 +++ new/booth/.git_info 2014-08-04 16:30:42.000000000 +0200 @@ -1 +1 @@ -v0.1.7-297-g2ecb536 +v0.1.7-299-g58a2b61 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/booth/src/config.c new/booth/src/config.c --- old/booth/src/config.c 2014-07-25 12:57:28.000000000 +0200 +++ new/booth/src/config.c 2014-08-04 15:56:20.000000000 +0200 @@ -243,14 +243,21 @@ return 0; } -static int validate_ticket(struct ticket_config *tk) +static int postproc_ticket(struct ticket_config *tk) { + if (!tk) + return 1; + + if (!tk->renewal_freq) { + tk->renewal_freq = tk->term_duration/2; + } + if (tk->timeout*(tk->retries+1) >= tk->renewal_freq) { - tk_log_error("total amount of time to " + log_error("%s: total amount of time to " "retry sending packets cannot exceed " "renewal frequency " "(%d*(%d+1) >= %d)", - tk->timeout, tk->retries, tk->renewal_freq); + tk->name, tk->timeout, tk->retries, tk->renewal_freq); return 0; } return 1; @@ -515,7 +522,7 @@ if (strcmp(key, "ticket") == 0) { if (current_tk && strcmp(current_tk->name, "__defaults__")) { - if (!validate_ticket(current_tk)) { + if (!postproc_ticket(current_tk)) { goto out; } } @@ -524,13 +531,17 @@ } else if (add_ticket(val, ¤t_tk, &defaults)) { goto out; } - - /* current_tk is valid until another one is needed - - * and then it already has the new address and - * is valid again. */ continue; } + /* current_tk must be allocated at this point, otherwise + * we don't know to which ticket the key refers + */ + if (!current_tk) { + error = "Unexpected keyword"; + goto err; + } + if (strcmp(key, "expire") == 0) { current_tk->term_duration = strtol(val, &s, 0); if (*s || s == val || current_tk->term_duration<10) { @@ -595,12 +606,12 @@ continue; } - error = "Unknown item"; - goto out; + error = "Unknown keyword"; + goto err; } if ((booth_conf->site_count % 2) == 0) { - log_warn("An odd number of nodes is strongly recommended!"); + log_warn("Odd number of nodes is strongly recommended!"); } /* Default: make config name match config filename. */ @@ -618,8 +629,9 @@ *(booth_conf->name+(cp2-cp)) = '\0'; } - if (!current_tk->renewal_freq) - current_tk->renewal_freq = current_tk->term_duration/2; + if (!postproc_ticket(current_tk)) { + goto out; + } return 0; -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org