|
Changes previously carried as bnw-container-paths.patch in
guix-bioinformatics, now applied to the source directly:
* unify data directories on /var/lib/genenet/bnw (was /tmp/bnw and
./data/ mixed)
* make the shell_exec paths __DIR__-relative and the example/octave
helper scripts location-independent, so php-fpm can run them from
any working directory
* use core-octave randn/exp instead of the statistics-package
normrnd/normpdf (not available in the container's octave)
* nnodes: strtrim before strfind so the node count parses with the
container's octave output
* python3 instead of a hardcoded /home/jziebart path
* add diag.php, a debug page showing the request and data state
* bn_genenet.php: serve the GeneNetwork (GN2) handshake server-side;
the My_Gennenet POST is converted (commas -> tabs, semicolons ->
newlines) in PHP and the prepared-data page is returned in ONE
request. This removes the raw-echo of into a JavaScript
string (an XSS hole on public deployments) and is backward
compatible for GN2 (same POST, better response).
|
|
$TextinFile was passed to move_uploaded_file() as its $to argument, but
its assignment (and the $keyval/$sid/$dir it depends on) was commented
out, so $TextinFile was always null/undefined here -- an upload
through this page could never succeed even on PHP 7.4, and on PHP 8.1+
it also triggers "Passing null to parameter #1 ($to)... is deprecated".
$keyval was similarly used (e.g. in the hidden My_key form field)
before it was ever assigned, causing an "Undefined variable" warning
that could leak into an unquoted HTML attribute if display_errors is on.
Unlike bn_file_load_gom.php (a fresh-upload entry point that mints a
new random key), this page is only reached via a redirect from
modify_structure_learning.php with an existing My_key already in the
query string. Restored the commented-out block, adapted to read
$keyval from $_GET (matching how the rest of this file already does it
further down) instead of generating a new one, so $TextinFile is a
real path before the upload block runs.
Verified empirically against PHP 8.3.28: simulating an upload request
now correctly reaches move_uploaded_file() with a real path and falls
into the file's own pre-existing "Sorry, error uploading" handling
instead of silently failing on a null argument.
Reviewed by: Frederick M Muriithi <fredmanglis@gmail.com>
|