[PATCH] usage stanza

Lukáš Nykrýn lnykryn at redhat.com
Thu Feb 16 16:17:43 UTC 2012


James Hunt píše v Čt 16. 02. 2012 v 14:08 +0000:
> On 16/02/12 09:28, Lukáš Nykrýn wrote:
> > Hello,
> > I want to ask if this patch is considered to be included in next upstart
> > release or if it needs some alteration.
> Hi Lukáš, Petr,
> 
> Apologies for the delay in responding to this. Yes, I'd like to include this feature in the next 
> release. The changes Petr made are now allowing me to use the feature. However, there are a few 
> issues that still need to be addressed:
> 
> * init/job_class.c:
>    - job_class_get_instance():
>      - Missing return code check for "error_message = nih_strdup (...)".
>        This could result in a crash resulting from follow-on usage.
>      - nih_strcat_sprintf() check calls nih_error_raise_no_memory(), but
>        does not immediately return -1. If nih_strcat_sprintf() fails,
>        should really just call nih_return_system_error(). As it is, I
>        think problems would result since 2 errors are being raised in
>        that block and only 1 will be consumed by the caller, leading to a
>        possible assertion failure in the NIH alloc code.
>    - job_class_start(): As above.
> * util/initctl.c:job_usage(): Should state "Returns: newly allocated
>    string or NULL on raised error.".
> 
> Kind regards,
> 
> James.
> --
> James Hunt
> ____________________________________
> http://upstart.ubuntu.com/cookbook
> http://upstart.ubuntu.com/cookbook/upstart_cookbook.pdf
> 

Hello,
I have added nih_return_system_error in both checks.
Additionally I think, that in util/initctl.c usage should not use
check_config_options.
Corrected version can be found in bazaar repository:
https://code.launchpad.net/~lnykryn/upstart/usage

Regards,
Lukas




More information about the upstart-devel mailing list