[tor-bugs] #33993 [Applications/rbm]: In input_files, target, target_prepend, target_append are silently ignored if they are not an array

Tor Bug Tracker & Wiki blackhole at torproject.org
Mon Apr 27 09:25:11 UTC 2020


#33993: In input_files, target, target_prepend, target_append are silently ignored
if they are not an array
-----------------------------------+------------------------------
 Reporter:  boklm                  |          Owner:  boklm
     Type:  defect                 |         Status:  needs_review
 Priority:  Medium                 |      Milestone:
Component:  Applications/rbm       |        Version:
 Severity:  Normal                 |     Resolution:
 Keywords:  TorBrowserTeam202004R  |  Actual Points:
Parent ID:                         |         Points:
 Reviewer:                         |        Sponsor:
-----------------------------------+------------------------------

Comment (by gk):

 You have
 {{{
             if (ref $input_file->{target} eq 'ARRAY') {
                 $input_file->{target} = process_template_opt($project,
                                             $input_file->{target},
 $options);
             } else {
                 $input_file->{target} = $config->{run}{target};
             }
             if (ref $input_file->{target_prepend} eq 'ARRAY') {
                 $input_file->{target} = [ @{
 process_template_opt($project,
 $input_file->{target_prepend},
                                                $options) },
                                           @{$input_file->{target}} ];
             }
             if (ref $input_file->{target_append} eq 'ARRAY') {
                 $input_file->{target} = [ @{$input_file->{target}},
                                           @{
 process_template_opt($project,
 $input_file->{target_append},
                                                $options) } ];
             }
 }}}
 below the patch. Two questions:

 1) Do we still need all the array checks in that one given that we already
 checked for arrays in the patch and exit with an error in case the
 condition is not met?

 2) How would the `else` clause still be called given that we are now
 bailing out earlier if `target` is no array?

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/33993#comment:2>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list