[PATCH] Small update for libnet

Jeremy Allison jra at samba.org
Wed Oct 5 18:47:36 UTC 2016


On Wed, Oct 05, 2016 at 08:15:15AM +0200, Andreas Schneider wrote:
> Review and push appreciated!

LGTM - pushed !


> 
> 	Andreas
> 
> -- 
> Andreas Schneider                   GPG-ID: CC014E3D
> Samba Team                             asn at samba.org
> www.samba.org

> From 40e0dfcc99a596a5eeaa48d760cc91cbf95979b3 Mon Sep 17 00:00:00 2001
> From: Andreas Schneider <asn at samba.org>
> Date: Tue, 4 Oct 2016 18:09:54 +0200
> Subject: [PATCH 1/2] s4-libnet: Use SetUserInfo2 to set the account flags
> 
> [MS-WKST] states that SetUserInfo2 should be used to set the account
> flags. We already call this a few lines down to set the password.
> 
> Signed-off-by: Andreas Schneider <asn at samba.org>
> ---
>  source3/libnet/libnet_join.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c
> index 86130ca..9436cc9 100644
> --- a/source3/libnet/libnet_join.c
> +++ b/source3/libnet/libnet_join.c
> @@ -1413,11 +1413,11 @@ static NTSTATUS libnet_join_joindomain_rpc(TALLOC_CTX *mem_ctx,
>  	ZERO_STRUCT(user_info.info16);
>  	user_info.info16.acct_flags = acct_flags;
>  
> -	status = dcerpc_samr_SetUserInfo(b, mem_ctx,
> -					 &user_pol,
> -					 16,
> -					 &user_info,
> -					 &result);
> +	status = dcerpc_samr_SetUserInfo2(b, mem_ctx,
> +					  &user_pol,
> +					  16,
> +					  &user_info,
> +					  &result);
>  	if (!NT_STATUS_IS_OK(status)) {
>  		dcerpc_samr_DeleteUser(b, mem_ctx,
>  				       &user_pol,
> -- 
> 2.10.0
> 
> 
> From 4e73e6e2e0386381cc055052c4692c020ec18c1e Mon Sep 17 00:00:00 2001
> From: Andreas Schneider <asn at samba.org>
> Date: Tue, 4 Oct 2016 18:14:50 +0200
> Subject: [PATCH 2/2] s3-libnet: Pass enum value names to
>  dcerpc_samr_SetUserInfo2()
> 
> Signed-off-by: Andreas Schneider <asn at samba.org>
> ---
>  source3/libnet/libnet_join.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c
> index 9436cc9..3ac7f39 100644
> --- a/source3/libnet/libnet_join.c
> +++ b/source3/libnet/libnet_join.c
> @@ -1415,7 +1415,7 @@ static NTSTATUS libnet_join_joindomain_rpc(TALLOC_CTX *mem_ctx,
>  
>  	status = dcerpc_samr_SetUserInfo2(b, mem_ctx,
>  					  &user_pol,
> -					  16,
> +					  UserControlInformation,
>  					  &user_info,
>  					  &result);
>  	if (!NT_STATUS_IS_OK(status)) {
> @@ -1459,7 +1459,7 @@ static NTSTATUS libnet_join_joindomain_rpc(TALLOC_CTX *mem_ctx,
>  
>  	status = dcerpc_samr_SetUserInfo2(b, mem_ctx,
>  					  &user_pol,
> -					  26,
> +					  UserInternal5InformationNew,
>  					  &user_info,
>  					  &result);
>  
> @@ -1476,7 +1476,7 @@ static NTSTATUS libnet_join_joindomain_rpc(TALLOC_CTX *mem_ctx,
>  
>  		status = dcerpc_samr_SetUserInfo2(b, mem_ctx,
>  						  &user_pol,
> -						  24,
> +						  UserInternal5Information,
>  						  &user_info,
>  						  &result);
>  	}
> -- 
> 2.10.0
> 




More information about the samba-technical mailing list