20643: Skip (with a log error) users that don't have their HOME dirs created.
authorLucas Di Pentima <lucas.dipentima@curii.com>
Wed, 14 Jun 2023 15:07:44 +0000 (12:07 -0300)
committerLucas Di Pentima <lucas.dipentima@curii.com>
Wed, 14 Jun 2023 15:07:44 +0000 (12:07 -0300)
Some systems may be able to resolve users from centralized services, but
need additional steps to allow them to log into the shell node. We then
expect that allowed users should already have their HOME directories created
before doing any syncing.

Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima@curii.com>

services/login-sync/bin/arvados-login-sync

index 915541baf5009df2a7d290b0f47654e3d1c256ae..b663672248fca338a2ac06c56c82f761a038d5e9 100755 (executable)
@@ -176,6 +176,10 @@ begin
     end
 
     homedir = pwnam[l[:username]].dir
+    if !File.exist?(homedir)
+      STDERR.puts "Home directory #{homedir} from user #{username} doesn't exist. Skipping."
+      next
+    end
     userdotssh = File.join(homedir, ".ssh")
     Dir.mkdir(userdotssh) if !File.exist?(userdotssh)