diff -Nur --no-dereference e-smith-base-5.8.1.old/root/etc/e-smith/events/actions/user-rsshd e-smith-base-5.8.1/root/etc/e-smith/events/actions/user-rsshd --- e-smith-base-5.8.1.old/root/etc/e-smith/events/actions/user-rsshd 2021-06-06 16:30:37.000000000 -0400 +++ e-smith-base-5.8.1/root/etc/e-smith/events/actions/user-rsshd 2022-04-17 23:15:31.401000000 -0400 @@ -13,6 +13,13 @@ my $conf = esmith::ConfigDB->open_ro; my $accounts = esmith::AccountsDB->open; +my $ldapauth = $conf->get('ldap')->prop('Authentication') || 'disabled'; +my $x = 0; # exit value + +my $groupName = 'rsshusers'; +my $gid = getgrnam($groupName); +my $tmpattr = File::Temp->new(); + my $event = $ARGV[0]; my $userName = $ARGV[1]; # finallement get all user @@ -35,8 +42,16 @@ next; } # next if the user is already there + print $tmpattr "memberUid: $cuser\n"; next if ( "$cuser" ~~ @currents ) ; print "Adding user $cuser to group rsshusers"; system("/usr/sbin/usermod", "-a", "-G", "rsshusers", $cuser); } + +# add all users to rsshusers +system("/usr/sbin/cpu", "-C/etc/cpu-system.conf", "groupmod", "-a", "$tmpattr", "$groupName") == 0 +or +system( "/usr/sbin/cpu", "groupadd", "-g", $gid, "-a", "$tmpattr", $groupName ) == 0 or ( $x = $ldapauth ne 'enabled' ? $x : 255 , warn "Failed to create (ldap) group $groupName.\n" ); + +exit ($x);