]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libsmbconf: fix crashbug - correctly check for existence of file.
authorMichael Adam <obnox@samba.org>
Wed, 9 Apr 2008 13:16:45 +0000 (15:16 +0200)
committerMichael Adam <obnox@samba.org>
Wed, 9 Apr 2008 23:29:01 +0000 (01:29 +0200)
Michael

source/lib/smbconf/smbconf_txt_simple.c

index 2183ac3bec8590acb41266936d309baa61a3a25f..9164d1690a9ffe1c050851957726254179085096 100644 (file)
@@ -175,8 +175,13 @@ static WERROR smbconf_txt_init_cache(struct smbconf_ctx *ctx)
 static WERROR smbconf_txt_load_file(struct smbconf_ctx *ctx)
 {
        WERROR werr;
-       uint64_t new_csn = (uint64_t)file_modtime(ctx->path);
+       uint64_t new_csn;
 
+       if (!file_exist(ctx->path, NULL)) {
+               return WERR_BADFILE;
+       }
+
+       new_csn = (uint64_t)file_modtime(ctx->path);
        if (new_csn == pd(ctx)->csn) {
                return WERR_OK;
        }