From: Joshua Brindle <method@manicmethod.com>
To: selinux@tycho.nsa.gov
Cc: sds@tycho.nsa.gov, kmacmillan@mentalrootkit.com, tmiller@tresys.com
Subject: [POLICYREP] [patch 6/7] add negset to idset
Date: Tue, 22 Jan 2008 14:43:37 -0500 [thread overview]
Message-ID: <20080121160229.174189374@manicmethod.com> (raw)
In-Reply-To: 20080121160031.792610312@manicmethod.com
Add negset to idset for use in av rules
---
libpolicyrep/include/policyrep/idset.hpp | 15 +++++++++++++++
libpolicyrep/src/idset.cpp | 6 ++++++
2 files changed, 21 insertions(+)
--- policyrep.new.orig/libpolicyrep/include/policyrep/idset.hpp
+++ policyrep.new/libpolicyrep/include/policyrep/idset.hpp
@@ -6,6 +6,7 @@
#include <policyrep/policy_base.hpp>
#include <set>
+#include <algorithm>
namespace policyrep
{
@@ -15,6 +16,19 @@ namespace policyrep
public:
IdSet();
IdSet(const IdSet& other);
+ template<typename I>
+ IdSet(bool comp, I sids, I eids){
+ init();
+ set_compl(comp);
+ ids().insert(sids, eids);
+ }
+ template<typename I>
+ IdSet(bool comp, I sids, I eids, I snids, I enids){
+ init();
+ set_compl(comp);
+ ids().insert(sids, eids);
+ neg_ids().insert(snids, enids);
+ }
~IdSet();
IdSet& operator=(const IdSet& other);
@@ -22,6 +36,7 @@ namespace policyrep
bool get_compl() const;
StringSet& ids();
+ StringSet& neg_ids();
protected:
void init();
IdSetImpl* impl;
--- policyrep.new.orig/libpolicyrep/src/idset.cpp
+++ policyrep.new/libpolicyrep/src/idset.cpp
@@ -27,6 +27,7 @@ namespace policyrep
{
IdSetImpl() : compliment(false) { }
StringSet ids;
+ StringSet neg_ids;
bool compliment;
};
@@ -66,4 +67,9 @@ namespace policyrep
return impl->ids;
}
+ StringSet& IdSet::neg_ids()
+ {
+ return impl->neg_ids;
+ }
+
} // namespace policyre
--
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
next prev parent reply other threads:[~2008-01-22 19:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-22 19:43 [POLICYREP] [patch 0/7] various cleanups and base symbol class Joshua Brindle
2008-01-22 19:43 ` [POLICYREP] [patch 1/7] remove makefile targets that dont build Joshua Brindle
2008-01-22 19:43 ` [POLICYREP] [patch 2/7] remove policy_package Joshua Brindle
2008-01-22 19:43 ` [POLICYREP] [patch 3/7] remove duplicated optional.hpp data Joshua Brindle
2008-01-22 19:43 ` [POLICYREP] [patch 4/7] symbol base class Joshua Brindle
2008-01-22 19:43 ` [POLICYREP] [patch 5/7] fix operator= calls to return pointer Joshua Brindle
2008-01-22 19:43 ` Joshua Brindle [this message]
2008-01-22 19:43 ` [POLICYREP] [patch 7/7] remove unused copy/init functions Joshua Brindle
2008-01-22 21:29 ` Joshua Brindle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080121160229.174189374@manicmethod.com \
--to=method@manicmethod.com \
--cc=kmacmillan@mentalrootkit.com \
--cc=sds@tycho.nsa.gov \
--cc=selinux@tycho.nsa.gov \
--cc=tmiller@tresys.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.