[PATCH] Reintroduce support for RPC modules

Andreas Schneider asn at samba.org
Fri Feb 19 14:37:07 UTC 2016

On Friday 19 February 2016 13:39:47 Ralph Boehme wrote:
> Hi!

Hi Ralph,

could you please fix a few things in the source code. Some functions are 
inconsistent to others. See comments below.

+static struct rpc_module *find_rpc_module(const char *name)
+	struct rpc_module *module = rpc_modules;
+	while (module) {
+		if (strequal(module->name, name)) {
+			return module;
+		}
+		module = module->next;
+	}
+	return NULL;

I would prefer a for loop:

for (module = rpc_modules; module != NULL; module = module->next)

You use that in setup_rpc_modules() ...

+NTSTATUS register_rpc_module(struct rpc_module_fns *fns,
+			     const char *name)
+	struct rpc_module *module = NULL;
+	if (!name || !name[0]) {
+		DBG_ERR("called with NULL pointer or empty name!\n");
+	}

Please use: if (name == NULL || name[0] == '\0')

Also bool helper variables in that functions would not hurt.


In rpc_setup_embedded() please check return values of load_samba_modules() and 

With these changes you can push that code with my RB+.

I'm still against this as history showed we start to break these things. See 
the auth module code. (auth_domain can't be compiled as a static module, same 
for auth_builtin because it also provides auth_guest, so when compiled as a 
module smbd can't find the guest module).

Best regards,

	-- andreas

Andreas Schneider                   GPG-ID: CC014E3D
Samba Team                             asn at samba.org

More information about the samba-technical mailing list