summaryrefslogtreecommitdiff
path: root/hscript/script.cc
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-08 22:08:14 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-08 22:08:14 -0500
commita6c6d0a42920fb9332f810e949fdf5fe20262f22 (patch)
treefd0bf555c53b74fb7ca141738a1428a868050b79 /hscript/script.cc
parenta621e6b86adfe8278d2e9c110eb8ef54e58c6abe (diff)
downloadhorizon-a6c6d0a42920fb9332f810e949fdf5fe20262f22.tar.gz
horizon-a6c6d0a42920fb9332f810e949fdf5fe20262f22.tar.bz2
horizon-a6c6d0a42920fb9332f810e949fdf5fe20262f22.tar.xz
horizon-a6c6d0a42920fb9332f810e949fdf5fe20262f22.zip
hscript: Use StringKey for Hostname (+ others), implement RootPassphrase
Diffstat (limited to 'hscript/script.cc')
-rw-r--r--hscript/script.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/hscript/script.cc b/hscript/script.cc
index 69afb30..4d5a730 100644
--- a/hscript/script.cc
+++ b/hscript/script.cc
@@ -110,7 +110,7 @@ struct Script::ScriptPrivate {
} else if(key_name == "hostname") {
if(this->hostname) {
DUPLICATE_ERROR(this->hostname, std::string("hostname"),
- this->hostname->name())
+ this->hostname->value())
return false;
}
std::unique_ptr<Keys::Hostname> name(
@@ -133,8 +133,16 @@ struct Script::ScriptPrivate {
delete install;
return true;
} else if(key_name == "rootpw") {
- /*! TODO: implement */
- return false;
+ if(this->rootpw) {
+ DUPLICATE_ERROR(this->rootpw, std::string("rootpw"),
+ "an encrypted passphrase")
+ return false;
+ }
+ std::unique_ptr<Keys::RootPassphrase> name(
+ dynamic_cast<Keys::RootPassphrase *>(key_obj)
+ );
+ this->rootpw = std::move(name);
+ return true;
} else if(key_name == "mount") {
/*! TODO: implement */
return false;