When the authtoken received from the client is the unquoted literal
string "null" in a pcrud request, the drone processing the request
will crash with a segmentation fault as the session verification code
passes a NULL pointer to strcmp.
To reproduce this bug, make the following request via srfsh:
Next, grep /var/log/syslog for the string segfault. You should find
something resembling the following:
Jul 12 15:29:43 buster kernel: [ 94.794920] opensrf-c[1357]:
segfault at 0 ip 00007fe3bbb8b219 sp 00007fff2877a020 error 4 in
liboils_pcrud.so.2.0.0[7fe3bbb82000+10000]
After patching Evergreen with this commit, repeat the srfsh request
again. This time, the call should return almost immediately with an
osrfMethodException: "permacrud received a bad auth token: (null)."
When you grep syslog for segfault this time, you should find no new
occurrences.
Signed-off-by: Mike Rylander <email address hidden>
Signed-off-by: Jason Stephenson <email address hidden>
LP#1858114: Fix thinko in template-parameter collection
Minor thinko in the use of Array.prototype.concat() when gathering the
"where" and "having" template parameters -- concat() does not alter the
array it is called on, so we need to assign the result back to the
array.
Signed-off-by: Mike Rylander <email address hidden>
Signed-off-by: Angela Kilsdonk <email address hidden>
Signed-off-by: Jason Boyer <email address hidden>
LP#1858114: Record template filter values for aggregate columns
Currently the "having" clause does not record template-level filter
values in the template, but forces use of a report-level parameter.
This commit allows "having" to receive a value in the same way that
"where" does.
Signed-off-by: Mike Rylander <email address hidden>
Signed-off-by: Angela Kilsdonk <email address hidden>
Signed-off-by: Jason Boyer <email address hidden>
LP#1858114: Present proper input widget for aggregate parameters
There's currently logic to override the filter widget for all columns
that have a selector defined, such as the ID column of many tables. When
we transform the column with an aggregate transform, though, we don't want
to pick a particular selector-labeled value.
While I can imagine using a min or max aggregate to get a representative
value for a group, when other dependent filters would make the value
stable or where the value in particular doesn't matter but isn't needed
in a count (say), all the other aggregate transforms that are currently
supported are specifically numeric (sum, average, count, and
count_distinct). Because of that, and the most likely use case of
matching a count to "0" or "1", we should only present the "remote
object widget" for non-aggregates, and just use the baseline text string
input here.
Signed-off-by: Mike Rylander <email address hidden>
Signed-off-by: Angela Kilsdonk <email address hidden>
Signed-off-by: Jason Boyer <email address hidden>