s3-util: add get/set_cmdline_auth_info_domain to user_auth_info struct.
authorGünther Deschner <gd@samba.org>
Thu, 10 Sep 2009 20:53:44 +0000 (22:53 +0200)
committerGünther Deschner <gd@samba.org>
Thu, 10 Sep 2009 22:36:59 +0000 (00:36 +0200)
Guenther

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

index ae8378f28b44581771eae6331702bd9ec3fb299a..7237ca67540185638e265ad0da91682f75f4c7d8 100644 (file)
@@ -47,6 +47,7 @@ extern const struct poptOption popt_common_dynconfig[];
 
 struct user_auth_info {
        char *username;
+       char *domain;
        char *password;
        bool got_pass;
        bool use_kerberos;
index be5cfe11411b7cd3019e6962edb057db37c9bacd..5c584682616e1543effa8b9deeaaf4a58996b883 100644 (file)
@@ -1090,6 +1090,9 @@ struct user_auth_info *user_auth_info_init(TALLOC_CTX *mem_ctx);
 const char *get_cmdline_auth_info_username(const struct user_auth_info *auth_info);
 void set_cmdline_auth_info_username(struct user_auth_info *auth_info,
                                    const char *username);
+const char *get_cmdline_auth_info_domain(const struct user_auth_info *auth_info);
+void set_cmdline_auth_info_domain(struct user_auth_info *auth_info,
+                                 const char *domain);
 void set_cmdline_auth_info_password(struct user_auth_info *auth_info,
                                    const char *password);
 const char *get_cmdline_auth_info_password(const struct user_auth_info *auth_info);
index ae630826d4f4e9b47dfadee67eb58267d31c525d..b066a0d3464c6da5b3c569b746ee7f6517956fb0 100644 (file)
@@ -308,6 +308,24 @@ void set_cmdline_auth_info_username(struct user_auth_info *auth_info,
        }
 }
 
+const char *get_cmdline_auth_info_domain(const struct user_auth_info *auth_info)
+{
+       if (!auth_info->domain) {
+               return "";
+       }
+       return auth_info->domain;
+}
+
+void set_cmdline_auth_info_domain(struct user_auth_info *auth_info,
+                                 const char *domain)
+{
+       TALLOC_FREE(auth_info->domain);
+       auth_info->domain = talloc_strdup(auth_info, domain);
+       if (!auth_info->domain) {
+               exit(ENOMEM);
+       }
+}
+
 const char *get_cmdline_auth_info_password(const struct user_auth_info *auth_info)
 {
        if (!auth_info->password) {