OS_version constant update

Matthieu Patou mat at samba.org
Sat Jul 31 13:15:14 MDT 2010


  On 31/07/2010 22:36, Matthias Dieter WallnXXfer wrote:
> The branch, master has been updated
>         via  f5f236a... s4:dcesrv_netr_LogonGetDomainInfo - improve the client OS informations update
>        from  76e5d41... s4:blackbox/newuser: use test specific user names
>
> http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
>
Thanks !
I'm eager to test it !

Matthieu.
> - Log -----------------------------------------------------------------
> commit f5f236a4b9943a3b44dea40940c3cb00960e669e
> Author: Matthias Dieter Wallnöfer<mdw at samba.org>
> Date:   Sat Jul 31 14:52:44 2010 +0200
>
>      s4:dcesrv_netr_LogonGetDomainInfo - improve the client OS informations update
>
>      As ekacnet pointed out on the mailing list we don't need to do a delete if we
>      (re)set the values afterwards - only if we don't set any new ones.
>
> -----------------------------------------------------------------------
>
> Summary of changes:
>   source4/rpc_server/netlogon/dcerpc_netlogon.c |   27 +++++++-----------------
>   1 files changed, 8 insertions(+), 19 deletions(-)
>
>
> Changeset truncated at 500 lines:
>
> diff --git a/source4/rpc_server/netlogon/dcerpc_netlogon.c b/source4/rpc_server/netlogon/dcerpc_netlogon.c
> index 1a765d9..226a064 100644
> --- a/source4/rpc_server/netlogon/dcerpc_netlogon.c
> +++ b/source4/rpc_server/netlogon/dcerpc_netlogon.c
> @@ -1305,24 +1305,7 @@ static NTSTATUS dcesrv_netr_LogonGetDomainInfo(struct dcesrv_call_state *dce_cal
>   			update_dns_hostname = false;
>   		}
>
> -		/* Gets host informations and put them in our directory */
> -		new_msg = ldb_msg_new(mem_ctx);
> -		NT_STATUS_HAVE_NO_MEMORY(new_msg);
> -
> -		new_msg->dn = workstation_dn;
> -
> -		/* Deletes old OS version values */
> -		samdb_msg_add_delete(sam_ctx, mem_ctx, new_msg,
> -			"operatingSystemServicePack");
> -		samdb_msg_add_delete(sam_ctx, mem_ctx, new_msg,
> -			"operatingSystemVersion");
> -
> -		if (dsdb_replace(sam_ctx, new_msg, 0) != LDB_SUCCESS) {
> -			DEBUG(3,("Impossible to update samdb: %s\n",
> -				ldb_errstring(sam_ctx)));
> -		}
> -
> -		talloc_free(new_msg);
> +		/* Gets host informations and put them into our directory */
>
>   		new_msg = ldb_msg_new(mem_ctx);
>   		NT_STATUS_HAVE_NO_MEMORY(new_msg);
> @@ -1335,7 +1318,7 @@ static NTSTATUS dcesrv_netr_LogonGetDomainInfo(struct dcesrv_call_state *dce_cal
>   			r->in.query->workstation_info->os_name.string);
>
>   		/*
> -		 * Sets informations from "os_version". On a empty structure
> +		 * Sets informations from "os_version". On an empty structure
>   		 * the values are cleared.
>   		 */
>   		if (r->in.query->workstation_info->os_version.os != NULL) {
> @@ -1353,6 +1336,12 @@ static NTSTATUS dcesrv_netr_LogonGetDomainInfo(struct dcesrv_call_state *dce_cal
>   					os_version->BuildNumber
>   				)
>   			);
> +		} else {
> +			samdb_msg_add_delete(sam_ctx, mem_ctx, new_msg,
> +					     "operatingSystemServicePack");
> +
> +			samdb_msg_add_delete(sam_ctx, mem_ctx, new_msg,
> +					     "operatingSystemVersion");
>   		}
>
>   		/*
>
>


-- 
Matthieu Patou
Samba Team        http://samba.org



More information about the samba-technical mailing list