s3: Add -C (--use-ccache) to popt_common_credentials
authorVolker Lendecke <vl@samba.org>
Sun, 24 Jan 2010 16:07:24 +0000 (17:07 +0100)
committerKarolin Seeger <kseeger@samba.org>
Tue, 26 Jan 2010 13:55:35 +0000 (14:55 +0100)
(cherry picked from commit 58ebc50663a299e16684aa24cfae95954d5a14f0)

source3/include/popt_common.h
source3/include/proto.h
source3/lib/popt_common.c
source3/lib/util.c

index 7237ca67540185638e265ad0da91682f75f4c7d8..a6e43d265984a5872e2530e05310cd664afec9d1 100644 (file)
@@ -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 */
index b363358a704e18ac8795743a67dcd8d007649884..32f389dfe0bd66cadcf9a7a8623a9e2562b9c85f 100644 (file)
@@ -1107,6 +1107,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);
index 342309d1a750dadb22828b33dac63f6f2b61c92b..060382b930a13581d988c46710ecf0f3eaffbe26 100644 (file)
@@ -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
 };
index 5fe7bce144e94ac3cdde16f41c04ce0be02b0b83..50aa4b0cbc497f08dde04953afea13fc136abc99 100644 (file)
@@ -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)
 {