summaryrefslogtreecommitdiff
path: root/source3/registry
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2012-12-10 17:45:15 +0100
committerGünther Deschner <gd@samba.org>2012-12-12 15:00:02 +0100
commit76ac4d923d7ea07ab13190217359ce283e925fac (patch)
treee7f8e0dda5323269ae5ac896066f9e53f618a3df /source3/registry
parent7dd13503c0919766ecf3c8f5f48cda72aae8ac73 (diff)
downloadsamba-76ac4d923d7ea07ab13190217359ce283e925fac.tar.gz
samba-76ac4d923d7ea07ab13190217359ce283e925fac.tar.bz2
samba-76ac4d923d7ea07ab13190217359ce283e925fac.zip
s3-registry: Fix counters_directory() dir creation.
Found by Coverity. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source3/registry')
-rw-r--r--source3/registry/reg_perfcount.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/registry/reg_perfcount.c b/source3/registry/reg_perfcount.c
index e51d374320..cfefb1fb95 100644
--- a/source3/registry/reg_perfcount.c
+++ b/source3/registry/reg_perfcount.c
@@ -48,8 +48,8 @@ static char *counters_directory(const char *dbname)
TALLOC_CTX *ctx = talloc_tos();
path = state_path(PERFCOUNTDIR);
- if (!directory_exist(path)) {
- mkdir(path, 0755);
+ if (!directory_create_or_exist(path, geteuid(), 0755)) {
+ return NULL;
}
path = talloc_asprintf(ctx, "%s/%s", PERFCOUNTDIR, dbname);