Add error_string to libnetjoin and libnetunjoin structures incl. set functions.
authorGünther Deschner <gd@samba.org>
Mon, 7 Jan 2008 17:46:07 +0000 (18:46 +0100)
committerGünther Deschner <gd@samba.org>
Mon, 7 Jan 2008 18:38:48 +0000 (19:38 +0100)
Guenther

source/libnet/libnet_join.c
source/libnet/libnet_join.h

index 36d5c0a8897b6adfc160c34fe8f1ebd62c8d66b1..95088606a2da65483c191e3ff23e78699f04e6a8 100644 (file)
 #include "libnet/libnet_join.h"
 #include "libnet/libnet_proto.h"
 
+/****************************************************************
+****************************************************************/
+
+static void libnet_join_set_error_string(TALLOC_CTX *mem_ctx,
+                                        struct libnet_JoinCtx *r,
+                                        const char *format, ...)
+{
+       va_list args;
+       char *tmp = NULL;
+
+       va_start(args, format);
+       tmp = talloc_vasprintf(mem_ctx, format, args);
+       va_end(args);
+
+       TALLOC_FREE(r->out.error_string);
+       r->out.error_string = tmp;
+}
+
+/****************************************************************
+****************************************************************/
+
+static void libnet_unjoin_set_error_string(TALLOC_CTX *mem_ctx,
+                                          struct libnet_UnjoinCtx *r,
+                                          const char *format, ...)
+{
+       va_list args;
+       char *tmp = NULL;
+
+       va_start(args, format);
+       tmp = talloc_vasprintf(mem_ctx, format, args);
+       va_end(args);
+
+       TALLOC_FREE(r->out.error_string);
+       r->out.error_string = tmp;
+}
+
 static bool libnet_join_joindomain_store_secrets(TALLOC_CTX *mem_ctx,
                                                 struct libnet_JoinCtx *r)
 {
index 9e7b8a9813bf022c9cabb0dd18f34b760b5e7f26..ac1fe6efcb015d7990d7c1409af3e55b6527f323 100644 (file)
@@ -44,6 +44,7 @@ struct libnet_JoinCtx {
                struct dom_sid *domain_sid;
                bool modified_config;
                WERROR result;
+               char *error_string;
        } out;
 };
 
@@ -61,6 +62,7 @@ struct libnet_UnjoinCtx {
        struct {
                bool modified_config;
                WERROR result;
+               char *error_string;
        } out;
 };