@ -45,6 +45,12 @@ InitramfsJob::exec()
cDebug ( ) < < " Updating initramfs with kernel " < < m_kernel ;
cDebug ( ) < < " Updating initramfs with kernel " < < m_kernel ;
if ( m_unsafe )
{
cDebug ( ) < < " Skipping mitigations for unsafe initramfs permissions. " ;
}
else
{
// First make sure we generate a safe initramfs with suitable permissions.
// First make sure we generate a safe initramfs with suitable permissions.
static const char confFile [ ] = " /etc/initramfs-tools/conf.d/calamares-safe-initramfs.conf " ;
static const char confFile [ ] = " /etc/initramfs-tools/conf.d/calamares-safe-initramfs.conf " ;
static const char contents [ ] = " UMASK=0077 \n " ;
static const char contents [ ] = " UMASK=0077 \n " ;
@ -53,6 +59,7 @@ InitramfsJob::exec()
cWarning ( ) < < Logger : : SubEntry < < " Could not configure safe UMASK for initramfs. " ;
cWarning ( ) < < Logger : : SubEntry < < " Could not configure safe UMASK for initramfs. " ;
// But continue anyway.
// But continue anyway.
}
}
}
// And then do the ACTUAL work.
// And then do the ACTUAL work.
auto r = CalamaresUtils : : System : : instance ( ) - > targetEnvCommand (
auto r = CalamaresUtils : : System : : instance ( ) - > targetEnvCommand (
@ -84,6 +91,8 @@ InitramfsJob::setConfigurationMap( const QVariantMap& configurationMap )
< < r . getExitCode ( ) < < r . getOutput ( ) ;
< < r . getExitCode ( ) < < r . getOutput ( ) ;
}
}
}
}
m_unsafe = CalamaresUtils : : getBool ( configurationMap , " be_unsafe " , false ) ;
}
}
CALAMARES_PLUGIN_FACTORY_DEFINITION ( InitramfsJobFactory , registerPlugin < InitramfsJob > ( ) ; )
CALAMARES_PLUGIN_FACTORY_DEFINITION ( InitramfsJobFactory , registerPlugin < InitramfsJob > ( ) ; )