[apparmor] [PATCH 5/8] Convert the parser to C++

Tyler Hicks tyhicks at canonical.com
Wed Sep 11 18:34:48 UTC 2013


On 2013-09-11 04:09:53, Steve Beattie wrote:
> On Wed, Sep 11, 2013 at 01:47:44AM -0700, Tyler Hicks wrote:
> > From: John Johansen <john.johansen at canonical.com>
> > 
> > This conversion is nothing more than what is required to get it to
> > compile. Further improvements will come as the code is refactored.
> > 
> > Unfortunately due to C++ not supporting designated initializers, the auto
> > generation of af names needed to be reworked, and "netlink" and "unix"
> > domain socket keywords leaked in. Since these where going to be added in
> > separate patches I have not bothered to do the extra work to replace them
> > with a temporary place holder.
> > 
> > Signed-off-by: John Johansen <john.johansen at canonical.com>
> > [tyhicks: merged with dbus changes and memory leak fixes]
> > Signed-off-by: Tyler Hicks <tyhicks at canonical.com>
> > Acked-by: Seth Arnold <seth.arnold at canonical.com>
> 
> This doesn't apply to trunk due to the conflicting DUP_STRING changes in
> parser_misc.c. The following patch snippet:

Sorry about that! I forgot to rebase onto the latest trunk prior to
sending this patch set.

Tyler

> 
> > diff --git a/parser/parser_misc.c b/parser/parser_misc.c
> > index 24dd53d..10c41ec 100644
> > --- a/parser/parser_misc.c
> > +++ b/parser/parser_misc.c
> > @@ -841,7 +841,7 @@ struct cod_entry *copy_cod_entry(struct cod_entry *orig)
> >  	if (!entry)
> >  		return NULL;
> >  
> > -	entry->namespace = orig->namespace ? strdup(orig->namespace) : NULL;
> > +	entry->ns = orig->ns ? strdup(orig->ns) : NULL;
> >  	entry->name = strdup(orig->name);
> >  	entry->link_name = orig->link_name ? strdup(orig->link_name) : NULL;
> >  	entry->mode = orig->mode;
> 
> needs to be replaced with the following:
> 
> @@ -841,7 +841,7 @@ struct cod_entry *copy_cod_entry(struct cod_entry *orig)
>  	if (!entry)
>  		return NULL;
>  
> -	DUP_STRING(orig, entry, namespace, err);
> +	DUP_STRING(orig, entry, ns, err);
>  	DUP_STRING(orig, entry, name, err);
>  	DUP_STRING(orig, entry, link_name, err);
>  	entry->mode = orig->mode;
> 
> for the patch to apply.
> -- 
> Steve Beattie
> <sbeattie at ubuntu.com>
> http://NxNW.org/~steve/



> -- 
> AppArmor mailing list
> AppArmor at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/apparmor

-------------- 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/20130911/6b5f5872/attachment.pgp>


More information about the AppArmor mailing list