[Oval-commits] r323 - trunk/ovalint/debian/patches
Pavel Vinogradov
blaze-guest at alioth.debian.org
Thu Jan 24 20:17:24 UTC 2008
Author: blaze-guest
Date: 2008-01-24 20:17:24 +0000 (Thu, 24 Jan 2008)
New Revision: 323
Removed:
trunk/ovalint/debian/patches/oval.textfilecontent.patch
Modified:
trunk/ovalint/debian/patches/series
Log:
Remove TestFileContent patch. Merged upstream.
Deleted: trunk/ovalint/debian/patches/oval.textfilecontent.patch
===================================================================
--- trunk/ovalint/debian/patches/oval.textfilecontent.patch 2008-01-24 20:09:54 UTC (rev 322)
+++ trunk/ovalint/debian/patches/oval.textfilecontent.patch 2008-01-24 20:17:24 UTC (rev 323)
@@ -1,162 +0,0 @@
-diff -urN oval-ref/src/linux/ProbeFactory.cpp oval-ref-textfilecontent/src/linux/ProbeFactory.cpp
---- oval-ref/src/linux/ProbeFactory.cpp 2007-01-17 00:20:32.000000000 +0400
-+++ oval-ref-textfilecontent/src/linux/ProbeFactory.cpp 2007-08-06 16:05:18.000000000 +0500
-@@ -54,7 +54,7 @@
- } else if(objectName.compare("environmentvariable_object") == 0) {
- probe = EnvironmentVariableProbe::Instance();
- } else if(objectName.compare("textfilecontent_object") == 0) {
-- //probe = TextFileContentProbe::Instance();
-+ probe = TextFileContentProbe::Instance();
- } else if(objectName.compare("variable_object") == 0) {
- probe = VariableProbe::Instance();
- } else if(objectName.compare("xmlfilecontent_object") == 0) {
-diff -urN oval-ref/src/probes/independent/TextFileContentProbe.cpp oval-ref-textfilecontent/src/probes/independent/TextFileContentProbe.cpp
---- oval-ref/src/probes/independent/TextFileContentProbe.cpp 2007-06-28 19:45:34.000000000 +0500
-+++ oval-ref-textfilecontent/src/probes/independent/TextFileContentProbe.cpp 2007-08-06 16:05:35.000000000 +0500
-@@ -115,6 +115,7 @@
- }
-
- } else {
-+
- // if no filepaths check if the code should report that the path does not exist
- StringVector paths;
- if(fileFinder.ReportPathDoesNotExist(path, &paths)) {
-@@ -165,14 +166,58 @@
- filePath.append(fileName.substr(1, fileName.length()-2));
- }
-
-- // read the file line by line
-
-- // call the GetSubstrings method
-+ // read the file line by line
-+ StringVector* results = new StringVector();
-+ string buffer;
-+ ifstream infile;
-+ infile.open (filePath.c_str());
-+ if (infile.is_open())
-+ {
-+ while (! infile.eof())
-+ {
-+ // call the GetSubstrings method
-+ getline (infile, buffer);
-+ if (this->GetSubstrings (buffer, line, results))
-+ {
-+ StringVector::iterator iterator;
-+ for (iterator = results->begin(); iterator != results->end(); iterator++)
-+ {
-+ item = this->CreateItem();
-+ item->SetStatus(OvalEnum::STATUS_EXISTS);
-+ item->AppendElement(new ItemEntity("path", path, OvalEnum::DATATYPE_STRING, true, OvalEnum::STATUS_EXISTS));
-+ item->AppendElement(new ItemEntity("filename", fileName, OvalEnum::DATATYPE_STRING, true, OvalEnum::STATUS_EXISTS));
-+ item->AppendElement(new ItemEntity("subexpression", line->GetValue(), OvalEnum::DATATYPE_STRING, true, OvalEnum::STATUS_EXISTS));
-+ item->AppendElement(new ItemEntity("line", (*iterator), OvalEnum::DATATYPE_STRING, false, OvalEnum::STATUS_EXISTS));
-+ }
-+ }
-+ }
-+ infile.close();
-+ }
-
- return item;
- }
-
--bool TextFileContentProbe::GetSubsrtings(string lineFromFile, ObjectEntity* line, StringVector* substrings) {
-+bool TextFileContentProbe::GetSubstrings(string lineFromFile, ObjectEntity* line, StringVector* substrings) {
-+ bool retVal = false;
-+ string pattern = line->GetValue();
-+
-+ if (line->GetOperation() == OvalEnum::OPERATION_EQUALS) {
-+ if (this->IsMatch (pattern, lineFromFile, false) ) {
-+ substrings->push_back (lineFromFile);
-+ retVal = true;
-+ }
-+ } else if (line->GetOperation() == OvalEnum::OPERATION_NOT_EQUAL) {
-+ if (not this->IsMatch (pattern, lineFromFile, false) ) {
-+ substrings->push_back (lineFromFile);
-+ retVal = true;
-+ }
-+ } else if (line->GetOperation() == OvalEnum::OPERATION_PATTERN_MATCH) {
-+ if (this->IsMatch (pattern, lineFromFile, true) ) {
-+ substrings->push_back (lineFromFile);
-+ retVal = true;
-+ }
-+}
-
-- return false;
--}
-\ В конце файла нет новой строки
-+ return retVal;
-+}
-diff -urN oval-ref/src/probes/independent/TextFileContentProbe.h oval-ref-textfilecontent/src/probes/independent/TextFileContentProbe.h
---- oval-ref/src/probes/independent/TextFileContentProbe.h 2007-06-25 23:57:36.000000000 +0500
-+++ oval-ref-textfilecontent/src/probes/independent/TextFileContentProbe.h 2007-08-06 16:06:51.000000000 +0500
-@@ -34,7 +34,7 @@
-
- #include "FileFinder.h"
- #include "AbsProbe.h"
--
-+#include <fstream>
- #ifdef WIN32
- #define SNPRINTF _snprintf
- #else
-@@ -45,7 +45,7 @@
-
- /**
- This class is responsible for collecting date for the :ind-sctextfilecontent_item definied OVAL System Characteristics Schema.
-- This class should be platform independant.
-+ This class should be platform independent.
- */
- class TextFileContentProbe : public AbsProbe {
-
-@@ -68,16 +68,12 @@
-
- /** Return true if the specified line matches the criteria in the ObjectEntity.
- If true any resulting substrings are returned on the substrings vector.
--
-- TODO: need to implement
- */
-- bool GetSubsrtings(string lineFromFile, ObjectEntity* line, StringVector* substrings);
-+ bool GetSubstrings(string lineFromFile, ObjectEntity* line, StringVector* substrings);
-
- /** Read the specified file one line at time and add matching lines to the resultiong Item.
- Call out to the GetSubstrings function to determine if a given line in a file matches the criteria
- specified in the ObjectEntity.
--
-- TODO: need to implement
- */
- Item* GetLines(string path, string fileName, ObjectEntity* line);
-
-diff -urN oval-ref/src/solaris/ProbeFactory.cpp oval-ref-textfilecontent/src/solaris/ProbeFactory.cpp
---- oval-ref/src/solaris/ProbeFactory.cpp 2007-01-17 00:09:36.000000000 +0400
-+++ oval-ref-textfilecontent/src/solaris/ProbeFactory.cpp 2007-08-06 16:05:25.000000000 +0500
-@@ -65,7 +65,8 @@
- // SOLARIS PORT NOTICE: This probe was written for linux and windows systems and needs to be tested on solaris systems
- probe = EnvironmentVariableProbe::Instance();
- } else if(objectName.compare("textfilecontent_object") == 0) {
-- // not currently implemented
-+ // SOLARIS PORT NOTICE: This probe was written for linux and windows systems and needs to be tested on solaris systems
-+ probe = TextFileContentProbe::Instance();
- } else if(objectName.compare("variable_object") == 0) {
- // SOLARIS PORT NOTICE: This probe was written for linux and windows systems and needs to be tested on solaris systems
- probe = VariableProbe::Instance();
-diff -urN oval-ref/src/windows/ProbeFactory.cpp oval-ref-textfilecontent/src/windows/ProbeFactory.cpp
---- oval-ref/src/windows/ProbeFactory.cpp 2007-06-28 19:41:31.000000000 +0500
-+++ oval-ref-textfilecontent/src/windows/ProbeFactory.cpp 2007-08-06 16:05:30.000000000 +0500
-@@ -61,7 +61,7 @@
- } else if(objectName.compare("variable_object") == 0) {
- probe = VariableProbe::Instance();
- } else if(objectName.compare("textfilecontent_object") == 0) {
-- //probe = TextFileContentProbe::Instance();
-+ probe = TextFileContentProbe::Instance();
- } else if(objectName.compare("xmlfilecontent_object") == 0) {
- probe = XmlFileContentProbe::Instance();
- } else if(objectName.compare("filehash_object") == 0) {
-@@ -126,6 +126,9 @@
- probe = VariableProbe::Instance();
- delete probe;
-
-+ probe = TextFileContentProbe::Instance();
-+ delete probe;
-+
- probe = XmlFileContentProbe::Instance();
- delete probe;
-
Modified: trunk/ovalint/debian/patches/series
===================================================================
--- trunk/ovalint/debian/patches/series 2008-01-24 20:09:54 UTC (rev 322)
+++ trunk/ovalint/debian/patches/series 2008-01-24 20:17:24 UTC (rev 323)
@@ -1,4 +1,3 @@
oval.misc.patch
-oval.textfilecontent.patch
debian.manpage.patch
debian.xsddir.patch
More information about the Oval-commits
mailing list