Re: [Rpm-maint] [PATCH 5/5] Fix handling of zero-length file digests

2016-04-29 Thread Florian Festi
On 04/28/2016 08:20 AM, Panu Matilainen wrote:
> On 04/27/2016 11:00 PM, Stefan Berger wrote:
>> "Rpm-maint"  wrote on 04/27/2016
>> 05:45:56 AM:
>>
>>>
>>> I get the following warning:
>>>
>>> ima.c:23:1: warning: ‘PACKED’ attribute directive ignored [-Wattributes]
>>>  } __attribute__((PACKED));
>>>
>>> May be there is an simpler way to check for the header being zeros only?
>>
>> One way of doing it would be to create an array of 9 zero bytes (with a
>> comment of what it represents) and compare against that.
> 
> Yes, and there's precedent for that in rpm, at least:
> http://rpm.org/gitweb?p=rpm.git;a=blob;f=rpmio/rpmkeyring.c;h=ac3e3bc5ab4cc240318605e2f82797872f19604e;hb=HEAD#l218

Guess this is the way to go here, too.

>> I guess you wouldn't like gcc #pragma tricks to disable -Wattributes in
>> this case.
> 
> Compiler specifics are nasty, no need for that here because there's a
> simple, standard solution.
> 
> - Panu -
> 


-- 

Red Hat GmbH, http://www.de.redhat.com/, Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Paul Argiry, Charles Cachera, Michael Cunningham,
Michael O'Neill
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [PATCH 5/5] Fix handling of zero-length file digests

2016-04-27 Thread Stefan Berger
"Rpm-maint"  wrote on 04/27/2016 05:45:56 
AM:

> 
> I get the following warning:
> 
> ima.c:23:1: warning: ‘PACKED’ attribute directive ignored [-Wattributes]
>  } __attribute__((PACKED));
> 
> May be there is an simpler way to check for the header being zeros only?

One way of doing it would be to create an array of 9 zero bytes (with a 
comment of what it represents) and compare against that.

I guess you wouldn't like gcc #pragma tricks to disable -Wattributes in 
this case.

Stefan

> 
> Florian
> 
> -- 
> 
> Red Hat GmbH, http://www.de.redhat.com/, Registered seat: Grasbrunn,
> Commercial register: Amtsgericht Muenchen, HRB 153243,
> Managing Directors: Paul Argiry, Charles Cachera, Michael Cunningham,
> Michael O'Neill
> ___
> Rpm-maint mailing list
> Rpm-maint@lists.rpm.org
> http://lists.rpm.org/mailman/listinfo/rpm-maint
> 


___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [PATCH 5/5] Fix handling of zero-length file digests

2016-04-27 Thread Florian Festi
I get the following warning:

ima.c:23:1: warning: ‘PACKED’ attribute directive ignored [-Wattributes]
 } __attribute__((PACKED));

May be there is an simpler way to check for the header being zeros only?

Florian

-- 

Red Hat GmbH, http://www.de.redhat.com/, Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Paul Argiry, Charles Cachera, Michael Cunningham,
Michael O'Neill
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint