Giter Club home page Giter Club logo

Comments (13)

connortechnology avatar connortechnology commented on May 23, 2024 2

I am re-opening, because I have been seeing this on my pi as well. There is some difference in the hashing algorithms.

from zoneminder.

kylejohnson avatar kylejohnson commented on May 23, 2024

Well, this is annoying. I can reproduce this on ubuntu 12.04.3. Backtrace & memory map:

[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] *** stack smashing detected ***: /usr/lib/cgi-bin/nph-zms terminated
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] ======= Backtrace: =========
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] /lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x37)[0x7f4a50cb2817]
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] /lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x0)[0x7f4a50cb27e0]
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] /usr/lib/cgi-bin/nph-zms[0x4730fa]
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] /usr/lib/cgi-bin/nph-zms[0x40701f]
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7f4a50bc976d]
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] /usr/lib/cgi-bin/nph-zms[0x4063e9]
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] ======= Memory map: ========
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 00400000-0049f000 r-xp 00000000 08:01 135351                             /usr/lib/cgi-bin/nph-zms
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 0069e000-0069f000 r--p 0009e000 08:01 135351                             /usr/lib/cgi-bin/nph-zms
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 0069f000-006a1000 rw-p 0009f000 08:01 135351                             /usr/lib/cgi-bin/nph-zms
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 006a1000-05acb000 rw-p 00000000 00:00 0
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 06bb5000-06bf8000 rw-p 00000000 00:00 0                                  [heap]
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a48000000-7f4a48021000 rw-p 00000000 00:00 0
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a48021000-7f4a4c000000 ---p 00000000 00:00 0
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a4fd86000-7f4a4fd92000 r-xp 00000000 08:01 143994                     /lib/x86_64-linux-gnu/libnss_files-2.15.so
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a4fd92000-7f4a4ff91000 ---p 0000c000 08:01 143994                     /lib/x86_64-linux-gnu/libnss_files-2.15.so
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a4ff91000-7f4a4ff92000 r--p 0000b000 08:01 143994                     /lib/x86_64-linux-gnu/libnss_files-2.15.so
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a4ff92000-7f4a4ff93000 rw-p 0000c000 08:01 143994                     /lib/x86_64-linux-gnu/libnss_files-2.15.so
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a4ff93000-7f4a4ff94000 ---p 00000000 00:00 0
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a4ff94000-7f4a50794000 rw-p 00000000 00:00 0
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a50794000-7f4a50796000 r-xp 00000000 08:01 140162                     /lib/x86_64-linux-gnu/libdl-2.15.so
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a50796000-7f4a50996000 ---p 00002000 08:01 140162                     /lib/x86_64-linux-gnu/libdl-2.15.so
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a50996000-7f4a50997000 r--p 00002000 08:01 140162                     /lib/x86_64-linux-gnu/libdl-2.15.so
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a50997000-7f4a50998000 rw-p 00003000 08:01 140162                     /lib/x86_64-linux-gnu/libdl-2.15.so
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a50998000-7f4a509a7000 r-xp 00000000 08:01 131291                     /lib/x86_64-linux-gnu/libbz2.so.1.0.4
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a509a7000-7f4a50ba6000 ---p 0000f000 08:01 131291                     /lib/x86_64-linux-gnu/libbz2.so.1.0.4
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a50ba6000-7f4a50ba7000 r--p 0000e000 08:01 131291                     /lib/x86_64-linux-gnu/libbz2.so.1.0.4
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a50ba7000-7f4a50ba8000 rw-p 0000f000 08:01 131291                     /lib/x86_64-linux-gnu/libbz2.so.1.0.4
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a50ba8000-7f4a50d5d000 r-xp 00000000 08:01 143983                     /lib/x86_64-linux-gnu/libc-2.15.so
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a50d5d000-7f4a50f5c000 ---p 001b5000 08:01 143983                     /lib/x86_64-linux-gnu/libc-2.15.so
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a50f5c000-7f4a50f60000 r--p 001b4000 08:01 143983                     /lib/x86_64-linux-gnu/libc-2.15.so
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a50f60000-7f4a50f62000 rw-p 001b8000 08:01 143983                     /lib/x86_64-linux-gnu/libc-2.15.so
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a50f62000-7f4a50f67000 rw-p 00000000 00:00 0
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a50f67000-7f4a50f7c000 r-xp 00000000 08:01 131849                     /lib/x86_64-linux-gnu/libgcc_s.so.1
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a50f7c000-7f4a5117b000 ---p 00015000 08:01 131849                     /lib/x86_64-linux-gnu/libgcc_s.so.1
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a5117b000-7f4a5117c000 r--p 00014000 08:01 131849                     /lib/x86_64-linux-gnu/libgcc_s.so.1
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a5117c000-7f4a5117d000 rw-p 00015000 08:01 131849                     /lib/x86_64-linux-gnu/libgcc_s.so.1
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a5117d000-7f4a51278000 r-xp 00000000 08:01 143992                     /lib/x86_64-linux-gnu/libm-2.15.so
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a51278000-7f4a51477000 ---p 000fb000 08:01 143992                     /lib/x86_64-linux-gnu/libm-2.15.so
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a51477000-7f4a51478000 r--p 000fa000 08:01 143992                     /lib/x86_64-linux-gnu/libm-2.15.so
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a51478000-7f4a51479000 rw-p 000fb000 08:01 143992                     /lib/x86_64-linux-gnu/libm-2.15.so
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a51479000-7f4a5155b000 r-xp 00000000 08:01 137191                     /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a5155b000-7f4a5175a000 ---p 000e2000 08:01 137191                     /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a5175a000-7f4a51762000 r--p 000e1000 08:01 137191                     /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a51762000-7f4a51764000 rw-p 000e9000 08:01 137191                     /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.16
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a51764000-7f4a51779000 rw-p 00000000 00:00 0
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a51779000-7f4a51a37000 r-xp 00000000 08:01 198723                     /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18.0.0
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a51a37000-7f4a51c36000 ---p 002be000 08:01 198723                     /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18.0.0
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a51c36000-7f4a51c3c000 r--p 002bd000 08:01 198723                     /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18.0.0
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a51c3c000-7f4a51cba000 rw-p 002c3000 08:01 198723                     /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18.0.0
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a51cba000-7f4a51cbf000 rw-p 00000000 00:00 0
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a51cbf000-7f4a51cfd000 r-xp 00000000 08:01 200008                     /usr/lib/x86_64-linux-gnu/libjpeg.so.8.0.2
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a51cfd000-7f4a51efd000 ---p 0003e000 08:01 200008                     /usr/lib/x86_64-linux-gnu/libjpeg.so.8.0.2
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a51efd000-7f4a51efe000 r--p 0003e000 08:01 200008                     /usr/lib/x86_64-linux-gnu/libjpeg.so.8.0.2
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a51efe000-7f4a51eff000 rw-p 0003f000 08:01 200008                     /usr/lib/x86_64-linux-gnu/libjpeg.so.8.0.2
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a51eff000-7f4a51f0f000 rw-p 00000000 00:00 0
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a51f0f000-7f4a51f27000 r-xp 00000000 08:01 143986                     /lib/x86_64-linux-gnu/libpthread-2.15.so
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a51f27000-7f4a52126000 ---p 00018000 08:01 143986                     /lib/x86_64-linux-gnu/libpthread-2.15.so
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a52126000-7f4a52127000 r--p 00017000 08:01 143986                     /lib/x86_64-linux-gnu/libpthread-2.15.so
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a52127000-7f4a52128000 rw-p 00018000 08:01 143986                     /lib/x86_64-linux-gnu/libpthread-2.15.so
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a52128000-7f4a5212c000 rw-p 00000000 00:00 0
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a5212c000-7f4a522dd000 r-xp 00000000 08:01 133345                     /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a522dd000-7f4a524dd000 ---p 001b1000 08:01 133345                     /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a524dd000-7f4a524f8000 r--p 001b1000 08:01 133345                     /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a524f8000-7f4a52503000 rw-p 001cc000 08:01 133345                     /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a52503000-7f4a52507000 rw-p 00000000 00:00 0
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a52507000-7f4a52543000 r-xp 00000000 08:01 132983                     /lib/x86_64-linux-gnu/libpcre.so.3.12.1
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a52543000-7f4a52742000 ---p 0003c000 08:01 132983                     /lib/x86_64-linux-gnu/libpcre.so.3.12.1
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a52742000-7f4a52743000 r--p 0003b000 08:01 132983                     /lib/x86_64-linux-gnu/libpcre.so.3.12.1
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a52743000-7f4a52744000 rw-p 0003c000 08:01 132983                     /lib/x86_64-linux-gnu/libpcre.so.3.12.1
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a52744000-7f4a5276b000 r-xp 00000000 08:01 201307                     /usr/local/lib/libavutil.so.52.12.100
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a5276b000-7f4a5296a000 ---p 00027000 08:01 201307                     /usr/local/lib/libavutil.so.52.12.100
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a5296a000-7f4a5296f000 r--p 00026000 08:01 201307                     /usr/local/lib/libavutil.so.52.12.100
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a5296f000-7f4a52970000 rw-p 0002b000 08:01 201307                     /usr/local/lib/libavutil.so.52.12.100
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a52970000-7f4a52974000 rw-p 00000000 00:00 0
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a52974000-7f4a5308e000 r-xp 00000000 08:01 201291                     /usr/local/lib/libavcodec.so.54.81.100
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a5308e000-7f4a5328d000 ---p 0071a000 08:01 201291                     /usr/local/lib/libavcodec.so.54.81.100
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a5328d000-7f4a532aa000 r--p 00719000 08:01 201291                     /usr/local/lib/libavcodec.so.54.81.100
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a532aa000-7f4a532c5000 rw-p 00736000 08:01 201291                     /usr/local/lib/libavcodec.so.54.81.100
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a532c5000-7f4a5383f000 rw-p 00000000 00:00 0
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a5383f000-7f4a53979000 r-xp 00000000 08:01 201287                     /usr/local/lib/libavformat.so.54.49.102
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a53979000-7f4a53b78000 ---p 0013a000 08:01 201287                     /usr/local/lib/libavformat.so.54.49.102
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a53b78000-7f4a53b84000 r--p 00139000 08:01 201287                     /usr/local/lib/libavformat.so.54.49.102
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a53b84000-7f4a53b93000 rw-p 00145000 08:01 201287                     /usr/local/lib/libavformat.so.54.49.102
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a53b93000-7f4a53be0000 r-xp 00000000 08:01 201303                     /usr/local/lib/libswscale.so.2.1.103
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a53be0000-7f4a53ddf000 ---p 0004d000 08:01 201303                     /usr/local/lib/libswscale.so.2.1.103
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a53ddf000-7f4a53de1000 r--p 0004c000 08:01 201303                     /usr/local/lib/libswscale.so.2.1.103
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a53de1000-7f4a53de2000 rw-p 0004e000 08:01 201303                     /usr/local/lib/libswscale.so.2.1.103
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a53de2000-7f4a53df8000 r-xp 00000000 08:01 136195                     /lib/x86_64-linux-gnu/libz.so.1.2.3.4
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a53df8000-7f4a53ff7000 ---p 00016000 08:01 136195                     /lib/x86_64-linux-gnu/libz.so.1.2.3.4
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a53ff7000-7f4a53ff8000 r--p 00015000 08:01 136195                     /lib/x86_64-linux-gnu/libz.so.1.2.3.4
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a53ff8000-7f4a53ff9000 rw-p 00016000 08:01 136195                     /lib/x86_64-linux-gnu/libz.so.1.2.3.4
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a53ff9000-7f4a5401b000 r-xp 00000000 08:01 143998                     /lib/x86_64-linux-gnu/ld-2.15.so
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a54208000-7f4a54212000 rw-p 00000000 00:00 0
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a54217000-7f4a5421b000 rw-p 00000000 00:00 0
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a5421b000-7f4a5421c000 r--p 00022000 08:01 143998                     /lib/x86_64-linux-gnu/ld-2.15.so
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7f4a5421c000-7f4a5421e000 rw-p 00023000 08:01 143998                     /lib/x86_64-linux-gnu/ld-2.15.so
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7fff02579000-7fff0259a000 rw-p 00000000 00:00 0                          [stack]
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] 7fff025ff000-7fff02600000 r-xp 00000000 00:00 0                          [vdso]
[Sun Aug 25 19:13:27 2013] [error] [client 192.168.11.128] ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]

from zoneminder.

knight-of-ni avatar knight-of-ni commented on May 23, 2024

The patch below from our friends at Red Hat may address the issue. Looks someone thought Zoneminder should use libgcrypt instead of openssl or gnutls.

This patch will need slight modification to work with the current 1.26 source tree. I'll create a new branch and try it next time I have a moment. I'm at work now (Internet break).

Reference link:
https://lists.fedoraproject.org/pipermail/scm-commits/2011-August/652966.html

diff -up ./configure.ac.gcrypt ./configure.ac
--- ./configure.ac.gcrypt   2012-01-19 12:58:20.647123209 -0600
+++ ./configure.ac  2012-01-19 13:12:34.186669577 -0600
@@ -13,7 +13,7 @@ AC_ARG_VAR(ZM_DB_HOST,[Hostname where Zo
 AC_ARG_VAR(ZM_DB_NAME,[Name of ZoneMinder database, default zm])
 AC_ARG_VAR(ZM_DB_USER,[Name of ZoneMinder database user, default zmuser])
 AC_ARG_VAR(ZM_DB_PASS,[Password of ZoneMinder database user, default zmpass])
-AC_ARG_VAR(ZM_SSL_LIB,[Library to use for ssl functions, default gnutls])
+AC_ARG_VAR(ZM_SSL_LIB,[Library to use for MD5 function, default libgcrypt])
 AC_ARG_VAR(ZM_MYSQL_ENGINE,[MySQL engine to use with database, default MyISAM])
 AC_ARG_VAR(ZM_RUNDIR,[Location of transient process files, default /var/run/zm])
 AC_ARG_VAR(ZM_TMPDIR,[Location of temporary files, default /tmp/zm])
@@ -32,7 +32,7 @@ if test "$ZM_DB_PASS" == ""; then
    AC_SUBST(ZM_DB_PASS,[zmpass])
 fi
 if test "$ZM_SSL_LIB" == ""; then
-   AC_SUBST(ZM_SSL_LIB,gnutls)
+   AC_SUBST(ZM_SSL_LIB,libgcrypt)
 fi
 if test "$ZM_MYSQL_ENGINE" == ""; then
    AC_SUBST(ZM_MYSQL_ENGINE,MyISAM)
@@ -264,11 +264,10 @@ AC_CHECK_LIB(jpeg,jpeg_start_compress,,A
 AC_CHECK_LIB(pthread,pthread_create,,AC_MSG_ERROR(zm requires libpthread.a))
 AC_CHECK_LIB(dl,dlsym,,AC_MSG_ERROR(zm requires libdl.a))
 if test "$ZM_SSL_LIB" == "openssl"; then
-AC_CHECK_LIB(crypto,MD5,,AC_MSG_WARN([libcrypto.a is required for authenticated streaming - use ZM_SSL_LIB option to select gnutls instead]))
+AC_CHECK_LIB(crypto,MD5,,AC_MSG_WARN([libcrypto.a is required for authenticated streaming - use ZM_SSL_LIB option to select libgcrypt instead]))
 else
-AC_CHECK_HEADERS(gcrypt.h,,AC_MSG_WARN(zm requires libgcrypt headers to be installed for gnutls),)
+AC_CHECK_HEADERS(gcrypt.h,,AC_MSG_WARN(zm requires libgcrypt headers to be installed),)
 AC_CHECK_LIB(gcrypt,gcry_check_version,,AC_MSG_WARN([libgcrypt.a is required for authenticated streaming - use ZM_SSL_LIB option to select openssl instead]))
-AC_CHECK_LIB(gnutls-openssl,MD5,,AC_MSG_WARN([gnutls-openssl.a is required for authenticated streaming - use ZM_SSL_LIB option to select openssl instead]))
 fi
 AC_CHECK_LIB(pcre,pcre_compile,,AC_MSG_WARN(libpcre.a may be required for remote/network camera support))
 AC_CHECK_LIB(z,zlibVersion)
@@ -320,9 +319,6 @@ AC_CHECK_DECLS(round,,,[#include <math.h
 if test "$ZM_SSL_LIB" == "openssl"; then
 AC_CHECK_DECLS(MD5,,AC_MSG_ERROR([zm requires openssl/md5.h - use ZM_SSL_LIB option to select gnutls instead]),[#include <stdlib.h>
 #include <openssl/md5.h>])
-else
-AC_CHECK_DECLS(MD5,,AC_MSG_ERROR([zm requires gnutls/openssl.h - use ZM_SSL_LIB option to select openssl instead]),[#include <stdlib.h>
-#include <gnutls/openssl.h>])
 fi
 AC_CHECK_DECLS(backtrace,,,[#include <execinfo.h>])

diff -up ./src/zm_user.cpp.gcrypt ./src/zm_user.cpp
--- ./src/zm_user.cpp.gcrypt    2011-08-03 06:31:06.000000000 -0500
+++ ./src/zm_user.cpp   2012-01-19 12:58:20.654122992 -0600
@@ -140,6 +140,18 @@ User *zmLoadUser( const char *username, 
    return( user );
 }

+#ifdef HAVE_GCRYPT_H
+#define HAVE_DECL_MD5 1
+#define MD5_DIGEST_LENGTH 16
+static unsigned char *MD5(const unsigned char *data, unsigned long len,
+                         unsigned char *md)
+{
+    gcry_md_hash_buffer(GCRY_MD_MD5, md, data, len);
+
+    return md;
+}
+#endif
+
 // Function to validate an authentication string
 User *zmLoadAuthUser( const char *auth, bool use_remote_addr )
 {
diff -up ./src/zm_user.h.gcrypt ./src/zm_user.h
--- ./src/zm_user.h.gcrypt  2010-11-11 06:11:07.000000000 -0600
+++ ./src/zm_user.h 2012-01-19 13:14:11.200654694 -0600
@@ -23,14 +23,11 @@
 #ifndef ZM_USER_H
 #define ZM_USER_H

-#if HAVE_LIBGNUTLS_OPENSSL
-#include <gnutls/openssl.h>
 #if HAVE_GCRYPT_H
 #include <gcrypt.h>
-#endif // HAVE_GCRYPT_H
 #elif HAVE_LIBCRYPTO
 #include <openssl/md5.h>
-#endif // HAVE_LIBGNUTLS_OPENSSL || HAVE_LIBCRYPTO
+#endif // HAVE_GCRYPT_H || HAVE_LIBCRYPTO

 class User
 {

from zoneminder.

kylejohnson avatar kylejohnson commented on May 23, 2024

Fantastic :)

from zoneminder.

knight-of-ni avatar knight-of-ni commented on May 23, 2024

Well I got the patch to compile cleanly, but it did not resolve the issue. However, it did help me identify where exactly things were going wrong. zm_user.cpp was the culprit. I noticed that auth_md5 was exactly twice as big as it was supposed to be.

Changed line 199 from:
size_t md5len = 32;
to:
size_t md5len = 16;

and this seemed to resolve the issue on my centos vm.

I want to do some additional test (test on ubuntu for one) tomorrow and then I'll submit a pull request.

from zoneminder.

kylejohnson avatar kylejohnson commented on May 23, 2024

I've verified that commit 4e9698a has fixed this issue on Ubuntu 13.04.

from zoneminder.

george-viaud avatar george-viaud commented on May 23, 2024

I'm still able to replicate these conditions / failure mode in Debian variant Raspbian running 1.29.0 fresh install - I'm not sure if the cause is the same but the workaround is.

from zoneminder.

connortechnology avatar connortechnology commented on May 23, 2024

@george-viaud Can you be clearer which workaround? The change to md5len?

from zoneminder.

george-viaud avatar george-viaud commented on May 23, 2024

@connortechnology

Sorry about the ambiguity.

I disabled the hash options in the configuration and the problem ceased - (I think this has the end effect of going around the hashing code all-together).

from zoneminder.

george-viaud avatar george-viaud commented on May 23, 2024

Playing with this again today. Observation:

Browsing to /zm/cgi-bin/zms while hash is enabled results in a Internal Server Error and the following in the apache2 error.log file:

[cgi:error] [pid 1722] [client x.x.x.x:xxxxxx] End of script output before headers: zms

from zoneminder.

knight-of-ni avatar knight-of-ni commented on May 23, 2024

I'm closing this again as this thread has gone stale.
I haven't seen this on my pi's, but if someone still has this issue and has new, relevant data then please create a new issue.

from zoneminder.

jeroenst avatar jeroenst commented on May 23, 2024

Playing with this again today. Observation:

Browsing to /zm/cgi-bin/zms while hash is enabled results in a Internal Server Error and the following in the apache2 error.log file:

[cgi:error] [pid 1722] [client x.x.x.x:xxxxxx] End of script output before headers: zms

I also experience this error when hash is enabled in zoneminder 1.34.16, when AUTH_RELAY is none, zms works fine.

from zoneminder.

connortechnology avatar connortechnology commented on May 23, 2024

Probably your timezones are incorrectly set (this is the #1 reason why this fails.) Go actually look in your logs. Turn on debug. Look again.

from zoneminder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.