From 9a56b9e87be730bf5350e05724989371e83a7f5f Mon Sep 17 00:00:00 2001 From: Jean-Philippe Pialasse Date: Thu, 14 Mar 2024 16:00:28 -0400 Subject: [PATCH] rssh --- createlinks | 6 -- .../e-smith/events/actions/user-create-unix | 2 +- .../e-smith/events/actions/user-group-modify | 2 +- .../e-smith/events/actions/user-modify-unix | 4 +- root/etc/e-smith/events/actions/user-rsshd | 57 ------------------- .../e-smith/templates/etc/cpu.conf/40shell | 2 +- root/etc/e-smith/templates/etc/shells/rssh | 1 - smeserver-base.spec | 6 +- 8 files changed, 9 insertions(+), 71 deletions(-) delete mode 100644 root/etc/e-smith/events/actions/user-rsshd delete mode 100644 root/etc/e-smith/templates/etc/shells/rssh diff --git a/createlinks b/createlinks index 3321a78..2e41b63 100755 --- a/createlinks +++ b/createlinks @@ -315,7 +315,6 @@ event_link("rmmod-bonding", $event, "10"); event_link("conf-startup", $event, "10"); event_link("user-lock-passwd", $event, "15"); event_link("group-modify-unix", $event, "15"); -event_link("user-rsshd", $event, "16"); event_link("update-passwd", $event, "20"); event_link("count-active-user-accounts", $event, "25"); event_link("conf-modules", $event, "30"); @@ -343,7 +342,6 @@ templates2events("/etc/smartmontools/smartd.conf", $event); templates2events("/home/e-smith/ssl.pem/pem", $event); templates2events("/usr/lib/systemd/system/dhcpd.service.d/50koozali.conf", $event); event_link("set-hostname", $event, "10"); -event_link("user-rsshd", $event, "16"); event_link("conf-modules", $event, "30"); event_link("conf-startup", $event, "60"); event_link("systemd-default", $event, "88"); @@ -454,7 +452,6 @@ event_link("init-accounts", $event, "05"); event_link("rotate_logfiles", $event, "07"); event_link("init-passwords", $event, "10"); event_link("conf-startup", $event, "10"); -event_link("user-rsshd", $event, "16"); event_link("conf-modules", $event, "30"); event_link("create-mnt-floppy", $event, "50"); event_link("systemd-default", $event, "88"); @@ -476,7 +473,6 @@ event_link("rotate_logfiles", $event, "07"); event_link("conf-startup", $event, "10"); event_link("user-lock-passwd", $event, "15"); event_link("group-modify-unix", $event, "15"); -event_link("user-rsshd", $event, "16"); event_link("update-passwd", $event, "20"); event_link("count-active-user-accounts", $event, "25"); event_link("conf-modules", $event, "30"); @@ -513,7 +509,6 @@ event_link("systemd-reload", $event, "89"); $event = "user-create"; event_link("user-create-unix", $event, "04"); -event_link("user-rsshd", $event, "16"); event_link("count-active-user-accounts", $event, "25"); event_link("user-group-modify", $event, "85"); @@ -535,7 +530,6 @@ event_link("count-active-user-accounts", $event, "25"); $event = "user-modify"; event_link("user-modify-unix", $event, "15"); -event_link("user-rsshd", $event, "16"); event_link("user-group-modify", $event, "85"); $event = "user-modify-admin"; diff --git a/root/etc/e-smith/events/actions/user-create-unix b/root/etc/e-smith/events/actions/user-create-unix index 71bc791..5f9c33d 100755 --- a/root/etc/e-smith/events/actions/user-create-unix +++ b/root/etc/e-smith/events/actions/user-create-unix @@ -72,7 +72,7 @@ my $company = $acct->prop('Company') || ''; my $dept = $acct->prop('Dept') || ''; my $city = $acct->prop('City') || ''; my $street = $acct->prop('Street') || ''; -my $shell = $acct->prop('Shell') || '/usr/bin/rssh'; +my $shell = $acct->prop('Shell') || '/usr/bin/false'; my $groups = "shared"; if ($ldapauth ne 'enabled') diff --git a/root/etc/e-smith/events/actions/user-group-modify b/root/etc/e-smith/events/actions/user-group-modify index 159d9d3..531c69d 100755 --- a/root/etc/e-smith/events/actions/user-group-modify +++ b/root/etc/e-smith/events/actions/user-group-modify @@ -39,7 +39,7 @@ my ($user, $colon, @old_groups) = split(' ', `/usr/bin/groups $userName`); # actions for all these groups my %modified_groups = map { $_, 1 } @old_groups, $acctdb->user_group_list($userName); # but omit "shared" and user private group -foreach ('shared', $userName, 'rsshusers') +foreach ('shared', $userName) { delete $modified_groups{$_} if exists $modified_groups{$_}; } diff --git a/root/etc/e-smith/events/actions/user-modify-unix b/root/etc/e-smith/events/actions/user-modify-unix index 5b96077..420a909 100755 --- a/root/etc/e-smith/events/actions/user-modify-unix +++ b/root/etc/e-smith/events/actions/user-modify-unix @@ -79,9 +79,9 @@ foreach my $u (@users) my ($comment, $shell) = (getpwnam($userName))[6,8]; endpwent; my $new_shell = $u->prop('Shell') - || (($shell eq "/bin/sshell") ? "/usr/bin/rssh" : $shell); + || (($shell eq "/bin/sshell") ? "/usr/bin/false" : $shell); - $u->set_prop('Shell', $new_shell) unless (not defined $u->prop('Shell') && $new_shell eq "/usr/bin/rssh" ) ; + $u->set_prop('Shell', $new_shell) unless (not defined $u->prop('Shell') && $new_shell eq "/usr/bin/false" ) ; my $result; #------------------------------------------------------------ diff --git a/root/etc/e-smith/events/actions/user-rsshd b/root/etc/e-smith/events/actions/user-rsshd deleted file mode 100644 index 5fc9917..0000000 --- a/root/etc/e-smith/events/actions/user-rsshd +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/perl -w - -package esmith; - -use strict; -use Errno; -use esmith::ConfigDB; -use esmith::AccountsDB; -use File::Temp; - -sub trim { my $s = shift; $s =~ s/^\s+|\s+$//g; return $s }; - -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 -my @users = (not defined $ARGV[1])? $accounts->get_all_by_prop(type => "user" ) : map { $accounts->get($_); } $userName; -my @currents=split /\n/, `/usr/sbin/lid -ng rsshusers`; -@currents=map { trim($_) } @currents; - -# here we could be emptying group, but we might want to let system user on this list. -#if ( $event ~~ ['user-modify','user-create'] ) { -# system("/usr/bin/gpasswd","-M ''", "rsshusers"); -# print "deleting rsshusers group content ..."; -#} - -foreach my $user (@users) { - my $cuser=$user->key; - # we remove users that should not be there - if ( defined $user->prop('Shell') && $user->prop('Shell') ne '/usr/bin/rssh') { - next unless ( "$cuser" ~~ @currents ) ; - system("/usr/bin/gpasswd", "-d", $cuser, "rsshusers"); - 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); diff --git a/root/etc/e-smith/templates/etc/cpu.conf/40shell b/root/etc/e-smith/templates/etc/cpu.conf/40shell index 2332020..fc79461 100644 --- a/root/etc/e-smith/templates/etc/cpu.conf/40shell +++ b/root/etc/e-smith/templates/etc/cpu.conf/40shell @@ -1 +1 @@ -DEFAULT_SHELL = /usr/bin/rssh +DEFAULT_SHELL = /usr/bin/false diff --git a/root/etc/e-smith/templates/etc/shells/rssh b/root/etc/e-smith/templates/etc/shells/rssh deleted file mode 100644 index 0745e17..0000000 --- a/root/etc/e-smith/templates/etc/shells/rssh +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/rssh diff --git a/smeserver-base.spec b/smeserver-base.spec index b889b0e..3577f8c 100644 --- a/smeserver-base.spec +++ b/smeserver-base.spec @@ -4,7 +4,7 @@ Summary: smeserver server and gateway - base module %define name smeserver-base Name: %{name} %define version 5.8.1 -%define release 32 +%define release 33 Version: %{version} Release: %{release}%{?dist} License: GPL @@ -30,7 +30,6 @@ Requires: /usr/sbin/irqbalance Requires: /usr/sbin/smartd Requires: dbus Requires: acpid -Requires: rssh Requires: bridge-utils Requires: vconfig Requires: e-smith-bootloader @@ -180,6 +179,9 @@ fi %changelog +* Thu Mar 14 2024 Jean-Philippe Pialasse 5.8.1-33.sme +- drop rssh support and requirement [SME: 12509] + * Tue Mar 12 2024 Jean-Philippe Pialasse 5.8.1-32.sme - add gcc -g flag to allow el8 build