s3-registry: Fix counters_directory() dir creation.
authorAndreas Schneider <asn@samba.org>
Mon, 10 Dec 2012 16:45:15 +0000 (17:45 +0100)
committerGünther Deschner <gd@samba.org>
Wed, 12 Dec 2012 14:00:02 +0000 (15:00 +0100)
Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
source3/registry/reg_perfcount.c

index e51d374..cfefb1f 100644 (file)
@@ -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);