KrateBuilder::KrateBuilder(const runtime::User& user, const std::string& manifestPath) :
name(user.getName()), uid(user.getUid()), gid(user.getGid())
{
- manifest.reset(xml::Parser::parseFile(manifestPath));
+ runtime::File data(manifestPath);
+ if (data.exists()) {
+ manifest.reset(xml::Parser::parseFile(manifestPath));
+ }
}
KrateBuilder::~KrateBuilder()
}
}
-void KrateBuilder::mountOwnFilesystem() {
- manifest.reset(xml::Parser::parseFile("/opt/etc/krate/owner.xml"));
-
- xml::Node::NodeList entries = manifest->evaluate("/manifest/filesystem/entry");
- for (const xml::Node& entry : entries) {
- bindFilesystemNode(entry.getProp("source"), entry.getProp("target"),
- entry.getProp("type"), entry.getProp("options"));
+void KrateBuilder::mountOwnFilesystem()
+{
+ if (manifest.get()) {
+ xml::Node::NodeList entries = manifest->evaluate("/manifest/filesystem/entry");
+ for (const xml::Node& entry : entries) {
+ bindFilesystemNode(entry.getProp("source"), entry.getProp("target"),
+ entry.getProp("type"), entry.getProp("options"));
+ }
}
bindFilesystemNode("/home/" + name,
%attr(700,root,root) %{_sbindir}/krate-volume-manager
%{_unitdir}/krate.service
%{_unitdir}/multi-user.target.wants/krate.service
-%attr(700,root,root) /etc/gumd/useradd.d/20_krate-add.post
-%attr(700,root,root) /etc/gumd/userdel.d/20_krate-remove.post
%attr(644,root,root) %{TZ_SYS_RO_ICONS}/krate/shortcut_icon.png
%attr(644,root,root) %{TZ_SYS_RO_ICONS}/krate/indicator_icon.png
%attr(644,root,root) %{TZ_SYS_RO_ICONS}/krate/notification_sub_icon.png
-%attr(700,root,root) %dir %{TZ_SYS_ETC}/krate
-%attr(600,root,root) %config %{TZ_SYS_ETC}/krate/owner.xml
+#%attr(700,root,root) %dir %{TZ_SYS_ETC}/krate
%attr(755,root,root) %{_libdir}/security/pam_krate.so
%attr(700,root,root) %{_sbindir}/krate-admin-cli
%config /etc/pam.d/*
INSTALL(TARGETS ${SERVER_NAME} DESTINATION ${BIN_DIR})
INSTALL(FILES systemd/krate.service DESTINATION ${SYSTEMD_UNIT_DIR})
-INSTALL(FILES ${KRATE_TOOLS}/gumd-scripts/20_krate-add.post DESTINATION /etc/gumd/useradd.d)
-INSTALL(FILES ${KRATE_TOOLS}/gumd-scripts/20_krate-remove.post DESTINATION /etc/gumd/userdel.d)
-
-INSTALL(FILES ${KRATE_DATA}/DefaultManifest.xml DESTINATION ${CONF_DIR} RENAME owner.xml)
INSTALL(FILES ${KRATE_DATA}/indicator_icon.png DESTINATION ${ICON_DIR})
INSTALL(FILES ${KRATE_DATA}/notification_sub_icon.png DESTINATION ${ICON_DIR})
INSTALL(FILES ${KRATE_DATA}/shortcut_icon.png DESTINATION ${ICON_DIR})
+++ /dev/null
-PATH=/bin:/usr/bin:/sbin:/usr/sbin
-
-export `tzplatform-get TZ_SYS_ETC`
-cp ${TZ_SYS_ETC}/krate/owner.xml ${TZ_SYS_ETC}/krate/${1}.xml
+++ /dev/null
-PATH=/bin:/usr/bin:/sbin:/usr/sbin
-
-export `tzplatform-get TZ_SYS_ETC`
-rm ${TZ_SYS_ETC}/krate/${1}.xml