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>
(cherry picked from commit 23344311de)
pull/38/head
Andrew Randrianasulu 5 years ago committed by Slávek Banko
parent 09c8a5af12
commit 980c185af3
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -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";

Loading…
Cancel
Save