On (17/02/15 11:26), Jakub Hrozek wrote:
Hi,
I was recently debugging a strange issue which could have been solved
easily if gpo_child logged this particular failure. The attached patch
adds a DEBUG message.
From c0363835e04a77ff3f111ac928b0a5a9125dd59c Mon Sep 17 00:00:00
2001
From: Jakub Hrozek <jhrozek(a)redhat.com>
Date: Tue, 17 Feb 2015 11:24:58 +0100
Subject: [PATCH] GPO: Better debugging for gpo_child's mkdir
---
src/providers/ad/ad_gpo_child.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/providers/ad/ad_gpo_child.c b/src/providers/ad/ad_gpo_child.c
index 1254b69cd9581598d2d63f186bf96557132f0d1a..4750732be65a08e7af3236e6c01a6181ae4e80a5
100644
--- a/src/providers/ad/ad_gpo_child.c
+++ b/src/providers/ad/ad_gpo_child.c
@@ -207,6 +207,7 @@ static errno_t prepare_gpo_cache(TALLOC_CTX *mem_ctx,
char *first = NULL;
char *last = NULL;
char *smb_path_with_suffix = NULL;
+ errno_t ret;
smb_path_with_suffix = talloc_strdup(mem_ctx, input_smb_path_with_suffix);
if (smb_path_with_suffix == NULL) {
@@ -242,9 +243,13 @@ static errno_t prepare_gpo_cache(TALLOC_CTX *mem_ctx,
DEBUG(SSSDBG_CRIT_FAILURE, "talloc_asprintf failed.\n");
return ENOMEM;
}
+ DEBUG(SSSDBG_TRACE_FUNC, "Storing GPOs in %s\n", current_dir);
if ((mkdir(current_dir, 0644)) < 0 && errno != EEXIST) {
- return EINVAL;
+ ret = errno;
+ DEBUG(SSSDBG_CRIT_FAILURE,
+ "mkdir(%s) failed: %d\n", current_dir, ret);
+ return ret;
}
ptr = last;
Obvious ACK.
http://sssd-ci.duckdns.org/logs/job/7/48/summary.html
LS