[prev in list] [next in list] [prev in thread] [next in thread] 

List:       trousers-tech
Subject:    Re: [TrouSerS-tech] 64bit issue with trousers 0.3.2
From:       Rajiv Andrade <srajiv () linux ! vnet ! ibm ! com>
Date:       2009-08-05 14:50:37
Message-ID: 1249483837.32137.32.camel () blackbox
[Download RAW message or body]


> <snip>
> 
> @@ -56,15 +60,15 @@ struct ext_log_source ima_source = {
>   int
>   ima_open(void *source, int *handle)
>   {
> -	int fd;
> + 	FILE *fd;
(...)
> 
> -	*handle = fd;
> -
> +	*handle = (int) fd;
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Stuffing a 64 bit pointer into a 32 bit integer will not work out. This
> code is not 64 bit compatible. Either do real FILE handling or revert to
> using the plain open function. Mixing both is really bad as the above
> case proves and should be avoided. :)
> Not sure what you prefer and what were the reasons for converting to
> fopen?

Just to let the fopen do the buffering for me. I didn't modify the scope
yet since firmware_source and kernel_source are both ext_log_source, and
the first uses open instead. So I thought I could postpone the bios
parser migration to fopen, and yeah I agree, it's very bizarre.

I will handle this, making both bios and ima parsers use the same (fopen
or open). Thanks for reporting it Stefan.

Rajiv Andrade
IBM LTC Security Development


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
TrouSerS-tech mailing list
TrouSerS-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/trousers-tech
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic