Author: jerry
Date: 2006-06-15 12:40:56 +0000 (Thu, 15 Jun 2006)
New Revision: 16256

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=16256

Log:
sync up to r16255 from SAMBA_3_0
Modified:
   branches/SAMBA_3_0_RELEASE/WHATSNEW.txt
   branches/SAMBA_3_0_RELEASE/source/rpc_client/cli_pipe.c
   branches/SAMBA_3_0_RELEASE/source/utils/pdbedit.c


Changeset:
Modified: branches/SAMBA_3_0_RELEASE/WHATSNEW.txt
===================================================================
--- branches/SAMBA_3_0_RELEASE/WHATSNEW.txt     2006-06-15 12:37:05 UTC (rev 
16255)
+++ branches/SAMBA_3_0_RELEASE/WHATSNEW.txt     2006-06-15 12:40:56 UTC (rev 
16256)
@@ -36,6 +36,8 @@
 
 o   Gerald (Jerry) Carter <[EMAIL PROTECTED]>
     * Fix 'make install' problem when building outside source/.
+    * Fix 'net ads join' when the workgroup is set incorrectly in 
+      smb.conf.
 
 
 o   Guenther Deschner <[EMAIL PROTECTED]>

Modified: branches/SAMBA_3_0_RELEASE/source/rpc_client/cli_pipe.c
===================================================================
--- branches/SAMBA_3_0_RELEASE/source/rpc_client/cli_pipe.c     2006-06-15 
12:37:05 UTC (rev 16255)
+++ branches/SAMBA_3_0_RELEASE/source/rpc_client/cli_pipe.c     2006-06-15 
12:40:56 UTC (rev 16256)
@@ -2446,15 +2446,18 @@
                return NULL;
        }
 
+       /* A DC should use DOMAIN$ as its account name.
+          A member server can only use it's machine name since it
+          does not have an account in a trusted domain.
+
+          We don't check the domain against lp_workgroup() here since
+          'net ads join' has to continue to work with only the realm
+          specified in smb.conf.  -- jerry */
+
         if ( IS_DC && !strequal(domain, lp_workgroup()) && 
lp_allow_trusted_domains()) {
                fstrcpy( machine_account, lp_workgroup() );
         } else {
-                /* Hmmm. Is this correct for trusted domains when we're a 
member server ? JRA. */
-                if (strequal(domain, lp_workgroup())) {
-                        fstrcpy(machine_account, global_myname());
-                } else {
-                        fstrcpy(machine_account, domain);
-                }
+               fstrcpy(machine_account, global_myname());
         }
 
        *perr = rpccli_netlogon_setup_creds(netlogon_pipe,
@@ -2716,9 +2719,9 @@
                return NULL;
        }
 
-       /* Default service principal is "host/[EMAIL PROTECTED]" */
+       /* Default service principal is "[EMAIL PROTECTED]" */
        if (!service_princ) {
-               service_princ = talloc_asprintf(result->mem_ctx, "host/[EMAIL 
PROTECTED]",
+               service_princ = talloc_asprintf(result->mem_ctx, "[EMAIL 
PROTECTED]",
                        cli->desthost, lp_realm() );
                if (!service_princ) {
                        cli_rpc_pipe_close(result);

Modified: branches/SAMBA_3_0_RELEASE/source/utils/pdbedit.c
===================================================================
--- branches/SAMBA_3_0_RELEASE/source/utils/pdbedit.c   2006-06-15 12:37:05 UTC 
(rev 16255)
+++ branches/SAMBA_3_0_RELEASE/source/utils/pdbedit.c   2006-06-15 12:40:56 UTC 
(rev 16256)
@@ -628,6 +628,11 @@
        
        get_global_sam_sid();
 
+       if (strlen(machine_in) == 0) {
+               fprintf(stderr, "No machine name given\n");
+               return -1;
+       }
+
        fstrcpy(machinename, machine_in); 
        machinename[15]= '\0';
 
@@ -708,6 +713,11 @@
 {
        fstring name;
        struct samu *samaccount = NULL;
+
+       if (strlen(machinename) == 0) {
+               fprintf(stderr, "No machine name given\n");
+               return -1;
+       }
        
        fstrcpy(name, machinename);
        name[15] = '\0';

Reply via email to