From 0f087af2839a459ccf1aa4cd10000b0d1a142538 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 24 Jan 2010 17:07:24 +0100 Subject: [PATCH] s3: Add -C (--use-ccache) to popt_common_credentials --- source3/include/popt_common.h | 1 + source3/include/proto.h | 3 +++ source3/lib/popt_common.c | 7 ++++++- source3/lib/util.c | 10 ++++++++++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/source3/include/popt_common.h b/source3/include/popt_common.h index 7237ca67540..a6e43d26598 100644 --- a/source3/include/popt_common.h +++ b/source3/include/popt_common.h @@ -55,6 +55,7 @@ struct user_auth_info { bool smb_encrypt; bool use_machine_account; bool fallback_after_kerberos; + bool use_ccache; }; #endif /* _POPT_COMMON_H */ diff --git a/source3/include/proto.h b/source3/include/proto.h index 01372c25876..f0ccc92c46f 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1105,6 +1105,9 @@ const char *get_cmdline_auth_info_password(const struct user_auth_info *auth_inf bool set_cmdline_auth_info_signing_state(struct user_auth_info *auth_info, const char *arg); int get_cmdline_auth_info_signing_state(const struct user_auth_info *auth_info); +void set_cmdline_auth_info_use_ccache(struct user_auth_info *auth_info, + bool b); +bool get_cmdline_auth_info_use_ccache(const struct user_auth_info *auth_info); void set_cmdline_auth_info_use_kerberos(struct user_auth_info *auth_info, bool b); bool get_cmdline_auth_info_use_kerberos(const struct user_auth_info *auth_info); diff --git a/source3/lib/popt_common.c b/source3/lib/popt_common.c index 342309d1a75..060382b930a 100644 --- a/source3/lib/popt_common.c +++ b/source3/lib/popt_common.c @@ -473,6 +473,7 @@ static void get_credentials_file(struct user_auth_info *auth_info, * -S,--signing * -P --machine-pass * -e --encrypt + * -C --use-ccache */ @@ -573,7 +574,9 @@ static void popt_common_credentials_callback(poptContext con, case 'e': set_cmdline_auth_info_smb_encrypt(auth_info); break; - + case 'C': + set_cmdline_auth_info_use_ccache(auth_info, true); + break; } } @@ -595,5 +598,7 @@ struct poptOption popt_common_credentials[] = { { "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 (UNIX extended servers only)" }, + {"use-ccache", 'C', POPT_ARG_NONE, NULL, 'C', + "Use the winbind ccache for authentication" }, POPT_TABLEEND }; diff --git a/source3/lib/util.c b/source3/lib/util.c index 007226b5c90..932b5dbd405 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -382,6 +382,16 @@ int get_cmdline_auth_info_signing_state(const struct user_auth_info *auth_info) return auth_info->signing_state; } +void set_cmdline_auth_info_use_ccache(struct user_auth_info *auth_info, bool b) +{ + auth_info->use_ccache = b; +} + +bool get_cmdline_auth_info_use_ccache(const struct user_auth_info *auth_info) +{ + return auth_info->use_ccache; +} + void set_cmdline_auth_info_use_kerberos(struct user_auth_info *auth_info, bool b) { -- 2.11.4.GIT