##// END OF EJS Templates
ssh: generate tmp rename file in tmp dir rather then location of file....
super-admin -
r4838:b8bab954 default
parent child Browse files
Show More
@@ -49,11 +49,12 b' def get_all_active_keys():'
49
49
50 def _generate_ssh_authorized_keys_file(
50 def _generate_ssh_authorized_keys_file(
51 authorized_keys_file_path, ssh_wrapper_cmd, allow_shell, ssh_opts, debug):
51 authorized_keys_file_path, ssh_wrapper_cmd, allow_shell, ssh_opts, debug):
52 import rhodecode
52
53
53 authorized_keys_file_path = os.path.abspath(
54 authorized_keys_file_path = os.path.abspath(
54 os.path.expanduser(authorized_keys_file_path))
55 os.path.expanduser(authorized_keys_file_path))
56 tmp_file_dir = tempfile.gettempdir()
55
57
56 import rhodecode
57 all_active_keys = get_all_active_keys()
58 all_active_keys = get_all_active_keys()
58
59
59 if allow_shell:
60 if allow_shell:
@@ -73,8 +74,8 b' def _generate_ssh_authorized_keys_file('
73 line_tmpl = '{ssh_opts},command="{wrapper_command} {ini_path} --user-id={user_id} --user={user} --key-id={user_key_id}" {key}\n'
74 line_tmpl = '{ssh_opts},command="{wrapper_command} {ini_path} --user-id={user_id} --user={user} --key-id={user_key_id}" {key}\n'
74
75
75 fd, tmp_authorized_keys = tempfile.mkstemp(
76 fd, tmp_authorized_keys = tempfile.mkstemp(
76 '.authorized_keys_write',
77 '.authorized_keys_write_operation',
77 dir=os.path.dirname(authorized_keys_file_path))
78 dir=tmp_file_dir)
78
79
79 now = datetime.datetime.utcnow().isoformat()
80 now = datetime.datetime.utcnow().isoformat()
80 keys_file = os.fdopen(fd, 'wb')
81 keys_file = os.fdopen(fd, 'wb')
General Comments 0
You need to be logged in to leave comments. Login now