Commit Graph

137 Commits

Author SHA1 Message Date
Isaac Connor
7ae9bebea4 Add analysis boolean query param 2022-01-07 12:40:21 -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
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
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
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
Isaac Connor
dd479c9e55 remove () around return 2018-07-04 14:50:47 -04:00
Isaac Connor
87d9fc447e google code style 2018-06-01 11:27:53 -04:00
Andy Bauer
678503b992 fix ftbs on el7 2018-04-24 12:16:19 -05:00
Isaac Connor
e56cf0b31c switch to uint64_t for event_id because long long can actually be 128 bit 2018-04-17 13:57:19 -04:00
Isaac Connor
f9f78e9aa3 Convert event_id to a 64bit unsigned int 2018-04-12 13:40:11 -07:00
Isaac Connor
47ec0abf11 spacing 2018-03-02 18:27:03 -08:00
Isaac Connor
ef72e585b9 Include id in the user object 2018-02-13 05:28:00 -05:00
Isaac Connor
70d43d2d27 fix strncpy calls 2017-12-12 13:42:48 -05:00
Isaac Connor
752990bb0f improve zms logging 2017-11-21 23:55:53 -05:00
Isaac Connor
48e9e12063 assume source=monitor when a monitor_id is specified 2017-08-24 10:13:46 -04:00
Isaac Connor
a81ff85fbb add ffmpeg decoding of a .mp4 to get the frames 2017-08-23 15:05:44 -04:00