Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux-HA: Dev

crm_get_msec() should return signed long long?

 

 

Linux-HA dev RSS feed   Index | Next | Previous | View Threaded


taniguchis at intellilink

Sep 8, 2008, 9:47 PM

Post #1 of 5 (1325 views)
Permalink
crm_get_msec() should return signed long long?

Hi,

I found that crm_get_msec() is declared to return _unsigned_ long long,
but it tries to return a minus value in the following cases.
i) input strings consists of only character string.
ii) input strings means minus value.
In these cases, the return value is unexpected one like 1271310319.

I think this function should be declared to return _signed_ value,
but it is used in so many places without minus value check.
I tentatively created a patch , but I could'nt clarify its influence...

Anyway, I just want to use crm_get_msec()'s function safely.
If it is possible as it is, please let me know.

Regards,
Satomi Taniguchi
Attachments: crm_get_msec.patch (0.83 KB)


beekhof at gmail

Sep 11, 2008, 4:09 AM

Post #2 of 5 (1246 views)
Permalink
Re: crm_get_msec() should return signed long long? [In reply to]

Thanks!

Applied as:
http://hg.clusterlabs.org/pacemaker/dev/rev/c6326dbb9fac

2008/9/9 Satomi Taniguchi <taniguchis [at] intellilink>:
> Hi,
>
> I found that crm_get_msec() is declared to return _unsigned_ long long,
> but it tries to return a minus value in the following cases.
> i) input strings consists of only character string.
> ii) input strings means minus value.
> In these cases, the return value is unexpected one like 1271310319.
>
> I think this function should be declared to return _signed_ value,
> but it is used in so many places without minus value check.
> I tentatively created a patch , but I could'nt clarify its influence...
>
> Anyway, I just want to use crm_get_msec()'s function safely.
> If it is possible as it is, please let me know.
>
> Regards,
> Satomi Taniguchi
>
>
> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev [at] lists
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/
>
>
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


taniguchis at intellilink

Sep 11, 2008, 5:37 PM

Post #3 of 5 (1229 views)
Permalink
Re: crm_get_msec() should return signed long long? [In reply to]

Andrew,

Thank you so much for taking care of it!


Regards,
Satomi TANIGUCHI



Andrew Beekhof wrote:
> Thanks!
>
> Applied as:
> http://hg.clusterlabs.org/pacemaker/dev/rev/c6326dbb9fac
>
> 2008/9/9 Satomi Taniguchi <taniguchis [at] intellilink>:
>> Hi,
>>
>> I found that crm_get_msec() is declared to return _unsigned_ long long,
>> but it tries to return a minus value in the following cases.
>> i) input strings consists of only character string.
>> ii) input strings means minus value.
>> In these cases, the return value is unexpected one like 1271310319.
>>
>> I think this function should be declared to return _signed_ value,
>> but it is used in so many places without minus value check.
>> I tentatively created a patch , but I could'nt clarify its influence...
>>
>> Anyway, I just want to use crm_get_msec()'s function safely.
>> If it is possible as it is, please let me know.
>>
>> Regards,
>> Satomi Taniguchi
>>
>>
>> _______________________________________________________
>> Linux-HA-Dev: Linux-HA-Dev [at] lists
>> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
>> Home Page: http://linux-ha.org/
>>
>>
> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev [at] lists
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/

_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


taniguchis at intellilink

Sep 12, 2008, 1:25 AM

Post #4 of 5 (1227 views)
Permalink
Re: crm_get_msec() should return signed long long? [In reply to]

Hi Andrew,


I got these ERROR messages with the latest pacemaker-dev.

pengine[27131]: 2008/09/12_15:44:15 ERROR: crm_int_helper: Characters left over
after parsing '120s': 's'
crmd[27128]: 2008/09/12_15:44:15 ERROR: crm_int_helper: Characters left over
after parsing '60s': 's'


Maybe the 2nd argument of crm_int_helper() should not be NULL
in new crm_get_msec().
As a trial, I applied the attached patch, no ERROR messages appeared.
(Please change the length of end_text to suitable one.)


Best Regards,
Satomi TANIGUCHI


Andrew Beekhof wrote:
> Thanks!
>
> Applied as:
> http://hg.clusterlabs.org/pacemaker/dev/rev/c6326dbb9fac
>
> 2008/9/9 Satomi Taniguchi <taniguchis [at] intellilink>:
>> Hi,
>>
>> I found that crm_get_msec() is declared to return _unsigned_ long long,
>> but it tries to return a minus value in the following cases.
>> i) input strings consists of only character string.
>> ii) input strings means minus value.
>> In these cases, the return value is unexpected one like 1271310319.
>>
>> I think this function should be declared to return _signed_ value,
>> but it is used in so many places without minus value check.
>> I tentatively created a patch , but I could'nt clarify its influence...
>>
>> Anyway, I just want to use crm_get_msec()'s function safely.
>> If it is possible as it is, please let me know.
>>
>> Regards,
>> Satomi Taniguchi
>>
>>
>> _______________________________________________________
>> Linux-HA-Dev: Linux-HA-Dev [at] lists
>> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
>> Home Page: http://linux-ha.org/
>>
>>
> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev [at] lists
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/
Attachments: set_end_text.patch (0.51 KB)


beekhof at gmail

Sep 16, 2008, 12:35 PM

Post #5 of 5 (1196 views)
Permalink
Re: crm_get_msec() should return signed long long? [In reply to]

right. my bad - thanks for the patch!

2008/9/12 Satomi TANIGUCHI <taniguchis [at] intellilink>:
> Hi Andrew,
>
>
> I got these ERROR messages with the latest pacemaker-dev.
>
> pengine[27131]: 2008/09/12_15:44:15 ERROR: crm_int_helper: Characters left
> over after parsing '120s': 's'
> crmd[27128]: 2008/09/12_15:44:15 ERROR: crm_int_helper: Characters left over
> after parsing '60s': 's'
>
>
> Maybe the 2nd argument of crm_int_helper() should not be NULL
> in new crm_get_msec().
> As a trial, I applied the attached patch, no ERROR messages appeared.
> (Please change the length of end_text to suitable one.)
>
>
> Best Regards,
> Satomi TANIGUCHI
>
>
> Andrew Beekhof wrote:
>>
>> Thanks!
>>
>> Applied as:
>> http://hg.clusterlabs.org/pacemaker/dev/rev/c6326dbb9fac
>>
>> 2008/9/9 Satomi Taniguchi <taniguchis [at] intellilink>:
>>>
>>> Hi,
>>>
>>> I found that crm_get_msec() is declared to return _unsigned_ long long,
>>> but it tries to return a minus value in the following cases.
>>> i) input strings consists of only character string.
>>> ii) input strings means minus value.
>>> In these cases, the return value is unexpected one like 1271310319.
>>>
>>> I think this function should be declared to return _signed_ value,
>>> but it is used in so many places without minus value check.
>>> I tentatively created a patch , but I could'nt clarify its influence...
>>>
>>> Anyway, I just want to use crm_get_msec()'s function safely.
>>> If it is possible as it is, please let me know.
>>>
>>> Regards,
>>> Satomi Taniguchi
>>>
>>>
>>> _______________________________________________________
>>> Linux-HA-Dev: Linux-HA-Dev [at] lists
>>> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
>>> Home Page: http://linux-ha.org/
>>>
>>>
>> _______________________________________________________
>> Linux-HA-Dev: Linux-HA-Dev [at] lists
>> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
>> Home Page: http://linux-ha.org/
>
>
> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev [at] lists
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/
>
>
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Linux-HA dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.