summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perl-install/NEWS3
-rwxr-xr-xperl-install/standalone/finish-install7
2 files changed, 10 insertions, 0 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS
index 6216f8eac..15aef5b7b 100644
--- a/perl-install/NEWS
+++ b/perl-install/NEWS
@@ -1,3 +1,6 @@
+- finish-install:
+ o when renaming a user, update the name in any network config files
+
Version 18.51 - 29 October 2022
- drakboot: ensure efivars are mounted before installing a UEFI bootloader (mga#31008)
diff --git a/perl-install/standalone/finish-install b/perl-install/standalone/finish-install
index 72767a9b2..2c44e4f6f 100755
--- a/perl-install/standalone/finish-install
+++ b/perl-install/standalone/finish-install
@@ -181,6 +181,13 @@ sub ask_users() {
#- give console rights for current session
my $console_dir = "/var/run/console";
cp_f($console_dir . "/" . $old_user, $console_dir . "/" . $new_user) if -e $console_dir . "/" . $old_user;
+ #- update user name in network configurations
+ #- for now, only support the case of a single user name
+ foreach my $f (glob('/etc/sysconfig/network-scripts/ifcfg-*')) {
+ if (cat_($f) =~ /\nUSERS=$old_user\n/) {
+ run_program::run('perl', '-pi', '-e', "s,^USERS=$old_user,USERS=$new_user,", $f);
+ }
+ }
}
}