]> git.sesse.net Git - itkacl/commitdiff
uids from enumeration may be stale, so double-check them.
authorSteinar H. Gunderson <sesse@samfundet.no>
Tue, 20 Aug 2024 18:22:30 +0000 (20:22 +0200)
committerSteinar H. Gunderson <sesse@samfundet.no>
Tue, 20 Aug 2024 18:22:30 +0000 (20:22 +0200)
itkacl-2.2/sync-itkacl.pl

index bafaede4b2fec8adf79d88e589b8289f4fbf4c40..f0c92bc83c008142ec7e831d13dd9df847d7afcc 100755 (executable)
@@ -36,6 +36,9 @@ while (my ($name,$passwd,$uid,$gid,$quota,$comment,$gcos,$dir,$shell,$expire) =
        # No Samba machine accounts
        next if $name =~ /\$$/;
 
+       # Filter stale uids left in e.g. sssd cache.
+       next if !defined(getpwnam($name));
+
        # Initially, nobody has access.
        $access{$name} = 0;