1 |
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 |
2 |
--- e-smith-base-5.8.1.old/root/etc/e-smith/events/actions/user-rsshd 2021-06-06 16:30:37.000000000 -0400 |
3 |
+++ e-smith-base-5.8.1/root/etc/e-smith/events/actions/user-rsshd 2022-04-17 23:15:31.401000000 -0400 |
4 |
@@ -13,6 +13,13 @@ |
5 |
my $conf = esmith::ConfigDB->open_ro; |
6 |
my $accounts = esmith::AccountsDB->open; |
7 |
|
8 |
+my $ldapauth = $conf->get('ldap')->prop('Authentication') || 'disabled'; |
9 |
+my $x = 0; # exit value |
10 |
+ |
11 |
+my $groupName = 'rsshusers'; |
12 |
+my $gid = getgrnam($groupName); |
13 |
+my $tmpattr = File::Temp->new(); |
14 |
+ |
15 |
my $event = $ARGV[0]; |
16 |
my $userName = $ARGV[1]; |
17 |
# finallement get all user |
18 |
@@ -35,8 +42,16 @@ |
19 |
next; |
20 |
} |
21 |
# next if the user is already there |
22 |
+ print $tmpattr "memberUid: $cuser\n"; |
23 |
next if ( "$cuser" ~~ @currents ) ; |
24 |
print "Adding user $cuser to group rsshusers"; |
25 |
system("/usr/sbin/usermod", "-a", "-G", "rsshusers", $cuser); |
26 |
|
27 |
} |
28 |
+ |
29 |
+# add all users to rsshusers |
30 |
+system("/usr/sbin/cpu", "-C/etc/cpu-system.conf", "groupmod", "-a", "$tmpattr", "$groupName") == 0 |
31 |
+or |
32 |
+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" ); |
33 |
+ |
34 |
+exit ($x); |