Commit Graph
11 Commits
Author SHA1 Message Date
Isaac Connor c61e3a84e0 Merge pull request #5951 from AJ0070/zmeventtool-renumber
fix: keep tags, snapshots, lock and location in zmeventtool renumber
2026-11-15 11:30:45 -05:00
Isaac Connor dac0894cb9 Merge pull request #5907 from AJ0070/zmcamtool-fixes
fix: zmcamtool preset insert, export name check and database credentials
2026-11-14 18:43:17 -05:00
Jash 19768de39c fix: keep tags, snapshots, lock and location when zmeventtool renumbers an event refs #5950 2026-11-15 02:11:28 +05:30
Jash 608f6482d4 fix: make zmeventtool refuse commands it does not implement refs #5908 2026-11-14 22:58:07 +05:30
Jash 3ddd7e2cb9 fix: make zmcamtool and zmeventtool use the --user and --pass they are given refs #5906 2026-11-14 22:58:02 +05:30
Nic Boet 877342fe2e fix: skip a missing event directory in zmeventtool renumber instead of dying
Perl's continue is not loop control: outside a given/when block it dies with
"Can't \"continue\" outside a when block", so renumber stopped at the first
event whose directory was missing and never handled the ones after it.

fixes #5340
2026-10-24 10:33:16 -05:00
Steve GilvarryandClaude Opus 5 ba49bbb33c fix: make the Perl scripts' taint-safe PATH configurable
The scripts run under -T, so they cannot trust the caller's PATH and set
their own. Sixteen of them hardcoded /bin:/usr/bin:/usr/local/bin, which
assumes everything they shell out to lives under /usr or /usr/local.

ZoneMinder::General::findDbCommand looks for a database client on that
PATH, and zmupdate.pl and zmcamtool.pl run what it finds. So an install
whose client sits anywhere else cannot apply schema changes:

  sh: mysql: command not found
  Command 'mysql -u'zmuser' ... ' exited with status: 127

even with the client on the caller's PATH. Homebrew on Apple Silicon is
the case that surfaced it - the client is in /opt/homebrew/bin - but a
--prefix=/opt install on Linux has the same shape, as does anything that
keeps its database client outside the FHS locations.

Replaced the literal with @ZM_SCRIPT_PATH@, defaulting to the same three
directories plus wherever cmake actually found a client, and overridable
for packagers who want to pin it. Warn at configure time when no client
is found at all, since that failure otherwise appears much later and
says something unrelated.

Nothing changes for an install whose client is already under /usr/bin:
the directory is only appended when it is not in the list, so the
default stays exactly as it was.

Memory.pm is deliberately left alone. It has a narrower PATH of
/bin:/usr/bin, and the only command it runs is uname through an absolute
path from ZM_PATH_UNAME, so it does not need widening.

Verified on macOS across the three cases: with the client in
/opt/homebrew/bin the directory is appended; -DZM_SCRIPT_PATH= is
respected verbatim; and pointing detection at /usr/bin/mariadb leaves
the default untouched. Build clean, suite 146 cases.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B5KL9Xbi7K5aGsauLtd8tG
2026-09-13 13:04:59 +10:00
Isaac Connor e739b04a97 Add more debugging and event deleting when renumbering 2023-09-22 16:28:35 -04:00
Isaac Connor eea18b1663 Implement event renumbering in zmeventtool 2023-09-18 17:05:32 -04:00
Isaac Connor ae07db6104 Implement the close command in zmeventtool.pl 2022-09-28 11:07:31 -04:00
Isaac Connor 4349106270 Rough in zmeventtool with command deleteanalysisjpegs 2022-05-17 12:26:33 -04:00