> On Mon, May 14, 2012 at 10:34:46PM +1000, Bryce Gibson wrote:
>> Modify OS string parsing to handle a two character OS string.
>> If a shorter than expected OS string is found, pad a zero on the end and 
>> then try 
>> the comparison.
>> ---
>> strace.c | 5 +++++
>> 1 file changed, 5 insertions(+)
>> 
>> diff --git a/strace.c b/strace.c
>> index 857136d..2bc8d59 100644
>> --- a/strace.c
>> +++ b/strace.c
>> @@ -1432,6 +1432,11 @@ get_os_release(void)
>> break;
>> while (*p >= '0' && *p = KERNEL_VERSION(1,0,0))
>> + break;
>> + }
>> if (*p != '.')
>> error_msg_and_die("Bad OS release string: '%s'", u.release);
>> p++;
> 
> Sorry, it is not a patch. How about this one:
> 
> diff --git a/strace.c b/strace.c
> index 857136d..65dee7d 100644
> --- a/strace.c
> +++ b/strace.c
> @@ -1432,8 +1432,14 @@ get_os_release(void)
>                       break;
>               while (*p >= '0' && *p <= '9')
>                       p++;
> -             if (*p != '.')
> +             if (*p != '.') {
> +                     if (rel >= KERNEL_VERSION(0,1,0)) {
> +                             /* "X.Y-something" means "X.Y.0" */
> +                             rel <<= 8;
> +                             break;
> +                     }
>                       error_msg_and_die("Bad OS release string: '%s'", 
> u.release);
> +             }
>               p++;
>       }
>       return rel;
> 
> 
> -- 
> ldv
> 

Oops, mangled it when I sent it :-s
Either way, your solution is cleverer than mine :-) I just did something that 
made it work...
I didn't want to complain without sending a patch :-p
Cheers for your time,
Bryce :-)
-- 
Please note this email and any attachments are intended exclusively for the use 
of the company or individual shown as the addressee(s). If you have reason to 
believe you are not the intended recipient please notify the sender by return 
email immediately and destroy the message you received without making any 
copies. Any copying, interference or disclosure of this message is therefore 
unauthorised and expressly prohibited. Note that any views or opinions 
presented in this
 email are solely those of the author and do not necessarily represent those of 
Gibson Consulting Services P/L.
We do not warrant that this message is virus free. Please perform your own 
virus check before opening any attachment.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to