From 439a78014625cf93c0e787747aec08d0f45b9781 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 5 Jun 2004 20:53:18 +0000 Subject: r1038: Check whether a module actually exists before attempting to load it... (This used to be commit c8e3fd75e594c8fc841337234e99be288180822f) --- source4/lib/module.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source4/lib') diff --git a/source4/lib/module.c b/source4/lib/module.c index f03e19d924..1fcb57fac1 100644 --- a/source4/lib/module.c +++ b/source4/lib/module.c @@ -35,7 +35,10 @@ NTSTATUS smb_load_module(const char *module_name) DIR *dir; struct dirent *dirent; - stat(module_name, &st); + if(stat(module_name, &st) < 0) { + DEBUG(0, ("Can't stat module '%s'\n", module_name)); + return NT_STATUS_UNSUCCESSFUL; + } /* If the argument is a directory, recursively load all files / * directories in it */ -- cgit