From 887989b63b9baaa8817183af6becbd1322cd5d7e Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Sat, 20 Feb 2016 18:27:57 +0200 Subject: [PATCH] smbctl: try more security methods when mounting a share --- motioneye/handlers.py | 3 +++ motioneye/smbctl.py | 11 ++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/motioneye/handlers.py b/motioneye/handlers.py index d3763cd..5384a9f 100644 --- a/motioneye/handlers.py +++ b/motioneye/handlers.py @@ -863,6 +863,9 @@ class PictureHandler(BaseHandler): elif utils.remote_camera(camera_config): def on_response(motion_detected=False, fps=None, picture=None, error=None): + if error: + return self.try_finish(None) + self.set_cookie('motion_detected_' + str(camera_id), str(motion_detected).lower()) self.set_cookie('capture_fps_' + str(camera_id), '%.1f' % fps) self.try_finish(picture) diff --git a/motioneye/smbctl.py b/motioneye/smbctl.py index 75f1aa7..201c1da 100644 --- a/motioneye/smbctl.py +++ b/motioneye/smbctl.py @@ -149,14 +149,19 @@ def _mount(server, share, username, password): if username: opts = 'username=%s,password=%s' % (username, password) - sec_types = ['ntlm', 'ntlmv2', 'none'] + sec_types = [None, 'ntlm', 'ntlmv2', 'ntlmv2i', 'ntlmsspi', 'none'] else: opts = 'guest' - sec_types = ['none', 'ntlm', 'ntlmv2'] + sec_types = [None, 'none', 'ntlm', 'ntlmv2', 'ntlmv2i', 'ntlmsspi'] for sec in sec_types: - actual_opts = opts + ',sec=' + sec + if sec: + actual_opts = opts + ',sec=' + sec + + else: + actual_opts = opts + try: logging.debug('mounting "//%s/%s" at "%s" (sec=%s)' % (server, share, mount_point, sec)) subprocess.check_call('mount.cifs "//%s/%s" "%s" -o "%s"' % (server, share, mount_point, actual_opts), shell=True) -- 2.39.5