After installing the Perl modules from the source tree, the install copied
every .pm in the build tree's lib/ over them, though only Base, Config,
Memory, ConfigData and ONVIF are generated there. Copies of other modules
left in a build directory by an older build replaced current ones on
install: a stale ZoneMinder/Server.pm without systemdRunning() left
zoneminder.service failing in zmpkg.pl. The five generated modules are now
named one by one.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With fast deletes on, deleting an event in the web interface removed only
its Events row and left its Frames and Stats rows and its files for
zmaudit, and deleting a monitor left all of its events. zmaudit only runs
when ZM_RUN_AUDIT is on, and both options default to off independently,
so with fast deletes on and the audit off nothing ever removed them and
the Frames table grew without bound. In the Perl Event::delete the option
also kept zmfilter from removing the files of the events it purged.
Remove the option. ZM\Event::delete() always removes the Stats and Frames
rows and the files in one transaction with the Events row,
ZM\Monitor::destroy() always deletes the monitor's events, and the Perl
Event::delete deletes the files unless the storage area has DoDelete off.
zmupdate.pl rebuilds the Config table from ConfigData, so the option's row
goes away on upgrade without a migration. Drop the option from the docs,
from the zmaudit option help, and from the es_la, ro_ro and ru_ru
translations.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FilterTerm::sql_attr() returned 'weekday(NOW()' without its closing
parenthesis, so any filter with a Current Weekday term failed with
"Database query failed". FilterTerm::valid() treated the value 0 (Monday) as
missing, so a Monday term was dropped and the filter matched every event.
ZoneMinder::Filter had no CurrentWeekday case at all and emitted
E.CurrentWeekday, a column Events does not have, so zmfilter.pl could not run
such a filter either. Emit weekday(NOW()) there as well.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PSIA.pm has not compiled since it was added: move() built an unused
command string from undeclared $panSteps/$tiltSteps, and the PUT and
DELETE error paths logged an undeclared $cmd. zmcontrol.pl loads the
module when a PSIA camera is moved, so every PSIA PTZ command died.
Drop the unused line and log the request path on failure. A new test
compiles every control module.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Control.pm's get(), put() and credential parsing, and the HikVision,
Netcat, PSIA, Serial_HEX_PelcoD, TapoC520WS_ONVIF, Instar720p,
Vivotek_ePTZ, Keekoon, M8640, FI8908W, IPCC7210W, DericamP2,
WanscamHW0025, Dahua and Grandstream modules logged the camera's
password: as a separate field ("username X password Y", which no
pattern in the logger can recognise), or inside the ControlAddress, Path
or request URL. Some of these are Info or Error lines, which reach the
Logs table at the default settings (Instar720p, IPCC7210W, DericamP2,
WanscamHW0025 on every command; FI8908W, M8640, Vivotek_ePTZ,
Grandstream on failures). Reolink_HTTP logged its API session token.
Log the user name without the password, URLs through urlForLog() (host,
port and path kept), and the Reolink token as a fingerprint. The test
scans the Perl modules for log calls that interpolate a password.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ZoneMinder::Storage::s3() logged the parsed S3 access key id, secret
key, host and bucket, and the URL they came from, at Debug level 1 in
every process that deletes or uploads events (zmfilter, zmaudit). Log
the key id, host, bucket and subpath, and the URL through urlForLog().
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The PTZ control modules build camera URLs with user:password@ from the
ControlAddress or Path, or pwd= from the ControlDevice, and log them at
Debug, Info or Error. Info and Error reach the Logs table at the default
settings, which every System=View user can read. There are over fifty
modules, most written for one camera and not testable here.
ZoneMinder::Logger gets redactCredentials(), urlForLog() and
logFingerprint() (the same fp: tag as the web and C++ logs), and
logPrint() passes every message through redactCredentials(): userinfo is
removed from URLs and from scheme-less host specs, pass/pwd/secret
parameters are replaced, token= and auth= are fingerprinted, WS-Security
password digests and JSON password fields are replaced. Host, port, path
and the other parameters stay in the line.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HikVision.pm calls XML::LibXML->load_xml and XML::LibXML::Element->new but
never loaded the module, so it only worked when another module had already
pulled it in. Add the missing use line.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The plain relay keeps the user's password in the web session and puts
user= and pass= in every stream, video and HLS URL the web UI builds,
in multi-server requests and in zmu command lines. hashed has been the
default for a long time and does none of that.
Mark plain as deprecated in the option's description and help, and
have zmpkg.pl log one Warning at start when authentication is on and
the relay is plain, pointing at hashed with ZM_AUTH_HASH_SECRET set.
The warning is logged once per start rather than per web request so it
does not flood the log. The option's values and behaviour are
unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 9ccb904bca)