[apparmor] [patch] parser - add support for variable expansion in dbus rules v2
Steve Beattie
steve at nxnw.org
Thu Sep 5 02:08:58 UTC 2013
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.
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.
--
Steve Beattie
<sbeattie at ubuntu.com>
http://NxNW.org/~steve/
-------------- 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/5904fd7b/attachment.pgp>
More information about the AppArmor
mailing list