netapi: use NETSETUP join flags in examples.
authorGünther Deschner <gd@samba.org>
Fri, 29 Aug 2008 10:52:23 +0000 (12:52 +0200)
committerGünther Deschner <gd@samba.org>
Fri, 29 Aug 2008 11:58:06 +0000 (13:58 +0200)
Guenther
(This used to be commit 2f6f888d9cf89abf55767dc43a9e3d5de68bbcfb)

source3/lib/netapi/examples/netdomjoin-gui/netdomjoin-gui.c
source3/lib/netapi/examples/netdomjoin/netdomjoin.c
source3/utils/net_dom.c

index 418b9c8b8e665cb535cfb8f234011d8f8249ff66..970f8cf9f28b4476c2868aad8103c1fd63f07f24 100644 (file)
 #define SAMBA_IMAGE_PATH "/usr/share/pixmaps/samba/logo.png"
 #define SAMBA_IMAGE_PATH_SMALL "/usr/share/pixmaps/samba/logo-small.png"
 
-#define WKSSVC_JOIN_FLAGS_DOMAIN_JOIN_IF_JOINED ( 0x00000020 )
-#define WKSSVC_JOIN_FLAGS_ACCOUNT_DELETE ( 0x00000004 )
-#define WKSSVC_JOIN_FLAGS_ACCOUNT_CREATE ( 0x00000002 )
-#define WKSSVC_JOIN_FLAGS_JOIN_TYPE ( 0x00000001 )
-
 #define NetSetupWorkgroupName ( 2 )
 #define NetSetupDomainName ( 3 )
 
@@ -631,9 +626,9 @@ static void callback_do_join(GtkWidget *widget,
        if (state->name_type_new == NetSetupDomainName) {
                domain_join = TRUE;
                join_creds_required = TRUE;
-               join_flags = WKSSVC_JOIN_FLAGS_JOIN_TYPE |
-                            WKSSVC_JOIN_FLAGS_ACCOUNT_CREATE |
-                            WKSSVC_JOIN_FLAGS_DOMAIN_JOIN_IF_JOINED; /* for testing */
+               join_flags = NETSETUP_JOIN_DOMAIN |
+                            NETSETUP_ACCT_CREATE |
+                            NETSETUP_DOMAIN_JOIN_IF_JOINED; /* for testing */
        }
 
        if ((state->name_type_initial == NetSetupDomainName) &&
@@ -641,8 +636,8 @@ static void callback_do_join(GtkWidget *widget,
                try_unjoin = TRUE;
                unjoin_creds_required = TRUE;
                join_creds_required = FALSE;
-               unjoin_flags = WKSSVC_JOIN_FLAGS_JOIN_TYPE |
-                              WKSSVC_JOIN_FLAGS_ACCOUNT_DELETE;
+               unjoin_flags = NETSETUP_JOIN_DOMAIN |
+                              NETSETUP_ACCT_DELETE;
        }
 
        if (try_unjoin) {
index bd7c36382a85a0272fb8d32f7b491593ca126923..08ce71b938ff50fb7c6b54a543154795d282dcc1 100644 (file)
@@ -39,7 +39,9 @@ int main(int argc, const char **argv)
        const char *account_ou = NULL;
        const char *account = NULL;
        const char *password = NULL;
-       uint32_t join_flags = 0x00000023;
+       uint32_t join_flags = NETSETUP_JOIN_DOMAIN |
+                             NETSETUP_ACCT_CREATE |
+                             NETSETUP_DOMAIN_JOIN_IF_JOINED;
        struct libnetapi_ctx *ctx = NULL;
 
        poptContext pc;
index f13b9c23d047d1735d13108db58dc691975f92bf..5544cf8a2da50a2609c459e9521c3ee5437ef7ba 100644 (file)
@@ -37,8 +37,8 @@ static int net_dom_unjoin(struct net_context *c, int argc, const char **argv)
        const char *server_name = NULL;
        const char *account = NULL;
        const char *password = NULL;
-       uint32_t unjoin_flags = WKSSVC_JOIN_FLAGS_ACCOUNT_DELETE |
-                               WKSSVC_JOIN_FLAGS_JOIN_TYPE;
+       uint32_t unjoin_flags = NETSETUP_ACCT_DELETE |
+                               NETSETUP_JOIN_DOMAIN;
        struct cli_state *cli = NULL;
        bool do_reboot = false;
        NTSTATUS ntstatus;
@@ -125,8 +125,8 @@ static int net_dom_join(struct net_context *c, int argc, const char **argv)
        const char *account_ou = NULL;
        const char *Account = NULL;
        const char *password = NULL;
-       uint32_t join_flags = WKSSVC_JOIN_FLAGS_ACCOUNT_CREATE |
-                             WKSSVC_JOIN_FLAGS_JOIN_TYPE;
+       uint32_t join_flags = NETSETUP_ACCT_CREATE |
+                             NETSETUP_JOIN_DOMAIN;
        struct cli_state *cli = NULL;
        bool do_reboot = false;
        NTSTATUS ntstatus;