Author: jerry Date: 2006-05-14 12:58:52 +0000 (Sun, 14 May 2006) New Revision: 15597
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=15597 Log: more ads join fixes -- we can only set the PWDNOEXP and DES_ONLY acb flags on the setuserinfo(), not the createuser info call Modified: branches/SAMBA_3_0/source/utils/net_ads.c trunk/source/utils/net_ads.c Changeset: Modified: branches/SAMBA_3_0/source/utils/net_ads.c =================================================================== --- branches/SAMBA_3_0/source/utils/net_ads.c 2006-05-14 11:43:33 UTC (rev 15596) +++ branches/SAMBA_3_0/source/utils/net_ads.c 2006-05-14 12:58:52 UTC (rev 15597) @@ -917,7 +917,7 @@ uint32 user_rid; uint32 num_rids, *name_types, *user_rids; uint32 flags = 0x3e8; - uint32 acb_info = ACB_WSTRUST | ACB_PWNOEXP; + uint32 acb_info = ACB_WSTRUST; uchar pwbuf[516]; SAM_USERINFO_CTR ctr; SAM_USER_INFO_24 p24; @@ -949,9 +949,7 @@ strlower_m(acct_name); const_acct_name = acct_name; -#ifndef ENCTYPE_ARCFOUR_HMAC - acb_info |= ACB_USE_DES_KEY_ONLY; -#endif + /* Don't try to set any acb_info flags other than ACB_WSTRUST */ status = rpccli_samr_create_dom_user(pipe_hnd, mem_ctx, &domain_pol, acct_name, acb_info, 0xe005000b, &user_pol, &user_rid); @@ -1026,11 +1024,15 @@ ctr.switch_value = 16; ctr.info.id16 = &p16; + /* Fill in the additional account flags now */ + + acb_info |= ACB_PWNOEXP; +#ifndef ENCTYPE_ARCFOUR_HMAC + acb_info |= ACB_USE_DES_KEY_ONLY; +#endif + init_sam_user_info16(&p16, acb_info); - /* Ignoring the return value is necessary for joining a domain - as a normal user with "Add workstation to domain" privilege. */ - status = rpccli_samr_set_userinfo2(pipe_hnd, mem_ctx, &user_pol, 16, &cli->user_session_key, &ctr); Modified: trunk/source/utils/net_ads.c =================================================================== --- trunk/source/utils/net_ads.c 2006-05-14 11:43:33 UTC (rev 15596) +++ trunk/source/utils/net_ads.c 2006-05-14 12:58:52 UTC (rev 15597) @@ -917,7 +917,7 @@ uint32 user_rid; uint32 num_rids, *name_types, *user_rids; uint32 flags = 0x3e8; - uint32 acb_info = ACB_WSTRUST | ACB_PWNOEXP; + uint32 acb_info = ACB_WSTRUST; uchar pwbuf[516]; SAM_USERINFO_CTR ctr; SAM_USER_INFO_24 p24; @@ -949,9 +949,7 @@ strlower_m(acct_name); const_acct_name = acct_name; -#ifndef ENCTYPE_ARCFOUR_HMAC - acb_info |= ACB_USE_DES_KEY_ONLY; -#endif + /* Don't try to set any acb_info flags other than ACB_WSTRUST */ status = rpccli_samr_create_dom_user(pipe_hnd, mem_ctx, &domain_pol, acct_name, acb_info, 0xe005000b, &user_pol, &user_rid); @@ -1026,11 +1024,15 @@ ctr.switch_value = 16; ctr.info.id16 = &p16; + /* Fill in the additional account flags now */ + + acb_info |= ACB_PWNOEXP; +#ifndef ENCTYPE_ARCFOUR_HMAC + acb_info |= ACB_USE_DES_KEY_ONLY; +#endif + init_sam_user_info16(&p16, acb_info); - /* Ignoring the return value is necessary for joining a domain - as a normal user with "Add workstation to domain" privilege. */ - status = rpccli_samr_set_userinfo2(pipe_hnd, mem_ctx, &user_pol, 16, &cli->user_session_key, &ctr);
