Merge branch 'master' into 7200-keepproxy-index-api
[arvados.git] / services / login-sync / bin / arvados-login-sync
index 2e407d808f143bcc64f8964b0ac09a47237a92d1..c92fc9b00dd0cc723e4fd64bd2b001daa8bce60c 100755 (executable)
@@ -25,11 +25,7 @@ begin
 
   vm_uuid = ENV['ARVADOS_VIRTUAL_MACHINE_UUID']
 
-  begin
-    logins = arv.virtual_machine.get_all_logins(limit: 10000, uuid: vm_uuid)[:items]
-  rescue
-    logins = arv.virtual_machine.logins(:uuid => vm_uuid)[:items]
-  end
+  logins = arv.virtual_machine.logins(:uuid => vm_uuid)[:items]
   logins = [] if logins.nil?
   logins = logins.reject { |l| l[:username].nil? or l[:hostname].nil? or l[:public_key].nil? or l[:virtual_machine_uuid] != vm_uuid }
 
@@ -104,6 +100,7 @@ begin
     FileUtils.chown_R(l[:username], l[:username], userdotssh)
     File.chmod(0700, userdotssh)
     File.chmod(0750, @homedir)
+    File.chmod(0600, userauthkeys)
   end
 
   devnull.close