s3/rpc_server: shared rpc modules loading
authorRalph Boehme <slow@samba.org>
Mon, 30 Jan 2017 17:49:39 +0000 (18:49 +0100)
committerJeremy Allison <jra@samba.org>
Mon, 30 Jan 2017 23:45:18 +0000 (00:45 +0100)
The previous commit 58889e04bd545d7420d1193e134351bd0ccb8430 for this
bug was broken as it didn't move the goto into the "if (errno !=
ENOENT)" condition.

This updated fix folds the test "mod_init_fns == NULL" and the check for
the errno into one if condition.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=12184

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/rpc_server/rpc_service_setup.c

index 263fcaf443fa78a200036b58c6658602a2883f0a..751a6387fb6c6b59d8e9e0b156e439ec61ae7988 100644 (file)
@@ -535,18 +535,15 @@ bool dcesrv_ep_setup(struct tevent_context *ev_ctx,
 
        /* Initialize shared modules */
        mod_init_fns = load_samba_modules(tmp_ctx, "rpc");
-       if (mod_init_fns == NULL) {
-               if (errno != ENOENT) {
-                       /*
-                        * ENOENT means the directory doesn't exist
-                        * which can happen if all modules are
-                        * static. So ENOENT is ok, everything else is
-                        * not ok.
-                        */
-                       DBG_ERR("Loading shared RPC modules failed [%s]\n",
-                               strerror(errno));
-                       ok = false;
-               }
+       if ((mod_init_fns == NULL) && (errno != ENOENT)) {
+               /*
+                * ENOENT means the directory doesn't exist which can happen if
+                * all modules are static. So ENOENT is ok, everything else is
+                * not ok.
+                */
+               DBG_ERR("Loading shared RPC modules failed [%s]\n",
+                       strerror(errno));
+               ok = false;
                goto done;
        }