Commit Graph

148 Commits

Author SHA1 Message Date
Isaac Connor
12409e624e Support username and password as auth query params. These happen when using auth_relay=plain. 2023-02-25 13:12:40 -05:00
Isaac Connor
d673266235 Stop the dbQueue before closing logs. Since dbQueue.stop() join's the dbQueue thread, it should not log after we return. 2022-05-18 19:00:30 -04:00
Isaac Connor
dc055fb240 Remove code handling failure to setStreamStart. This is now ok and handled in runStream 2022-04-28 16:44:39 -04:00
Isaac Connor
45b6c97cc8 Don't exit if we fail to set stream start 2022-04-28 16:42:35 -04:00
Isaac Connor
133553e630 Revert "Merge pull request #3119 from Carbenium/fmt"
This reverts commit 90d930c7c3, reversing
changes made to 0bcb9d276f.
2022-02-27 14:05:14 -05:00
Isaac Connor
c5b9ed9451 Revert "Fix zms build"
This reverts commit e6b36bb186.
2022-02-27 13:46:51 -05:00
Isaac Connor
e6b36bb186 Fix zms build 2022-02-27 10:41:42 -05:00
Isaac Connor
cad57df0bb Merge branch 'master' into fmt 2022-02-26 13:56:20 -05:00
Isaac Connor
7ae9bebea4 Add analysis boolean query param 2022-01-07 12:40:21 -05:00
Isaac Connor
a2ae63cefe Merge branch 'master' into fmt 2021-11-16 15:10:45 -05:00
Isaac Connor
848a537a0f Fix zms giving 500 code instead of displaying error image due to not having sent the headers yet. 2021-08-23 18:10:31 -04:00
Peter Keresztes Schmidt
d69afc9672 misc: Convert time(nullptr) calls to std::chrono 2021-06-13 23:22:51 +02:00
Peter Keresztes Schmidt
a9ad5c5eee Build: Promote libavcodec to a required dependency
FFmpeg is an integral component of ZM. Promote the appropriate libraries to required dependencies.
This reduces the possible build configurations greatly and thus maintenance burden.
2021-06-05 14:25:54 +02:00
Isaac Connor
8f27db5d6f Do not stop dbQueue in logTerm. dbQueue is not just for logging. 2021-05-04 14:22:02 -04:00
Isaac Connor
88147f3f7a add another logInit so that early messages go to zms.log after loading config. Add Image::Initialise so that initialised flag will get set, and add a Deinitialise call so that ram allocated in zm_image gets freed. 2021-05-01 14:49:33 -04:00
Peter Keresztes Schmidt
b5f3682d4e utils: some more reshuffling/grouping and formatting 2021-04-04 01:18:34 +02:00
Peter Keresztes Schmidt
67d7872e9a Eliminate non-thread-safe calls to gmtime
gmtime uses an internal static storage to which a pointer is given as return value.
Due to this it is not safe to call gmtime from multiple threads since the same static storage is used.

Use gmtime_r instead which allows to pass in a tm struct.

Fixes:
https://github.com/ZoneMinder/zoneminder/security/code-scanning/32
2021-03-21 21:42:02 +01:00
Peter Keresztes Schmidt
d9568a98c0 Drop zm_thread which has been replaced by STL implementations 2021-03-04 10:55:46 +01:00
Peter Keresztes Schmidt
e18750bb79 logger: Pass std::string as ID during logInit 2021-03-01 22:43:02 +01:00
Peter Keresztes Schmidt
589e5fec26 zms: Use fmt to construct the log ID 2021-03-01 22:43:02 +01:00
Peter Keresztes Schmidt
aec4dbc6ff DB: Make connection initialization more predictable and avoid double-initialization
Remove calls to zmDBConnect from various places to avoid possible side-effects/double initialization.
The function should be called once from the main thread of the daemon.

Also split config loading into 2 steps: static and DB config loading. Load the static config before zmDBConnect is called so it has a chance to succeed.
2021-02-07 13:44:41 +01:00
Peter Keresztes Schmidt
0dbc39ee25 Cleanup and reorganize includes
With this commit a unified structure for includes is introduced.
The general rules:
 * Only include what you need
 * Include wherever possible in the cpp and forward-declare in the header

 The includes are sorted in a local to global fashion. This means for the include order:
  0. If cpp file: The corresponding h file and an empty line
  1. Includes from the project sorted alphabetically
  2. System/library includes sorted alphabetically
  3. Conditional includes
2021-02-04 18:02:01 +01:00
Peter Keresztes Schmidt
5a57efdfe2 Replace deprecated C header includes with the C++ ones. 2021-02-04 05:39:03 +01:00
Peter Keresztes Schmidt
e09fa1bebf Remove includes of <cinttypes>
Instead of including <cinttypes> directly, zm_define.h should be used
to get the typedef'ed types as well.
2021-02-02 21:37:26 +01:00
Isaac Connor
b4fc782778 fifo.h got split into zm_fifo and zm_stream so update the code in zms 2021-03-01 16:49:27 -05:00
Isaac Connor
0f276887ad When can't connect to monitor send an image saying so 2021-01-15 14:43:44 -05:00
Isaac Connor
4d8f45d284 There is no need to copy query. We do not modify it. 2020-11-21 16:59:21 -05:00
Isaac Connor
7653a058a3 More correct code for setting source 2020-11-20 16:31:40 -05:00
Isaac Connor
033e749a57 improve code logic/spacing 2020-11-01 17:16:07 -05:00
Isaac Connor
a4b83b0e99 Merge branch 'master' of github.com:zoneminder/ZoneMinder 2020-09-09 12:13:54 -04:00
Isaac Connor
6bfd7c5e14 log referer when unable to authenticate 2020-09-09 12:13:28 -04:00
Isaac Connor
3a9cec8e4d We no longer care about not being able to connect to the monitor. 2020-09-02 16:37:11 -04:00
Peter Keresztes Schmidt
8f980a1168 Convert NULL/0 to nullptr
The 0 -> nullptr changes should definitely improve readability.
2020-08-26 22:03:40 +02:00
Isaac Connor
ae9a5766f5 Merge branch 'release-1.34' into fix_zms 2020-04-26 18:19:30 -04:00
Isaac Connor
00dad82b46 Fix use of strncpy using the entire size of the buffer. You have to -1 for the null char 2020-04-23 18:12:54 -04:00
Isaac Connor
4aaa02dc24 fix cpplint complaints and remove casts that are unnecessary. Micro-optimisation by using fputs for date_string instead of fprintf 2020-04-23 18:12:44 -04:00
Isaac Connor
e5c194e9ee Fix return 403 status code 2019-07-26 12:22:04 -04:00
Isaac Connor
0643108ba4 Use fputs instead of fprintf. Spacing and google code style changes 2019-07-26 10:53:48 -04:00
Isaac Connor
9a31f8792c return proper error codes when failed auth or fail permissions 2019-07-19 13:55:35 -04:00
Pliable Pixels
915e9f05a9 merged fifo changes 2019-05-16 16:14:06 -04:00
Mitch Capper
eb005e8b9c FIFO support for zoneminder zone debugging (#2594)
Adds fifo options for diagnostic images for much lower impact diagnostics mode.  Diagnostic images are only written when there is a client listening for them (otherwise they are skipped).  Also added a json stream for the detection data so you can see in real time the pixels or blobs detected for the motion.  This allows for easy real time stream of both delta and reference images (as video streams) along with the detection numbers.
2019-05-16 15:37:03 -04:00
Pliable Pixels
21710b6e49 demote logs 2019-05-12 15:45:39 -04:00
Pliable Pixels
27e6e46f84 remove allowing auth_hash_ip for token 2019-05-08 12:11:32 -04:00
Pliable Pixels
b293592e4c added token validation to zms/zmu/zmuser 2019-05-08 10:55:32 -04:00
Isaac Connor
24665264a2 Merge branch 'storageareas' of github.com:/ConnorTechnology/ZoneMinder into storageareas 2019-03-05 20:16:05 -05:00
Isaac Connor
903f5af1ef invalid parameters should be a debug not a warning 2019-03-04 13:35:36 -05:00
Isaac Connor
6156aa2af9 Merge branch 'storageareas' of github.com:/ConnorTechnology/ZoneMinder into storageareas 2019-02-15 10:49:06 -05:00
Isaac Connor
31a11a6992 init log earlier in zms 2019-02-13 11:34:47 -05:00
Steve Gilvarry
924d5235d0 Validate zmu Username and Password lengths (#2484)
* Validate zmu Username and Password lengths
Ensure user provided values are not larger than allowed and error if
they are, therefore further preventing overflow.

* Check username and password functions for zmu and zms

* Check username and password functions for zmu and zms
2019-02-13 10:40:43 -05:00
Isaac Connor
fe444218cc Implement replay mode = none in zms. This mode was only handled for video html tag viewing. 2018-09-28 12:31:53 -04:00