summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-07-31 14:52:44 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-07-31 20:44:29 +0200
commitf5f236a4b9943a3b44dea40940c3cb00960e669e (patch)
treee8cb0f2ed0708b77f6978c3a44fbec5080367f1f /source4
parent76e5d41d6a887e598bef8ec57ddc405c368acc00 (diff)
downloadsamba-f5f236a4b9943a3b44dea40940c3cb00960e669e.tar.gz
samba-f5f236a4b9943a3b44dea40940c3cb00960e669e.tar.bz2
samba-f5f236a4b9943a3b44dea40940c3cb00960e669e.zip
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.
Diffstat (limited to 'source4')
-rw-r--r--source4/rpc_server/netlogon/dcerpc_netlogon.c27
1 files changed, 8 insertions, 19 deletions
diff --git a/source4/rpc_server/netlogon/dcerpc_netlogon.c b/source4/rpc_server/netlogon/dcerpc_netlogon.c
index 1a765d93af..226a0640bb 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");
}
/*