summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Randrianasulu <randrianasulu@gmail.com>2019-10-27 16:41:00 +0100
committerSlávek Banko <slavek.banko@axis.cz>2019-10-27 16:41:00 +0100
commit23344311de3556b70c6604132450f7b319c1d38d (patch)
tree2a958f3b18487800b0b7dd81d6e09f264277bc1c
parentd75671abacbe68dd2686cedcee975e26ce1a5d89 (diff)
downloadtdenetwork-23344311de3556b70c6604132450f7b319c1d38d.tar.gz
tdenetwork-23344311de3556b70c6604132450f7b319c1d38d.zip
Adding checking for Samba version 4 in kcm_sambaconf/sambafile.cpp
Fixes issue #15 in tdenetwork Signed-off-by: Andrew Randrianasulu <randrianasulu@gmail.com> Minor adjustments to refine the version test. Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r--filesharing/advanced/kcm_sambaconf/sambafile.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/filesharing/advanced/kcm_sambaconf/sambafile.cpp b/filesharing/advanced/kcm_sambaconf/sambafile.cpp
index 7929b96d..a9eb26a5 100644
--- a/filesharing/advanced/kcm_sambaconf/sambafile.cpp
+++ b/filesharing/advanced/kcm_sambaconf/sambafile.cpp
@@ -350,12 +350,15 @@ int SambaFile::getSambaVersion() {
connect( &testParam, TQT_SIGNAL(receivedStdout(TDEProcess*,char*,int)),
this, TQT_SLOT(testParmStdOutReceived(TDEProcess*,char*,int)));
-
-
- if (testParam.start(TDEProcess::Block,TDEProcess::Stdout)) {
- if (_parmOutput.find("3") > -1)
+ if (testParam.start(TDEProcess::Block, TDEProcess::Stdout)) {
+ if (_parmOutput.find(" 3.") > -1) {
_sambaVersion = 3;
- }
+ }
+ if (_parmOutput.find(" 4.") > -1) {
+ _sambaVersion = 4;
+ }
+ }
+
kdDebug(5009) << "Samba version = " << _sambaVersion << endl;
@@ -373,7 +376,7 @@ SambaShare* SambaFile::getTestParmValues(bool reload)
testParam << "testparm";
testParam << "-s";
- if (getSambaVersion() == 3)
+ if ((getSambaVersion() == 3) || (getSambaVersion() == 4))
testParam << "-v";