summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2018-12-13 10:46:33 +0100
committerAndreas Schneider <asn@cryptomilk.org>2019-01-28 10:29:17 +0100
commit2b6706fbbee0426d0f2e0b68ef9ce5baf416b296 (patch)
tree1beb8f32f1786059e802f67a99ee6b32c9c140a5 /source4/lib
parentded66cf39eda4161c2a1158490ed83c61567a34e (diff)
downloadsamba-2b6706fbbee0426d0f2e0b68ef9ce5baf416b296.tar.gz
s4:lib: Use C99 initializer for poptOption in popt_credentials
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/cmdline/popt_credentials.c87
1 files changed, 75 insertions, 12 deletions
diff --git a/source4/lib/cmdline/popt_credentials.c b/source4/lib/cmdline/popt_credentials.c
index c06b8c73a8d..5dd61f6339c 100644
--- a/source4/lib/cmdline/popt_credentials.c
+++ b/source4/lib/cmdline/popt_credentials.c
@@ -175,16 +175,79 @@ static void popt_common_credentials_callback(poptContext con,
struct poptOption popt_common_credentials4[] = {
- { NULL, 0, POPT_ARG_CALLBACK|POPT_CBFLAG_PRE|POPT_CBFLAG_POST, (void *)popt_common_credentials_callback },
- { "user", 'U', POPT_ARG_STRING, NULL, 'U', "Set the network username", "[DOMAIN/]USERNAME[%PASSWORD]" },
- { "no-pass", 'N', POPT_ARG_NONE, &dont_ask, 'N', "Don't ask for a password" },
- { "password", 0, POPT_ARG_STRING, NULL, OPT_PASSWORD, "Password" },
- { "authentication-file", 'A', POPT_ARG_STRING, NULL, 'A', "Get the credentials from a file", "FILE" },
- { "machine-pass", 'P', POPT_ARG_NONE, NULL, 'P', "Use stored machine account password" },
- { "simple-bind-dn", 0, POPT_ARG_STRING, NULL, OPT_SIMPLE_BIND_DN, "DN to use for a simple bind" },
- { "kerberos", 'k', POPT_ARG_STRING, NULL, OPT_KERBEROS, "Use Kerberos, -k [yes|no]" },
- { "krb5-ccache", 0, POPT_ARG_STRING, NULL, OPT_KRB5_CCACHE, "Credentials cache location for Kerberos" },
- { "sign", 'S', POPT_ARG_NONE, NULL, OPT_SIGN, "Sign connection to prevent modification in transit" },
- { "encrypt", 'e', POPT_ARG_NONE, NULL, OPT_ENCRYPT, "Encrypt connection for privacy" },
- { NULL }
+ {
+ .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 = "[DOMAIN/]USERNAME[%PASSWORD]",
+ },
+ {
+ .longName = "no-pass",
+ .shortName = 'N',
+ .argInfo = POPT_ARG_NONE,
+ .arg = &dont_ask,
+ .val = 'N',
+ .descrip = "Don't ask for a password",
+ },
+ {
+ .longName = "password",
+ .argInfo = POPT_ARG_STRING,
+ .val = OPT_PASSWORD,
+ .descrip = "Password",
+ },
+ {
+ .longName = "authentication-file",
+ .shortName = 'A',
+ .argInfo = POPT_ARG_STRING,
+ .val = 'A',
+ .descrip = "Get the credentials from a file",
+ .argDescrip = "FILE",
+ },
+ {
+ .longName = "machine-pass",
+ .shortName = 'P',
+ .argInfo = POPT_ARG_NONE,
+ .val = 'P',
+ .descrip = "Use stored machine account password",
+ },
+ {
+ .longName = "simple-bind-dn",
+ .argInfo = POPT_ARG_STRING,
+ .val = OPT_SIMPLE_BIND_DN,
+ .descrip = "DN to use for a simple bind",
+ },
+ {
+ .longName = "kerberos",
+ .shortName = 'k',
+ .argInfo = POPT_ARG_STRING,
+ .val = OPT_KERBEROS,
+ .descrip = "Use Kerberos, -k [yes|no]",
+ },
+ {
+ .longName = "krb5-ccache",
+ .argInfo = POPT_ARG_STRING,
+ .val = OPT_KRB5_CCACHE,
+ .descrip = "Credentials cache location for Kerberos",
+ },
+ {
+ .longName = "sign",
+ .shortName = 'S',
+ .argInfo = POPT_ARG_NONE,
+ .val = OPT_SIGN,
+ .descrip = "Sign connection to prevent modification in transit",
+ },
+ {
+ .longName = "encrypt",
+ .shortName = 'e',
+ .argInfo = POPT_ARG_NONE,
+ .val = OPT_ENCRYPT,
+ .descrip = "Encrypt connection for privacy",
+ },
+ POPT_TABLEEND
};