summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Murphy <patrick.muprphy@multitech.com>2020-04-23 09:47:16 -0500
committerPatrick Murphy <patrick.muprphy@multitech.com>2020-04-23 09:47:16 -0500
commit6f6d2e50dc3e3ae598d50743f6f7f876d2b8201b (patch)
tree8548df15fbaae399ddf8ceb84fd90b708787af8f
parent551e521b5ea8436ebc6722a9c616be1c1ed112e9 (diff)
downloadcommissioning-6f6d2e50dc3e3ae598d50743f6f7f876d2b8201b.tar.gz
commissioning-6f6d2e50dc3e3ae598d50743f6f7f876d2b8201b.tar.bz2
commissioning-6f6d2e50dc3e3ae598d50743f6f7f876d2b8201b.zip
modified print request to use fprintf instead of fgets
-rw-r--r--src/commission_func.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/commission_func.cc b/src/commission_func.cc
index 9c75c19..6f510f6 100644
--- a/src/commission_func.cc
+++ b/src/commission_func.cc
@@ -174,9 +174,9 @@ int begin_fcgi() {
syslog (LOG_ALERT, "popen for passwd failed to return a useful pointer");
//handle error via logging, closing
}
- //parse_cmd= tmp_pass + "\n" + tmp_pass;
- fputs(tmp_pass.c_str(), fpopen);
- fputs(tmp_pass.c_str(), fpopen);
+ //parse_cmd = tmp_pass + "\n" + tmp_pass;
+ fprintf(fpopen, "%s\n", tmp_pass.c_str());
+ fprintf(fpopen, "%s\n", tmp_pass.c_str());
popen_ret = pclose(fpopen);
if (popen_ret == -1) {
syslog (LOG_ALERT, "pclose for passwd failed");
@@ -186,13 +186,13 @@ int begin_fcgi() {
/****mts-ubpasswd*/
fpopen = popen(POPEN_MTS_UBPW.c_str(), "w");
if (fpopen == NULL) {
- syslog (LOG_ALERT, "mts-uppasswd for passwd failed to return a useful pointer");
+ syslog (LOG_ALERT, "mts-ubpasswd for passwd failed to return a useful pointer");
//handle error via logging, closing
}
fputs(tmp_pass.c_str(), fpopen);
popen_ret = pclose(fpopen);
if (popen_ret == -1) {
- syslog (LOG_ALERT, "pclose for mts-uppasswd failed");
+ syslog (LOG_ALERT, "pclose for mts-ubpasswd failed");
//handle error via logging, closing
}
/*****