From: Joseph Sutton Date: Mon, 31 Jul 2023 04:18:17 +0000 (+1200) Subject: s4:dsdb: Add missing newlines to logging messages X-Git-Tag: tevent-0.16.0~1223 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=abcfaa79d064319174bd42bcd2d1b0f8ea8f4406;p=thirdparty%2Fsamba.git s4:dsdb: Add missing newlines to logging messages Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- diff --git a/source4/dsdb/common/dsdb_access.c b/source4/dsdb/common/dsdb_access.c index 5c02daa7d0b..e1bc3d77d21 100644 --- a/source4/dsdb/common/dsdb_access.c +++ b/source4/dsdb/common/dsdb_access.c @@ -44,9 +44,9 @@ void dsdb_acl_debug(struct security_descriptor *sd, int level) { if (denied) { - DEBUG(level, ("Access on %s denied", ldb_dn_get_linearized(dn))); + DEBUG(level, ("Access on %s denied\n", ldb_dn_get_linearized(dn))); } else { - DEBUG(level, ("Access on %s granted", ldb_dn_get_linearized(dn))); + DEBUG(level, ("Access on %s granted\n", ldb_dn_get_linearized(dn))); } DEBUG(level,("Security context: %s\n", diff --git a/source4/dsdb/common/dsdb_dn.c b/source4/dsdb/common/dsdb_dn.c index f6ee6893f0e..d40750a0376 100644 --- a/source4/dsdb/common/dsdb_dn.c +++ b/source4/dsdb/common/dsdb_dn.c @@ -244,7 +244,7 @@ struct dsdb_dn *dsdb_dn_parse(TALLOC_CTX *mem_ctx, struct ldb_context *ldb, return NULL; } if (ldb_dn_validate(dsdb_dn->dn) == false) { - DEBUG(10, ("could not parse %.*s as a %s DN", + DEBUG(10, ("could not parse %.*s as a %s DN\n", (int)dn_blob->length, dn_blob->data, dn_oid)); return NULL; diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c index 7b771a1a5c3..716a9c68072 100644 --- a/source4/dsdb/common/util.c +++ b/source4/dsdb/common/util.c @@ -3775,7 +3775,7 @@ int samdb_dns_host_name(struct ldb_context *sam_ctx, const char **host_name) ret = dsdb_search_dn(sam_ctx, tmp_ctx, &res, NULL, attrs, 0); if (res == NULL || res->count != 1 || ret != LDB_SUCCESS) { - DEBUG(0, ("Failed to get rootDSE for dnsHostName: %s", + DEBUG(0, ("Failed to get rootDSE for dnsHostName: %s\n", ldb_errstring(sam_ctx))); TALLOC_FREE(tmp_ctx); return ret; @@ -3785,7 +3785,7 @@ int samdb_dns_host_name(struct ldb_context *sam_ctx, const char **host_name) "dnsHostName", NULL); if (_host_name == NULL) { - DEBUG(0, ("Failed to get dnsHostName from rootDSE")); + DEBUG(0, ("Failed to get dnsHostName from rootDSE\n")); TALLOC_FREE(tmp_ctx); return LDB_ERR_OPERATIONS_ERROR; } @@ -5742,7 +5742,7 @@ WERROR dsdb_get_fsmo_role_info(TALLOC_CTX *tmp_ctx, *fsmo_role_dn = samdb_partitions_dn(ldb, tmp_ctx); ret = samdb_reference_dn(ldb, tmp_ctx, *fsmo_role_dn, "fSMORoleOwner", role_owner_dn); if (ret != LDB_SUCCESS) { - DEBUG(0,(__location__ ": Failed to find fSMORoleOwner in Naming Master object - %s", + DEBUG(0,(__location__ ": Failed to find fSMORoleOwner in Naming Master object - %s\n", ldb_errstring(ldb))); talloc_free(tmp_ctx); return WERR_DS_DRA_INTERNAL_ERROR; @@ -5752,7 +5752,7 @@ WERROR dsdb_get_fsmo_role_info(TALLOC_CTX *tmp_ctx, *fsmo_role_dn = samdb_infrastructure_dn(ldb, tmp_ctx); ret = samdb_reference_dn(ldb, tmp_ctx, *fsmo_role_dn, "fSMORoleOwner", role_owner_dn); if (ret != LDB_SUCCESS) { - DEBUG(0,(__location__ ": Failed to find fSMORoleOwner in Schema Master object - %s", + DEBUG(0,(__location__ ": Failed to find fSMORoleOwner in Schema Master object - %s\n", ldb_errstring(ldb))); talloc_free(tmp_ctx); return WERR_DS_DRA_INTERNAL_ERROR; @@ -5761,14 +5761,14 @@ WERROR dsdb_get_fsmo_role_info(TALLOC_CTX *tmp_ctx, case DREPL_RID_MASTER: ret = samdb_rid_manager_dn(ldb, tmp_ctx, fsmo_role_dn); if (ret != LDB_SUCCESS) { - DEBUG(0, (__location__ ": Failed to find RID Manager object - %s", ldb_errstring(ldb))); + DEBUG(0, (__location__ ": Failed to find RID Manager object - %s\n", ldb_errstring(ldb))); talloc_free(tmp_ctx); return WERR_DS_DRA_INTERNAL_ERROR; } ret = samdb_reference_dn(ldb, tmp_ctx, *fsmo_role_dn, "fSMORoleOwner", role_owner_dn); if (ret != LDB_SUCCESS) { - DEBUG(0,(__location__ ": Failed to find fSMORoleOwner in RID Manager object - %s", + DEBUG(0,(__location__ ": Failed to find fSMORoleOwner in RID Manager object - %s\n", ldb_errstring(ldb))); talloc_free(tmp_ctx); return WERR_DS_DRA_INTERNAL_ERROR; @@ -5778,7 +5778,7 @@ WERROR dsdb_get_fsmo_role_info(TALLOC_CTX *tmp_ctx, *fsmo_role_dn = ldb_get_schema_basedn(ldb); ret = samdb_reference_dn(ldb, tmp_ctx, *fsmo_role_dn, "fSMORoleOwner", role_owner_dn); if (ret != LDB_SUCCESS) { - DEBUG(0,(__location__ ": Failed to find fSMORoleOwner in Schema Master object - %s", + DEBUG(0,(__location__ ": Failed to find fSMORoleOwner in Schema Master object - %s\n", ldb_errstring(ldb))); talloc_free(tmp_ctx); return WERR_DS_DRA_INTERNAL_ERROR; @@ -5788,7 +5788,7 @@ WERROR dsdb_get_fsmo_role_info(TALLOC_CTX *tmp_ctx, *fsmo_role_dn = ldb_get_default_basedn(ldb); ret = samdb_reference_dn(ldb, tmp_ctx, *fsmo_role_dn, "fSMORoleOwner", role_owner_dn); if (ret != LDB_SUCCESS) { - DEBUG(0,(__location__ ": Failed to find fSMORoleOwner in Pd Master object - %s", + DEBUG(0,(__location__ ": Failed to find fSMORoleOwner in Pd Master object - %s\n", ldb_errstring(ldb))); talloc_free(tmp_ctx); return WERR_DS_DRA_INTERNAL_ERROR; @@ -5813,7 +5813,7 @@ const char *samdb_dn_to_dnshostname(struct ldb_context *ldb, LDB_SCOPE_BASE, attrs, NULL); if (ldb_ret != LDB_SUCCESS) { - DEBUG(4, ("Failed to find dNSHostName for dn %s, ldb error: %s", + DEBUG(4, ("Failed to find dNSHostName for dn %s, ldb error: %s\n", ldb_dn_get_linearized(server_dn), ldb_errstring(ldb))); return NULL; } @@ -6065,7 +6065,7 @@ static struct ldb_result *lookup_user_pso(struct ldb_context *sam_ldb, * log the error. The caller should fallback to using * the default domain password settings */ - DBG_ERR("Error retrieving msDS-ResultantPSO %s for %s", + DBG_ERR("Error retrieving msDS-ResultantPSO %s for %s\n", ldb_dn_get_linearized(pso_dn), ldb_dn_get_linearized(user_msg->dn)); } diff --git a/source4/dsdb/kcc/kcc_connection.c b/source4/dsdb/kcc/kcc_connection.c index f387dfcb0fe..78d853eddf7 100644 --- a/source4/dsdb/kcc/kcc_connection.c +++ b/source4/dsdb/kcc/kcc_connection.c @@ -215,13 +215,13 @@ struct kcc_connection_list *kccsrv_find_connections(struct kccsrv_service *s, list = talloc(tmp_ctx, struct kcc_connection_list); if (!list) { - DEBUG(0, ("out of memory")); + DEBUG(0, ("out of memory\n")); return NULL; } list->servers = talloc_array(list, struct kcc_connection, res->count); if (!list->servers) { - DEBUG(0, ("out of memory")); + DEBUG(0, ("out of memory\n")); talloc_free(tmp_ctx); return NULL; } diff --git a/source4/dsdb/kcc/kcc_drs_replica_info.c b/source4/dsdb/kcc/kcc_drs_replica_info.c index edd0710c4a2..59759267e01 100644 --- a/source4/dsdb/kcc/kcc_drs_replica_info.c +++ b/source4/dsdb/kcc/kcc_drs_replica_info.c @@ -56,14 +56,14 @@ static WERROR get_linked_attribute_value_stamp(TALLOC_CTX *mem_ctx, struct ldb_c ret = dsdb_search_dn(samdb, mem_ctx, &res, dn, attrs, DSDB_SEARCH_SHOW_EXTENDED_DN | DSDB_SEARCH_REVEAL_INTERNALS); if (ret != LDB_SUCCESS) { - DEBUG(0, (__location__ ": Failed search for attribute %s on %s", + DEBUG(0, (__location__ ": Failed search for attribute %s on %s\n", linked_attr_name, ldb_dn_get_linearized(dn))); return WERR_INTERNAL_ERROR; } attr_ext_dn = ldb_msg_find_attr_as_dn(samdb, mem_ctx, res->msgs[0], linked_attr_name); if (!attr_ext_dn) { - DEBUG(0, (__location__ ": Failed search for attribute %s on %s", + DEBUG(0, (__location__ ": Failed search for attribute %s on %s\n", linked_attr_name, ldb_dn_get_linearized(dn))); return WERR_INTERNAL_ERROR; } @@ -73,21 +73,21 @@ static WERROR get_linked_attribute_value_stamp(TALLOC_CTX *mem_ctx, struct ldb_c ntstatus = dsdb_get_extended_dn_uint32(attr_ext_dn, attr_version, "RMD_VERSION"); if (!NT_STATUS_IS_OK(ntstatus)) { - DEBUG(0, (__location__ ": Could not extract component %s from dn \"%s\"", + DEBUG(0, (__location__ ": Could not extract component %s from dn \"%s\"\n", "RMD_VERSION", ldb_dn_get_extended_linearized(mem_ctx, attr_ext_dn, 1))); return WERR_INTERNAL_ERROR; } ntstatus = dsdb_get_extended_dn_nttime(attr_ext_dn, attr_change_time, "RMD_CHANGETIME"); if (!NT_STATUS_IS_OK(ntstatus)) { - DEBUG(0, (__location__ ": Could not extract component %s from dn \"%s\"", + DEBUG(0, (__location__ ": Could not extract component %s from dn \"%s\"\n", "RMD_CHANGETIME", ldb_dn_get_extended_linearized(mem_ctx, attr_ext_dn, 1))); return WERR_INTERNAL_ERROR; } ntstatus = dsdb_get_extended_dn_uint32(attr_ext_dn, attr_version, "RMD_ORIGINATING_USN"); if (!NT_STATUS_IS_OK(ntstatus)) { - DEBUG(0, (__location__ ": Could not extract component %s from dn \"%s\"", + DEBUG(0, (__location__ ": Could not extract component %s from dn \"%s\"\n", "RMD_ORIGINATING_USN", ldb_dn_get_extended_linearized(mem_ctx, attr_ext_dn, 1))); return WERR_INTERNAL_ERROR; } @@ -108,7 +108,7 @@ static WERROR get_repl_prop_metadata_ctr(TALLOC_CTX *mem_ctx, ret = ldb_search(samdb, mem_ctx, &res, dn, LDB_SCOPE_BASE, attrs, NULL); if (ret != LDB_SUCCESS || res->count != 1) { - DEBUG(0, (__location__ ": Failed search for replPropertyMetaData attribute on %s", + DEBUG(0, (__location__ ": Failed search for replPropertyMetaData attribute on %s\n", ldb_dn_get_linearized(dn))); return WERR_INTERNAL_ERROR; } @@ -156,7 +156,7 @@ static WERROR get_dn_from_invocation_id(TALLOC_CTX *mem_ctx, ret = dsdb_search_one(samdb, invocation_id_str, &msg, ldb_get_config_basedn(samdb), LDB_SCOPE_SUBTREE, attrs_invocation, 0, "(&(objectClass=nTDSDSA)(invocationId=%s))", invocation_id_str); if (ret != LDB_SUCCESS) { - DEBUG(0, (__location__ ": Failed search for the object DN under %s whose invocationId is %s", + DEBUG(0, (__location__ ": Failed search for the object DN under %s whose invocationId is %s\n", invocation_id_str, ldb_dn_get_linearized(ldb_get_config_basedn(samdb)))); talloc_free(invocation_id_str); return WERR_INTERNAL_ERROR; diff --git a/source4/dsdb/repl/drepl_out_helpers.c b/source4/dsdb/repl/drepl_out_helpers.c index 0f801c060f4..d46b19edf76 100644 --- a/source4/dsdb/repl/drepl_out_helpers.c +++ b/source4/dsdb/repl/drepl_out_helpers.c @@ -1088,7 +1088,7 @@ static void dreplsrv_op_pull_source_apply_changes_trigger(struct tevent_req *req ldb_dn_get_linearized(nc_root), &p); if (!W_ERROR_IS_OK(status)) { - DEBUG(2, ("Failed to find requested Naming Context for %s: %s", + DEBUG(2, ("Failed to find requested Naming Context for %s: %s\n", ldb_dn_get_linearized(nc_root), win_errstr(status))); nt_status = werror_to_ntstatus(status); @@ -1101,7 +1101,7 @@ static void dreplsrv_op_pull_source_apply_changes_trigger(struct tevent_req *req if (!W_ERROR_IS_OK(status)) { struct GUID_txt_buf str; - DEBUG(2, ("Failed to find requested source DSA for %s and %s: %s", + DEBUG(2, ("Failed to find requested source DSA for %s and %s: %s\n", ldb_dn_get_linearized(nc_root), GUID_buf_string(&state->op->source_dsa->repsFrom1->source_dsa_obj_guid, &str), win_errstr(status))); @@ -1117,7 +1117,7 @@ static void dreplsrv_op_pull_source_apply_changes_trigger(struct tevent_req *req ldb_dn_get_linearized(schema_dn), &p); if (!W_ERROR_IS_OK(status)) { - DEBUG(2, ("Failed to find requested Naming Context for schema: %s", + DEBUG(2, ("Failed to find requested Naming Context for schema: %s\n", win_errstr(status))); nt_status = werror_to_ntstatus(status); tevent_req_nterror(req, nt_status); @@ -1129,7 +1129,7 @@ static void dreplsrv_op_pull_source_apply_changes_trigger(struct tevent_req *req &state->op->source_dsa); if (!W_ERROR_IS_OK(status)) { struct GUID_txt_buf str; - DEBUG(2, ("Failed to find requested source DSA for %s and %s: %s", + DEBUG(2, ("Failed to find requested source DSA for %s and %s: %s\n", ldb_dn_get_linearized(schema_dn), GUID_buf_string(&state->op->source_dsa->repsFrom1->source_dsa_obj_guid, &str), win_errstr(status))); diff --git a/source4/dsdb/repl/replicated_objects.c b/source4/dsdb/repl/replicated_objects.c index 83d1b421c45..01adae29e90 100644 --- a/source4/dsdb/repl/replicated_objects.c +++ b/source4/dsdb/repl/replicated_objects.c @@ -341,7 +341,7 @@ WERROR dsdb_repl_make_working_schema(struct ldb_context *ldb, werr = dsdb_schema_pfm_add_entry(working_schema->prefixmap, rm->bin_oid, &rm->id, NULL); if (!W_ERROR_IS_OK(werr)) { - DEBUG(0,(__location__ ": Failed to merge remote prefixMap: %s", + DEBUG(0,(__location__ ": Failed to merge remote prefixMap: %s\n", win_errstr(werr))); talloc_free(working_schema); return werr; @@ -356,7 +356,7 @@ WERROR dsdb_repl_make_working_schema(struct ldb_context *ldb, object_count, first_object); if (!W_ERROR_IS_OK(werr)) { - DEBUG(0, ("%s: dsdb_repl_resolve_working_schema() failed: %s", + DEBUG(0, ("%s: dsdb_repl_resolve_working_schema() failed: %s\n", __location__, win_errstr(werr))); talloc_free(working_schema); return werr; @@ -499,7 +499,7 @@ WERROR dsdb_convert_object_ex(struct ldb_context *ldb, DEBUG(0, ("Unxpectedly got secret value %s on %s from DRS server\n", e->name, ldb_dn_get_linearized(msg->dn))); } else { - DEBUG(0, ("Unxpectedly got secret value on %s from DRS server", + DEBUG(0, ("Unxpectedly got secret value on %s from DRS server\n", ldb_dn_get_linearized(msg->dn))); } } else if (!W_ERROR_IS_OK(status)) { @@ -530,19 +530,19 @@ WERROR dsdb_convert_object_ex(struct ldb_context *ldb, if (a->attid == DRSUAPI_ATTID_name) { const struct ldb_val *rdn_val = ldb_dn_get_rdn_val(msg->dn); if (rdn_val == NULL) { - DEBUG(0, ("Unxpectedly unable to get RDN from %s for validation", + DEBUG(0, ("Unxpectedly unable to get RDN from %s for validation\n", ldb_dn_get_linearized(msg->dn))); return WERR_FOOBAR; } if (e->num_values != 1) { - DEBUG(0, ("Unxpectedly got wrong number of attribute values (got %u, expected 1) when checking RDN against name of %s", + DEBUG(0, ("Unxpectedly got wrong number of attribute values (got %u, expected 1) when checking RDN against name of %s\n", e->num_values, ldb_dn_get_linearized(msg->dn))); return WERR_FOOBAR; } if (data_blob_cmp(rdn_val, &e->values[0]) != 0) { - DEBUG(0, ("Unxpectedly got mismatching RDN values when checking RDN against name of %s", + DEBUG(0, ("Unxpectedly got mismatching RDN values when checking RDN against name of %s\n", ldb_dn_get_linearized(msg->dn))); return WERR_FOOBAR; } diff --git a/source4/dsdb/samdb/ldb_modules/audit_util.c b/source4/dsdb/samdb/ldb_modules/audit_util.c index 0a6b6eaea2a..74b696daa07 100644 --- a/source4/dsdb/samdb/ldb_modules/audit_util.c +++ b/source4/dsdb/samdb/ldb_modules/audit_util.c @@ -543,7 +543,7 @@ failure: * so it needs to be freed to prevent a leak. */ json_free(&value); - DBG_ERR("unable to add ldb value to JSON audit message"); + DBG_ERR("unable to add ldb value to JSON audit message\n"); return -1; } diff --git a/source4/dsdb/samdb/ldb_modules/password_hash.c b/source4/dsdb/samdb/ldb_modules/password_hash.c index da8e93f7b44..eec149328e2 100644 --- a/source4/dsdb/samdb/ldb_modules/password_hash.c +++ b/source4/dsdb/samdb/ldb_modules/password_hash.c @@ -4261,7 +4261,7 @@ static int get_pso_data_callback(struct ldb_request *req, } if (ac->pso_res != NULL) { - DBG_ERR("Too many PSO results for %s", + DBG_ERR("Too many PSO results for %s\n", ldb_dn_get_linearized(ac->search_res->message->dn)); talloc_free(ac->pso_res); } @@ -4360,7 +4360,7 @@ static struct ldb_request * build_pso_data_request(struct ph_context *ac) /* log errors, but continue with the default domain settings */ if (ret != LDB_SUCCESS) { - DBG_ERR("Error %d constructing PSO query for user %s", ret, + DBG_ERR("Error %d constructing PSO query for user %s\n", ret, ldb_dn_get_linearized(ac->search_res->message->dn)); } LDB_REQ_SET_LOCATION(pso_req); diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c index 72aa83ad8a7..37dd7f00c35 100644 --- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c +++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c @@ -5270,7 +5270,7 @@ static int replmd_name_modify(struct replmd_replicated_request *ar, DSDB_FLAG_OWN_MODULE|DSDB_FLAG_REPLICATED_UPDATE, req); if (ret != LDB_SUCCESS) { - DEBUG(0,(__location__ ": Failed to modify rDN/name of DN being DRS renamed '%s' - %s", + DEBUG(0,(__location__ ": Failed to modify rDN/name of DN being DRS renamed '%s' - %s\n", ldb_dn_get_linearized(dn), ldb_errstring(ldb_module_get_ctx(ar->module)))); return ret; @@ -5282,7 +5282,7 @@ static int replmd_name_modify(struct replmd_replicated_request *ar, failed: talloc_free(msg); - DEBUG(0,(__location__ ": Failed to setup modify rDN/name of DN being DRS renamed '%s'", + DEBUG(0,(__location__ ": Failed to setup modify rDN/name of DN being DRS renamed '%s'\n", ldb_dn_get_linearized(dn))); return LDB_ERR_OPERATIONS_ERROR; } @@ -5345,7 +5345,7 @@ static int replmd_op_name_modify_callback(struct ldb_request *req, struct ldb_re ret = dsdb_module_modify(ar->module, msg, DSDB_FLAG_OWN_MODULE, req); if (ret != LDB_SUCCESS) { - DEBUG(0,(__location__ ": Failed to modify lastKnownParent of lostAndFound DN '%s' - %s", + DEBUG(0,(__location__ ": Failed to modify lastKnownParent of lostAndFound DN '%s' - %s\n", ldb_dn_get_linearized(msg->dn), ldb_errstring(ldb_module_get_ctx(ar->module)))); return ret; diff --git a/source4/dsdb/samdb/ldb_modules/util.c b/source4/dsdb/samdb/ldb_modules/util.c index ba3d24b98af..8b6c598a8a6 100644 --- a/source4/dsdb/samdb/ldb_modules/util.c +++ b/source4/dsdb/samdb/ldb_modules/util.c @@ -1562,7 +1562,7 @@ int dsdb_get_expected_new_values(TALLOC_CTX *mem_ctx, el_count++; tmp = val_count + msg->elements[i].num_values; if (unlikely(tmp < val_count)) { - DBG_ERR("too many values for one element!"); + DBG_ERR("too many values for one element!\n"); return LDB_ERR_OPERATIONS_ERROR; } val_count = tmp; diff --git a/source4/dsdb/schema/schema_convert_to_ol.c b/source4/dsdb/schema/schema_convert_to_ol.c index 72b05415462..259d9b9f976 100644 --- a/source4/dsdb/schema/schema_convert_to_ol.c +++ b/source4/dsdb/schema/schema_convert_to_ol.c @@ -150,7 +150,7 @@ static char *print_schema_recursive(char *append_to_string, struct dsdb_schema * break; default: talloc_free(mem_ctx); - DEBUG(0,(__location__ " Wrong type of target %u!", (unsigned)target)); + DEBUG(0,(__location__ " Wrong type of target %u!\n", (unsigned)target)); return NULL; } talloc_free(mem_ctx); @@ -285,7 +285,7 @@ char *dsdb_convert_schema_to_openldap(struct ldb_context *ldb, char *target_str, break; default: talloc_free(mem_ctx); - DEBUG(0,(__location__ " Wrong type of target %u!", (unsigned)target)); + DEBUG(0,(__location__ " Wrong type of target %u!\n", (unsigned)target)); return NULL; } @@ -366,7 +366,7 @@ char *dsdb_convert_schema_to_openldap(struct ldb_context *ldb, char *target_str, break; default: talloc_free(mem_ctx); - DEBUG(0,(__location__ " Wrong type of target %u!", (unsigned)target)); + DEBUG(0,(__location__ " Wrong type of target %u!\n", (unsigned)target)); return NULL; } }