From bda8039465a0084fb380e878c8f9ea3e900505ea Mon Sep 17 00:00:00 2001 From: Pavel Březina Date: Thu, 24 Sep 2015 12:10:56 +0200 Subject: sss tools: improve option handling The crash describe by ticket #2802 is caused by providing NULL options in popt and yet trying to iterate over them. Instead of simply testing for NULL this patch creates a new option table table merges several option tables together, thus improving and simplifying usage string. Resolves: https://fedorahosted.org/sssd/ticket/2802 Reviewed-by: Pavel Reichl --- src/tools/sss_override.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/tools/sss_override.c') diff --git a/src/tools/sss_override.c b/src/tools/sss_override.c index 0d7a46906..075f024f0 100644 --- a/src/tools/sss_override.c +++ b/src/tools/sss_override.c @@ -92,7 +92,6 @@ static int parse_cmdline_user_add(struct sss_cmdline *cmdline, struct override_user *user) { struct poptOption options[] = { - POPT_AUTOHELP {"name", 'n', POPT_ARG_STRING, &user->name, 0, _("Override name"), NULL }, {"uid", 'u', POPT_ARG_INT, &user->uid, 0, _("Override uid (non-zero value)"), NULL }, {"gid", 'g', POPT_ARG_INT, &user->gid, 0, _("Override gid (non-zero value)"), NULL }, @@ -119,7 +118,6 @@ static int parse_cmdline_group_add(struct sss_cmdline *cmdline, struct override_group *group) { struct poptOption options[] = { - POPT_AUTOHELP {"name", 'n', POPT_ARG_STRING, &group->name, 0, _("Override name"), NULL }, {"gid", 'g', POPT_ARG_INT, &group->gid, 0, _("Override gid"), NULL }, POPT_TABLEEND -- cgit