Skip to content

Commit

Permalink
DEBUG: changed verbosity of:
Browse files Browse the repository at this point in the history
 - perform_checks(): log actual owner
 - sss_confdb_create_ldif(): use SSSDBG_TRACE_LDB
  • Loading branch information
alexey-tikhonov committed Feb 21, 2024
1 parent dd7a2bf commit 748612f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
10 changes: 6 additions & 4 deletions src/util/check_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,16 @@ static errno_t perform_checks(const char *filename,
}

if (uid != (uid_t)(-1) && stat_buf->st_uid != uid) {
DEBUG(SSSDBG_TRACE_LIBS, "File '%s' must be owned by uid [%d].\n",
filename, uid);
DEBUG(SSSDBG_TRACE_LIBS,
"File '%s' is owned by uid [%"SPRIuid"], expected [%"SPRIuid"].\n",
filename, stat_buf->st_uid, uid);
return EINVAL;
}

if (gid != (gid_t)(-1) && stat_buf->st_gid != gid) {
DEBUG(SSSDBG_TRACE_LIBS, "File '%s' must be owned by gid [%d].\n",
filename, gid);
DEBUG(SSSDBG_TRACE_LIBS,
"File '%s' is owned by gid [%"SPRIgid"], expected [%"SPRIgid"].\n",
filename, stat_buf->st_gid, gid);
return EINVAL;
}

Expand Down
10 changes: 5 additions & 5 deletions src/util/sss_ini.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ int sss_confdb_create_ldif(TALLOC_CTX *mem_ctx,

for (i = 0; i < section_count; i++) {
const char *rdn = NULL;
DEBUG(SSSDBG_TRACE_FUNC,
DEBUG(SSSDBG_TRACE_LDB,
"Processing config section [%s]\n", sections[i]);
ret = parse_section(tmp_ctx, sections[i], &sec_dn, &rdn);
if (ret != EOK) {
Expand All @@ -450,7 +450,7 @@ int sss_confdb_create_ldif(TALLOC_CTX *mem_ctx,

if (only_section != NULL) {
if (strcasecmp(only_section, sections[i])) {
DEBUG(SSSDBG_TRACE_FUNC, "Skipping section %s\n", sections[i]);
DEBUG(SSSDBG_TRACE_LDB, "Skipping section %s\n", sections[i]);
continue;
}
}
Expand All @@ -475,7 +475,7 @@ int sss_confdb_create_ldif(TALLOC_CTX *mem_ctx,
}

for (j = 0; j < attr_count; j++) {
DEBUG(SSSDBG_TRACE_FUNC,
DEBUG(SSSDBG_TRACE_LDB,
"Processing attribute [%s]\n", attrs[j]);
ret = sss_ini_get_config_obj(sections[i], attrs[j],
self->sssd_config,
Expand All @@ -493,7 +493,7 @@ int sss_confdb_create_ldif(TALLOC_CTX *mem_ctx,

ldif_attr = talloc_asprintf(tmp_ctx,
"%s: %s\n", attrs[j], value);
DEBUG(SSSDBG_TRACE_ALL, "%s\n", ldif_attr);
DEBUG(SSSDBG_TRACE_LDB, "%s\n", ldif_attr);

attr_len = strlen(ldif_attr);

Expand Down Expand Up @@ -523,7 +523,7 @@ int sss_confdb_create_ldif(TALLOC_CTX *mem_ctx,
dn[dn_size-1] = '\n';
dn[dn_size] = '\0';

DEBUG(SSSDBG_TRACE_ALL, "Section dn\n%s\n", dn);
DEBUG(SSSDBG_TRACE_LDB, "Section dn\n%s\n", dn);

tmp_ldif = talloc_realloc(mem_ctx, ldif, char,
ldif_len+dn_size+1);
Expand Down

0 comments on commit 748612f

Please sign in to comment.