1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

smbXsrv_version: Modernize DEBUG statements

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Volker Lendecke 2024-02-10 10:29:35 +01:00
parent 97896fa7e5
commit 90bd197dd5

View File

@ -88,9 +88,9 @@ NTSTATUS smbXsrv_version_global_init(const struct server_id *server_id)
DBWRAP_FLAG_NONE);
if (db_ctx == NULL) {
status = map_nt_error_from_unix_common(errno);
DEBUG(0,("smbXsrv_version_global_init: "
"failed to open[%s] - %s\n",
global_path, nt_errstr(status)));
DBG_ERR("failed to open[%s] - %s\n",
global_path,
nt_errstr(status));
TALLOC_FREE(frame);
return status;
}
@ -100,9 +100,10 @@ NTSTATUS smbXsrv_version_global_init(const struct server_id *server_id)
db_rec = dbwrap_fetch_locked(db_ctx, db_ctx, key);
if (db_rec == NULL) {
status = NT_STATUS_INTERNAL_DB_ERROR;
DEBUG(0,("smbXsrv_version_global_init: "
"dbwrap_fetch_locked(%s) - %s\n",
key_string, nt_errstr(status)));
DBG_ERR("dbwrap_fetch_locked(%s) - %s\n",
key_string,
nt_errstr(status));
TALLOC_FREE(frame);
return status;
}
@ -111,8 +112,7 @@ NTSTATUS smbXsrv_version_global_init(const struct server_id *server_id)
if (val.dsize == 0) {
global = talloc_zero(frame, struct smbXsrv_version_global0);
if (global == NULL) {
DEBUG(0,("smbXsrv_version_global_init: "
"talloc_zero failed - %s\n", __location__));
DBG_ERR("talloc_zero failed - %s\n", __location__);
TALLOC_FREE(frame);
return NT_STATUS_NO_MEMORY;
}
@ -126,9 +126,8 @@ NTSTATUS smbXsrv_version_global_init(const struct server_id *server_id)
(ndr_pull_flags_fn_t)ndr_pull_smbXsrv_version_globalB);
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
status = ndr_map_error2ntstatus(ndr_err);
DEBUG(0,("smbXsrv_version_global_init: "
"ndr_pull_smbXsrv_version_globalB - %s\n",
nt_errstr(status)));
DBG_ERR("ndr_pull_smbXsrv_version_globalB - %s\n",
nt_errstr(status));
TALLOC_FREE(frame);
return status;
}
@ -148,8 +147,7 @@ NTSTATUS smbXsrv_version_global_init(const struct server_id *server_id)
}
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("smbXsrv_version_global_init - %s\n",
nt_errstr(status)));
DBG_ERR("%s\n", nt_errstr(status));
NDR_PRINT_DEBUG(smbXsrv_version_globalB, &global_blob);
TALLOC_FREE(frame);
return status;
@ -160,8 +158,7 @@ NTSTATUS smbXsrv_version_global_init(const struct server_id *server_id)
struct smbXsrv_version_node0,
global->num_nodes + 1);
if (valid == NULL) {
DEBUG(0,("smbXsrv_version_global_init: "
"talloc_zero_array failed - %s\n", __location__));
DBG_ERR("talloc_zero_array failed - %s\n", __location__);
TALLOC_FREE(frame);
return NT_STATUS_NO_MEMORY;
}
@ -177,8 +174,7 @@ NTSTATUS smbXsrv_version_global_init(const struct server_id *server_id)
if (n->min_version > n->max_version) {
status = NT_STATUS_INTERNAL_DB_CORRUPTION;
DEBUG(0,("smbXsrv_version_global_init - %s\n",
nt_errstr(status)));
DBG_ERR("%s\n", nt_errstr(status));
NDR_PRINT_DEBUG(smbXsrv_version_globalB, &global_blob);
TALLOC_FREE(frame);
return status;
@ -186,8 +182,7 @@ NTSTATUS smbXsrv_version_global_init(const struct server_id *server_id)
if (n->min_version > global_blob.version) {
status = NT_STATUS_INTERNAL_DB_CORRUPTION;
DEBUG(0,("smbXsrv_version_global_init - %s\n",
nt_errstr(status)));
DBG_ERR("%s\n", nt_errstr(status));
NDR_PRINT_DEBUG(smbXsrv_version_globalB, &global_blob);
TALLOC_FREE(frame);
return status;
@ -195,8 +190,7 @@ NTSTATUS smbXsrv_version_global_init(const struct server_id *server_id)
if (n->max_version < global_blob.version) {
status = NT_STATUS_INTERNAL_DB_CORRUPTION;
DEBUG(0,("smbXsrv_version_global_init - %s\n",
nt_errstr(status)));
DBG_ERR("%s\n", nt_errstr(status));
NDR_PRINT_DEBUG(smbXsrv_version_globalB, &global_blob);
TALLOC_FREE(frame);
return status;
@ -229,9 +223,8 @@ NTSTATUS smbXsrv_version_global_init(const struct server_id *server_id)
(ndr_push_flags_fn_t)ndr_push_smbXsrv_version_globalB);
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
status = ndr_map_error2ntstatus(ndr_err);
DEBUG(0,("smbXsrv_version_global_init: "
"ndr_push_smbXsrv_version_globalB - %s\n",
nt_errstr(status)));
DBG_ERR("ndr_push_smbXsrv_version_globalB - %s\n",
nt_errstr(status));
TALLOC_FREE(frame);
return status;
}
@ -240,14 +233,12 @@ NTSTATUS smbXsrv_version_global_init(const struct server_id *server_id)
status = dbwrap_record_store(db_rec, val, TDB_REPLACE);
TALLOC_FREE(db_rec);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("smbXsrv_version_global_init: "
"dbwrap_record_store - %s\n",
nt_errstr(status)));
DBG_ERR("dbwrap_record_store - %s\n", nt_errstr(status));
TALLOC_FREE(frame);
return status;
}
DEBUG(10,("smbXsrv_version_global_init\n"));
DBG_DEBUG("\n");
if (DEBUGLVL(10)) {
NDR_PRINT_DEBUG(smbXsrv_version_globalB, &global_blob);
}