[apparmor] [patch] parser - add support for variable expansion in dbus rules v2

Tyler Hicks tyhicks at canonical.com
Thu Sep 5 03:06:17 UTC 2013


On 2013-09-04 19:08:58, Steve Beattie wrote:
> On Wed, Sep 04, 2013 at 05:08:56PM -0700, Tyler Hicks wrote:
> > On 2013-08-29 11:40:08, Tyler Hicks wrote:
> > > On 2013-08-29 10:50:35, Steve Beattie wrote:
> > > >
> > > > +#define DUP_STRING(orig, new, field) \
> > > > +	(new)->field = (orig)->field ? strdup((orig)->field) : NULL
> > > > +
> > > > +struct dbus_entry *dup_dbus_entry(struct dbus_entry *orig)
> > > > +{
> > > > +	struct dbus_entry *ent = NULL;
> > > > +	ent = (struct dbus_entry *) calloc(1, sizeof(struct dbus_entry));
> > > > +	if (!ent)
> > > > +		return NULL;
> > > > +
> > > > +	DUP_STRING(orig, ent, bus);
> > > > +	DUP_STRING(orig, ent, name);
> > > > +	DUP_STRING(orig, ent, peer_label);
> > > > +	DUP_STRING(orig, ent, path);
> > > > +	DUP_STRING(orig, ent, interface);
> > > > +	DUP_STRING(orig, ent, member);
> > >
> > > There should be error checking on these strdup()'s. Otherwise, ent could
> > > be returned with NULL pointers in fields where orig didn't have any.
> >
> > I noticed that the DUP_STRING() issue I mentioned above is unaddressed
> > in trunk. I still think it needs to be fixed. Thoughts?
> 
> Yes, I agree. I was working on a patch set for a few different issues
> around variables and dbus, but hit some other issues that I have yet
> to resolve. I can post out the progress that I've made so far.

No problem! I don't think there's a need to post the progress that
you've made so far.

The last patch in the Ubuntu apparmor package happened to be this one
and it reminded me of the DUP_STRING() thing so I thought I'd bring it
back up on the list as a reminder.

> 
> I also wasn't sure where the state of the C++-ification was, and wasn't
> sure if I'd be conflicting with any of that work.

JJ got me the C++ patches last night. I had hoped to get more done on
them today but the libapparmor regression and doc update patch was
unexpected.

I'd say not to worry about the C++ patches and let me handle the fallout
of merging them with trunk.

Tyler
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20130904/b5e73f19/attachment.pgp>


More information about the AppArmor mailing list