[users] Introduce userShell setting

- Add a *userShell* key, which can be left out (default, backwards-
   compatible) to retain the old /bin/bash behavior, or explicitly
   set to empty to defer to useradd-configuration, or explicitly
   set to something non-empty to use that shell.
This commit is contained in:
Adriaan de Groot 2018-05-23 05:23:46 -04:00
parent ed15edabf9
commit 0d24c1db6c
3 changed files with 22 additions and 2 deletions

View file

@ -22,9 +22,11 @@
#include "UsersPage.h"
#include "utils/CalamaresUtils.h"
#include "utils/Logger.h"
#include "JobQueue.h"
#include "GlobalStorage.h"
#include "JobQueue.h"
CALAMARES_PLUGIN_FACTORY_DEFINITION( UsersViewStepFactory, registerPlugin<UsersViewStep>(); )
@ -181,5 +183,12 @@ UsersViewStep::setConfigurationMap( const QVariantMap& configurationMap )
m_widget->addPasswordCheck( i.key(), i.value() );
}
}
QString shell( QLatin1Literal( "/bin/bash" ) ); // as if it's not set at all
if ( configurationMap.contains( "userShell" ) )
shell = CalamaresUtils::getString( configurationMap, "userShell" );
// Now it might be explicitly set to empty, which is ok
Calamares::JobQueue::instance()->globalStorage()->insert( "userShell", shell );
}