summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Murphy <Patrick.Murphy@multitech.com>2020-06-12 11:15:57 -0500
committerPatrick Murphy <Patrick.Murphy@multitech.com>2020-06-12 11:15:57 -0500
commit7423ff98eb234188a9441ad95e5490ac5584df7b (patch)
treefb9e1395c73a32f8706039c01bb98df39ae17c1c
parentd3f1ca834316c060197ab90e1e7e8618600aeda5 (diff)
downloadcommissioning-7423ff98eb234188a9441ad95e5490ac5584df7b.tar.gz
commissioning-7423ff98eb234188a9441ad95e5490ac5584df7b.tar.bz2
commissioning-7423ff98eb234188a9441ad95e5490ac5584df7b.zip
loosened checks on legalName function to only prevent commissioning root user
-rw-r--r--src/commission_func.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/commission_func.cc b/src/commission_func.cc
index aae520f..21c5d16 100644
--- a/src/commission_func.cc
+++ b/src/commission_func.cc
@@ -370,7 +370,7 @@ bool legalName(std::string name) {
char *temp = NULL;
std::string popen_out;
*/
- if (getpwnam(name.c_str()) == NULL) {
+ if (name != "root") {
syslog (LOG_ALERT, "Received a legal name request");
//the name is available
return true;
@@ -392,4 +392,4 @@ std::string useradd_cmd_gen(std::string usr) {
cmd +=usr;
cmd +="\"";
return cmd;
-} \ No newline at end of file
+}