From 1cde483c96456b23b896dad37bbe3088523931c9 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 13 Dec 2018 11:02:48 +0100 Subject: [PATCH] s3:lib: Use C99 initializer for poptOption in popt_common_cmdline Signed-off-by: Andreas Schneider Reviewed-by: Douglas Bagnall --- source3/lib/popt_common_cmdline.c | 90 ++++++++++++++++++++++++------- 1 file changed, 70 insertions(+), 20 deletions(-) diff --git a/source3/lib/popt_common_cmdline.c b/source3/lib/popt_common_cmdline.c index 971234257e6..95abec1a440 100644 --- a/source3/lib/popt_common_cmdline.c +++ b/source3/lib/popt_common_cmdline.c @@ -225,25 +225,75 @@ void popt_burn_cmdline_password(int argc, char *argv[]) } struct poptOption popt_common_credentials[] = { - { NULL, 0, POPT_ARG_CALLBACK|POPT_CBFLAG_PRE|POPT_CBFLAG_POST, - (void *)popt_common_credentials_callback, 0, NULL }, - { "user", 'U', POPT_ARG_STRING, NULL, 'U', - "Set the network username", "USERNAME" }, - { "no-pass", 'N', POPT_ARG_NONE, NULL, 'N', - "Don't ask for a password" }, - { "kerberos", 'k', POPT_ARG_NONE, NULL, 'k', - "Use kerberos (active directory) authentication" }, - { "authentication-file", 'A', POPT_ARG_STRING, NULL, 'A', - "Get the credentials from a file", "FILE" }, - { "signing", 'S', POPT_ARG_STRING, NULL, 'S', - "Set the client signing state", "on|off|required" }, - {"machine-pass", 'P', POPT_ARG_NONE, NULL, 'P', - "Use stored machine account password" }, - {"encrypt", 'e', POPT_ARG_NONE, NULL, 'e', - "Encrypt SMB transport" }, - {"use-ccache", 'C', POPT_ARG_NONE, NULL, 'C', - "Use the winbind ccache for authentication" }, - {"pw-nt-hash", '\0', POPT_ARG_NONE, NULL, 'H', - "The supplied password is the NT hash" }, + { + .argInfo = POPT_ARG_CALLBACK|POPT_CBFLAG_PRE|POPT_CBFLAG_POST, + .arg = (void *)popt_common_credentials_callback, + }, + { + .longName = "user", + .shortName = 'U', + .argInfo = POPT_ARG_STRING, + .val = 'U', + .descrip = "Set the network username", + .argDescrip = "USERNAME", + }, + { + .longName = "no-pass", + .shortName = 'N', + .argInfo = POPT_ARG_NONE, + .val = 'N', + .descrip = "Don't ask for a password", + }, + { + .longName = "kerberos", + .shortName = 'k', + .argInfo = POPT_ARG_NONE, + .val = 'k', + .descrip = "Use kerberos (active directory) authentication", + }, + { + .longName = "authentication-file", + .shortName = 'A', + .argInfo = POPT_ARG_STRING, + .val = 'A', + .descrip = "Get the credentials from a file", + .argDescrip = "FILE", + }, + { + .longName = "signing", + .shortName = 'S', + .argInfo = POPT_ARG_STRING, + .val = 'S', + .descrip = "Set the client signing state", + .argDescrip = "on|off|required", + }, + { + .longName = "machine-pass", + .shortName = 'P', + .argInfo = POPT_ARG_NONE, + .val = 'P', + .descrip = "Use stored machine account password", + }, + { + .longName = "encrypt", + .shortName = 'e', + .argInfo = POPT_ARG_NONE, + .val = 'e', + .descrip = "Encrypt SMB transport", + }, + { + .longName = "use-ccache", + .shortName = 'C', + .argInfo = POPT_ARG_NONE, + .val = 'C', + .descrip = "Use the winbind ccache for authentication", + }, + { + .longName = "pw-nt-hash", + .shortName = '\0', + .argInfo = POPT_ARG_NONE, + .val = 'H', + .descrip = "The supplied password is the NT hash", + }, POPT_TABLEEND }; -- 2.34.1