From 46af8229026a6122ca640f063c24d68876acdb11 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Fri, 15 May 2020 02:29:01 -0500 Subject: hscript: Ensure user commands are correct in simulator --- hscript/user.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'hscript') diff --git a/hscript/user.cc b/hscript/user.cc index de92067..0dc4eba 100644 --- a/hscript/user.cc +++ b/hscript/user.cc @@ -219,7 +219,8 @@ bool Username::execute() const { "username: creating account " + _value); if(script->options().test(Simulate)) { - std::cout << "useradd -c \"Adélie User\" -m -U " << _value + std::cout << "useradd -c \"Adélie User\" -m -R " + << script->targetDirectory() << " -U " << _value << std::endl; return true; } @@ -263,7 +264,8 @@ bool UserAlias::execute() const { "useralias: setting GECOS name for " + _username); if(script->options().test(Simulate)) { - std::cout << "usermod -c \"" << _alias << "\" " << _username + std::cout << "usermod -c \"" << _alias << "\" " + << "-R " << script->targetDirectory() << " " << _username << std::endl; return true; } @@ -312,7 +314,8 @@ bool UserPassphrase::execute() const { "userpw: setting passphrase for " + _username); if(script->options().test(Simulate)) { - std::cout << "usermod -p '" << _passphrase << "' " << _username + std::cout << "usermod -p '" << _passphrase << "' " + << "-R " << script->targetDirectory() << " " << _username << std::endl; return true; } @@ -473,7 +476,9 @@ bool UserGroups::execute() const { groups.pop_back(); if(script->options().test(Simulate)) { - std::cout << "usermod -aG " << groups << " " << _username << std::endl; + std::cout << "usermod -aG " << groups + << "-R " << script->targetDirectory() + << " " << _username << std::endl; return true; } -- cgit v1.2.3-70-g09d2