r1038: Check whether a module actually exists before attempting to load it...
authorJelmer Vernooij <jelmer@samba.org>
Sat, 5 Jun 2004 20:53:18 +0000 (20:53 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:56:33 +0000 (12:56 -0500)
(This used to be commit c8e3fd75e594c8fc841337234e99be288180822f)

source4/lib/module.c

index f03e19d92482c09fc94c8985fdc2fc1fd428a906..1fcb57fac18a5bfb969dbf5820ec6c7e748eb399 100644 (file)
@@ -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 */