]> www.vanbest.org Git - motioneye-debian/commitdiff
smbctl: try more security methods when mounting a share
authorCalin Crisan <ccrisan@gmail.com>
Sat, 20 Feb 2016 16:27:57 +0000 (18:27 +0200)
committerCalin Crisan <ccrisan@gmail.com>
Sat, 20 Feb 2016 16:27:57 +0000 (18:27 +0200)
motioneye/handlers.py
motioneye/smbctl.py

index d3763cdaab4dc7a986512f700a063269a79ab26c..5384a9ff166f30e357c2374df42fbebe73bc9f6d 100644 (file)
@@ -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)
index 75f1aa75edc354be559d2910937bbc2285fdbb57..201c1da11976db81e9f975886da0bb8ade4f1a06 100644 (file)
@@ -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)