1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-21 18:04:06 +03:00

lib:cmdline: Add a --configfile only parser for ntlm_auth

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Andreas Schneider 2021-01-13 10:56:41 +01:00 committed by Andrew Bartlett
parent c88a8a3cbe
commit f0cd9afa8c
2 changed files with 32 additions and 0 deletions

View File

@ -474,6 +474,22 @@ static struct poptOption popt_common_option[] = {
POPT_TABLEEND
};
static struct poptOption popt_common_config[] = {
{
.argInfo = POPT_ARG_CALLBACK|POPT_CBFLAG_PRE|POPT_CBFLAG_POST,
.arg = (void *)popt_samba_callback,
},
{
.longName = "configfile",
.shortName = 's',
.argInfo = POPT_ARG_STRING,
.val = 's',
.descrip = "Use alternative configuration file",
.argDescrip = "CONFIGFILE",
},
POPT_TABLEEND
};
static struct poptOption popt_common_samba[] = {
{
.argInfo = POPT_ARG_CALLBACK|POPT_CBFLAG_PRE|POPT_CBFLAG_POST,
@ -1236,6 +1252,9 @@ struct poptOption *samba_cmdline_get_popt(enum smb_cmdline_popt_options opt)
case SAMBA_CMDLINE_POPT_OPT_OPTION_ONLY:
return popt_common_option;
break;
case SAMBA_CMDLINE_POPT_OPT_CONFIG_ONLY:
return popt_common_config;
break;
case SAMBA_CMDLINE_POPT_OPT_SAMBA:
return popt_common_samba;
break;

View File

@ -41,6 +41,7 @@ enum samba_cmdline_config_type {
enum smb_cmdline_popt_options {
SAMBA_CMDLINE_POPT_OPT_DEBUG_ONLY = 1,
SAMBA_CMDLINE_POPT_OPT_OPTION_ONLY,
SAMBA_CMDLINE_POPT_OPT_CONFIG_ONLY,
SAMBA_CMDLINE_POPT_OPT_SAMBA,
SAMBA_CMDLINE_POPT_OPT_CONNECTION,
SAMBA_CMDLINE_POPT_OPT_CREDENTIALS,
@ -166,6 +167,18 @@ poptContext samba_popt_get_context(const char * name,
.descrip = "Options:", \
.argDescrip = NULL },
/**
* @brief A popt structure for --configfile only.
*/
#define POPT_COMMON_CONFIG_ONLY { \
.longName = NULL, \
.shortName = '\0', \
.argInfo = POPT_ARG_INCLUDE_TABLE, \
.arg = samba_cmdline_get_popt(SAMBA_CMDLINE_POPT_OPT_CONFIG_ONLY), \
.val = 0, \
.descrip = "Config file:", \
.argDescrip = NULL },
/**
* @brief A popt structure for common samba options.
*/