From: Joshua Brindle <method@manicmethod.com>
To: Karl MacMillan <kmacmillan@mentalrootkit.com>
Cc: selinux@tycho.nsa.gov
Subject: Re: [POLICYREP] [RFC/PATCH 1/3] policy package class
Date: Tue, 17 Jul 2007 12:23:27 -0400 [thread overview]
Message-ID: <469CECFF.5030506@manicmethod.com> (raw)
In-Reply-To: <1184686310.3833.3.camel@localhost.localdomain>
Karl MacMillan wrote:
> On Tue, 2007-07-17 at 11:03 -0400, method@manicmethod.com wrote:
>
>> plain text document attachment (00-policy_package-header.patch)
>> --
>>
>> --- a/libpolicyrep/include/policyrep/policy_package.hpp (revision 0)
>> +++ b/libpolicyrep/include/policyrep/policy_package.hpp (revision 0)
>> @@ -0,0 +1,38 @@
>> +/* Author: Joshua Brindle <method@manicmethod.com> */
>> +
>> +#ifndef __policy_package_hpp__
>> +#define __policy_package_hpp__
>> +
>> +
>> +#include <policyrep/policy.hpp>
>> +
>> +namespace policyrep
>> +{
>> + struct PolicyPackageImpl;
>> + class PolicyPackage
>> + {
>> + public:
>> + PolicyPackage();
>> + PolicyPackage(std::string filename);
>> + ~PolicyPackage();
>> +
>>
>
> Destructors should always be virtual - otherwise subclassing is
> difficult.
>
I don't think there is any reason to ever subclass a policy package. Its
different from the ast components.
>
>> + const Module get_policy_module() const;
>> +
>> + const std::string get_file_contexts() const;
>> + const std::string get_seusers() const;
>> + const std::string get_user_extra() const;
>> + const std::string get_netfilter_contexts() const;
>> +
>>
>
> why not const std::string&? I also think we should always default to
> virtual.
>
>
because this won't be subclassed I don't think these should be virtual.
>> + protected:
>> + void init();
>> + int read_package(std::string filename);
>> +
>> + private:
>> + PolicyPackageImpl* impl;
>>
>
> We need to make a decision on whether this is going to be protected or
> private and stick with that. I've done protected so far - if you want to
> change it please say why and send a patch changing all existing classes.
>
>
Same argument. If this isn't subclassed it shouldn't be protected, other
classes are different that way.
>> + };
>> +
>> + typedef boost::shared_ptr<PolicyPackage> PolicyPackagePtr;
>> +
>>
>
> This may not be needed here - it is currently only definitely used for
> objects that are part of the ast.
>
>
I like it, it will enable users to have several pointers to the package
and have them dealt with correctly. Do you disagree?
--
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:[~2007-07-17 16:23 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-17 15:03 [POLICYREP] [RFC/PATCH 0/3] policy package implementation with xar method
2007-07-17 15:03 ` [POLICYREP] [RFC/PATCH 1/3] policy package class method
2007-07-17 15:31 ` Karl MacMillan
2007-07-17 16:23 ` Joshua Brindle [this message]
2007-07-17 18:30 ` Karl MacMillan
2007-07-17 20:33 ` Joshua Brindle
2007-07-17 21:01 ` Karl MacMillan
2007-07-17 15:03 ` [POLICYREP] [RFC/PATCH 2/3] policy package implementation method
2007-07-17 15:38 ` Karl MacMillan
2007-07-17 16:40 ` Joshua Brindle
2007-07-17 18:35 ` Karl MacMillan
2007-07-17 20:48 ` Joshua Brindle
2007-07-17 20:48 ` Joshua Brindle
2007-07-17 20:56 ` Karl MacMillan
2007-07-17 21:01 ` Joshua Brindle
2007-07-17 21:11 ` Karl MacMillan
2007-07-18 12:32 ` Christopher J. PeBenito
2007-07-17 15:03 ` [POLICYREP] [RFC/PATCH 3/3] policy package tests method
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=469CECFF.5030506@manicmethod.com \
--to=method@manicmethod.com \
--cc=kmacmillan@mentalrootkit.com \
--cc=selinux@tycho.nsa.gov \
/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.