calamares/calamares-1.0.0-20150203-add-removeUser-functionality.patch
2015-02-23 19:02:31 +01:00

44 lines
2.1 KiB
Diff

diff -Naur calamares-1.0.0-20150223/src/modules/users/CreateUserJob.cpp calamares-1.0.0-20150223.tpg/src/modules/users/CreateUserJob.cpp
--- calamares-1.0.0-20150223/src/modules/users/CreateUserJob.cpp 2015-02-23 08:45:48.000000000 +0000
+++ calamares-1.0.0-20150223.tpg/src/modules/users/CreateUserJob.cpp 2015-02-23 18:01:08.983649397 +0000
@@ -143,5 +143,14 @@
tr( "chown terminated with error code %1." )
.arg( ec ) );
+ if ( gs->contains( "removeUser" ) &&
+ !gs->value( "removeUser" ).toString().isEmpty() )
+ {
+
+ QString removeUser = gs->value( "removeUser" ).toString();
+
+ CalamaresUtils::chrootCall( { "userdel", "-f", "-r" removeUser } );
+ }
+
return Calamares::JobResult::ok();
}
diff -Naur calamares-1.0.0-20150223/src/modules/users/UsersViewStep.cpp calamares-1.0.0-20150223.tpg/src/modules/users/UsersViewStep.cpp
--- calamares-1.0.0-20150223/src/modules/users/UsersViewStep.cpp 2015-02-23 08:45:48.000000000 +0000
+++ calamares-1.0.0-20150223.tpg/src/modules/users/UsersViewStep.cpp 2015-02-23 17:58:40.420748643 +0000
@@ -151,5 +151,13 @@
Calamares::JobQueue::instance()->globalStorage()->insert( "sudoersGroup",
configurationMap.value( "sudoersGroup" ).toString() );
}
+
+ if ( configurationMap.contains( "removeUser" ) &&
+ configurationMap.value( "removeUser" ).type() == QVariant::String )
+ {
+ Calamares::JobQueue::instance()->globalStorage()->insert( "removeUser",
+ configurationMap.value( "removeUser" ).toString() );
+ }
+
}
diff -Naur calamares-1.0.0-20150223/src/modules/users/users.conf calamares-1.0.0-20150223.tpg/src/modules/users/users.conf
--- calamares-1.0.0-20150223/src/modules/users/users.conf 2015-02-23 08:45:48.000000000 +0000
+++ calamares-1.0.0-20150223.tpg/src/modules/users/users.conf 2015-02-23 17:32:11.521059300 +0000
@@ -9,3 +9,5 @@
- audio
autologinGroup: autologin
sudoersGroup: wheel
+# Remove specified user after installation is done
+removeUser: