s4-ldb: it is not an error for the modules directory to not exist
authorAndrew Tridgell <tridge@samba.org>
Mon, 1 Nov 2010 05:07:35 +0000 (16:07 +1100)
committerAndrew Tridgell <tridge@samba.org>
Mon, 1 Nov 2010 07:55:19 +0000 (18:55 +1100)
source4/lib/ldb/common/ldb_modules.c

index 8ff04e118e6a845fff59a52e8d6e0edd7b1fbc5a..6c0cbfcb00d15d735a49bd5bd56be507fa2297fd 100644 (file)
@@ -888,6 +888,11 @@ static int ldb_modules_load_dir(const char *modules_dir, const char *version)
 
        dir = opendir(modules_dir);
        if (dir == NULL) {
+               if (errno == ENOENT) {
+                       talloc_free(tmp_ctx);
+                       /* we don't have any modules */
+                       return LDB_SUCCESS;
+               }
                talloc_free(tmp_ctx);
                fprintf(stderr, "ldb: unable to open modules directory '%s' - %s\n",
                        modules_dir, strerror(errno));