----- Original Message -----
> From: "Libo Chen" <libo.c...@huawei.com>
> To: varek...@redhat.com
> Cc: "dhaval giani" <dhaval.gi...@gmail.com>, jsafr...@redhat.com, 
> libcg-devel@lists.sourceforge.net,
> lize...@huawei.com, "h huangqiang" <h.huangqi...@huawei.com>, "wengmeiling 
> weng" <wengmeiling.w...@huawei.com>,
> "libo chen" <libo.c...@huawei.com>
> Sent: Tuesday, September 3, 2013 10:49:21 AM
> Subject: [PATCH v3 8/8] cgconfig: add check and nonzero
> 
> From: Libo Chen <clbchenlibo.c...@huawei.com>
> 
> 1. check return value of cgroup_string_list_init.
> 2. add nonzero for -a and -t
> 
> Signed-off-by: Libo Chen <clbchenlibo.c...@huawei.com>
Acked-by: Ivana Hutarova Varekova <varek...@redhat.com>
> ---
>  src/tools/cgconfig.c |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/src/tools/cgconfig.c b/src/tools/cgconfig.c
> index e437589..d0b6a57 100644
> --- a/src/tools/cgconfig.c
> +++ b/src/tools/cgconfig.c
> @@ -96,6 +96,8 @@ int main(int argc, char *argv[])
>       }
>  
>       error = cgroup_string_list_init(&cfg_files, argc/2);
> +     if (error)
> +             goto err;
>  
>       while ((c = getopt_long(argc, argv, "hl:L:t:a:d:f:s:", options,
>                       NULL)) > 0) {
> @@ -118,12 +120,14 @@ int main(int argc, char *argv[])
>                       break;
>               case 'a':
>                       /* set admin uid/gid */
> -                     if (parse_uid_gid(optarg, &auid, &agid, argv[0]))
> +                     error = parse_uid_gid(optarg, &auid, &agid, argv[0]);
> +                     if (error)
>                               goto err;
>                       break;
>               case 't':
>                       /* set task uid/gid */
> -                     if (parse_uid_gid(optarg, &tuid, &tgid, argv[0]))
> +                     error = parse_uid_gid(optarg, &tuid, &tgid, argv[0]);
> +                     if (error)
>                               goto err;
>                       break;
>               case 'd':
> --
> 1.7.1
> 
> 
> 

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to