diff options
author | Michael Adam <obnox@samba.org> | 2008-04-09 15:16:45 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2008-04-10 01:29:01 +0200 |
commit | 9a3fe1943e7dfa68f83ee7d2e472e5732f6a665d (patch) | |
tree | 30ea81294129ccc0219464a237f0cc9ae5388945 | |
parent | bb91ab6116055b3a450de3925737f91c3fdf4dca (diff) | |
download | samba-9a3fe1943e7dfa68f83ee7d2e472e5732f6a665d.tar.gz samba-9a3fe1943e7dfa68f83ee7d2e472e5732f6a665d.tar.bz2 samba-9a3fe1943e7dfa68f83ee7d2e472e5732f6a665d.zip |
libsmbconf: fix crashbug - correctly check for existence of file.
Michael
(This used to be commit dd543cd30c3eca9621681ba4b6e9a6683ef2bd07)
-rw-r--r-- | source3/lib/smbconf/smbconf_txt_simple.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/lib/smbconf/smbconf_txt_simple.c b/source3/lib/smbconf/smbconf_txt_simple.c index 2183ac3bec..9164d1690a 100644 --- a/source3/lib/smbconf/smbconf_txt_simple.c +++ b/source3/lib/smbconf/smbconf_txt_simple.c @@ -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; } |