s4: popt: Add set/get/free functions for cmdline_credentials.
authorJeremy Allison <jra@samba.org>
Tue, 9 May 2017 21:34:35 +0000 (14:34 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 11 May 2017 18:30:13 +0000 (20:30 +0200)
Preparing to make this static instead of a global.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source4/lib/cmdline/popt_common.c
source4/lib/cmdline/popt_common.h

index 25b02b446d0ca94d9a5baf4923b9737f8c783ce8..59f06e8ba2527962cddc4e93faac5f4ebef62c25 100644 (file)
 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,
index fec7a3c305743666a0bf7d6e6ed3be8097eb1b21..d1f764a0df9a0c1cae495b08511cf69807af031e 100644 (file)
@@ -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 */