bug 1997469

This commit is contained in:
Vadim Kurland
2008-08-06 16:39:53 +00:00
parent 5aaed4fb04
commit 93a10bb0cf
2 changed files with 64 additions and 0 deletions
+6
View File
@@ -1,3 +1,9 @@
2008-08-06 Vadim Kurland <vadim@vk.crocodile.org>
* new_object.cpp (newObject): fixed bug # 1997469: "Create a new
User library via fwbedit". Fwbedit creates new library and
populates it with correct set of standard folders.
2008-08-05 Vadim Kurland <vadim@vk.crocodile.org>
* pfAdvancedDialog_en_US.html: Help page for the advanced settings
+58
View File
@@ -104,6 +104,7 @@ using namespace std;
std::map<string,string> systemGroupPaths;
std::map<string,string> systemGroupTypes;
void initConstants()
@@ -132,6 +133,31 @@ void initConstants()
systemGroupPaths[Firewall::TYPENAME] = "Firewalls";
systemGroupPaths[Interval::TYPENAME] = "Time";
systemGroupTypes["Objects/Addresses"] = ObjectGroup::TYPENAME;
systemGroupTypes["Objects/Addresses"] = ObjectGroup::TYPENAME;
systemGroupTypes["Objects/DNS Names"] = ObjectGroup::TYPENAME;
systemGroupTypes["Objects/Address Tables"] = ObjectGroup::TYPENAME;
systemGroupTypes["Objects/Address Ranges"] = ObjectGroup::TYPENAME;
systemGroupTypes["Objects/Groups"] = ObjectGroup::TYPENAME;
systemGroupTypes["Objects/Hosts"] = ObjectGroup::TYPENAME;
systemGroupTypes["Objects/Networks"] = ObjectGroup::TYPENAME;
systemGroupTypes["Objects/Networks"] = ObjectGroup::TYPENAME;
systemGroupTypes["Services/Groups"] = ServiceGroup::TYPENAME;
systemGroupTypes["Services/Custom"] = ServiceGroup::TYPENAME;
systemGroupTypes["Services/IP"] = ServiceGroup::TYPENAME;
systemGroupTypes["Services/ICMP"] = ServiceGroup::TYPENAME;
systemGroupTypes["Services/TCP"] = ServiceGroup::TYPENAME;
systemGroupTypes["Services/UDP"] = ServiceGroup::TYPENAME;
systemGroupTypes["Services/TagServices"] = ServiceGroup::TYPENAME;
systemGroupTypes["Services/Users"] = ServiceGroup::TYPENAME;
systemGroupTypes["Firewalls"] = ObjectGroup::TYPENAME;
systemGroupTypes["Time"] = IntervalGroup::TYPENAME;
}
void notEnoughAttributesError()
@@ -776,6 +802,38 @@ void newObject(FWObjectDatabase *objdb,
_modObject(nobj, comment_txt, ops);
if (objtype==Library::TYPENAME)
{
FWObject *new_child = createObject(objdb,
ObjectGroup::TYPENAME,
nobj->getPath());
new_child->setName("Objects");
cout << new_child->getPath() << endl;
new_child = createObject(objdb, ServiceGroup::TYPENAME, nobj->getPath());
new_child->setName("Services");
cout << new_child->getPath() << endl;
std::map<string,string>::iterator it;
for (it=systemGroupPaths.begin(); it!=systemGroupPaths.end(); ++it)
{
string path = it->second;
if (path.empty()) continue;
string t = systemGroupTypes[path];
string::size_type n = path.find("/");
string parent_obj = path.substr(0,n);
string obj_name = path.substr(n+1);
if (n==string::npos) parent_obj = "";
new_child = createObject(
objdb, t, nobj->getName() + "/" + parent_obj);
new_child->setName(obj_name);
cout << new_child->getPath() << endl;
}
}
cout << endl;
}