summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2017-05-09 14:34:35 -0700
committerJeremy Allison <jra@samba.org>2017-05-11 20:30:13 +0200
commitdd4a3ce92792c4687f92d4b9e88f7bbee6cad593 (patch)
tree52c703c0138397482d6785442cd57bad17a5c81e
parent560c37524b2b4188011e45c03b3712951476de59 (diff)
downloadsamba-dd4a3ce92792c4687f92d4b9e88f7bbee6cad593.tar.gz
s4: popt: Add set/get/free functions for cmdline_credentials.
Preparing to make this static instead of a global. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
-rw-r--r--source4/lib/cmdline/popt_common.c16
-rw-r--r--source4/lib/cmdline/popt_common.h3
2 files changed, 19 insertions, 0 deletions
diff --git a/source4/lib/cmdline/popt_common.c b/source4/lib/cmdline/popt_common.c
index 25b02b446d0..59f06e8ba25 100644
--- a/source4/lib/cmdline/popt_common.c
+++ b/source4/lib/cmdline/popt_common.c
@@ -39,6 +39,22 @@
enum {OPT_OPTION=1,OPT_LEAK_REPORT,OPT_LEAK_REPORT_FULL,OPT_DEBUG_STDERR};
struct cli_credentials *cmdline_credentials = NULL;
+
+void popt_set_cmdline_credentials(struct cli_credentials *creds)
+{
+ cmdline_credentials = creds;
+}
+
+struct cli_credentials *popt_get_cmdline_credentials(void)
+{
+ return cmdline_credentials;
+}
+
+void popt_free_cmdline_credentials(void)
+{
+ TALLOC_FREE(cmdline_credentials);
+}
+
struct loadparm_context *cmdline_lp_ctx = NULL;
static void popt_version_callback(poptContext con,
diff --git a/source4/lib/cmdline/popt_common.h b/source4/lib/cmdline/popt_common.h
index fec7a3c3057..d1f764a0df9 100644
--- a/source4/lib/cmdline/popt_common.h
+++ b/source4/lib/cmdline/popt_common.h
@@ -38,6 +38,9 @@ extern struct poptOption popt_common_credentials4[];
#define POPT_COMMON_CREDENTIALS { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_credentials4, 0, "Authentication options:", NULL },
extern struct cli_credentials *cmdline_credentials;
+void popt_set_cmdline_credentials(struct cli_credentials *creds);
+struct cli_credentials *popt_get_cmdline_credentials(void);
+void popt_free_cmdline_credentials(void);
extern struct loadparm_context *cmdline_lp_ctx;
#endif /* _POPT_COMMON_H */