When a VFS module is built outside the source tree, the init function name has to be manually changed to samba_init_module or init_samba_module depending on which Samba version is being built against. It'd be nice to have build functionality available that'd allow the same module source file to be compiled inside or outside the tree without manually changing the init function name. Thanks!
Hmmm, please reassign this to me. I couldn't figure out how to do it.
This will do it, I believe: diff --git a/examples/VFS/Makefile.in b/examples/VFS/Makefile.in index bbb66be..55e2c04 100644 --- a/examples/VFS/Makefile.in +++ b/examples/VFS/Makefile.in @@ -45,7 +45,7 @@ skel_transparent.@SHLIBEXT@: skel_transparent.@OBJEXT@ .c.@OBJEXT@: @echo "Compiling $<" - @$(CC) $(FLAGS) -c $< + @$(CC) $(FLAGS) -c $< -D$(basename $@)_init=samba_init_module install: default
Something like the above was pushed to master as 1080483319d4eb7a8cdee767fc41f7258e0e2537 However, a small change is required for the 3.6.x and 3.5.x code bases which declare things as: #define vfs_acl_tdb_init init_samba_module Here is the required patch for 3.5.x and 3.6.x: diff --git a/examples/VFS/Makefile.in b/examples/VFS/Makefile.in index 8fe414a..98d259f 100644 --- a/examples/VFS/Makefile.in +++ b/examples/VFS/Makefile.in @@ -36,7 +36,7 @@ default: $(patsubst %.c,%.$(SHLIBEXT),$(wildcard *.c)) %.$(OBJEXT): %.c @echo "Compiling $<" - @$(CC) $(FLAGS) -c $< + @$(CC) $(FLAGS) -c $< -D$*_init=init_samba_module install: default Can I get someone to approve including this patch in the next 3.6.x and 3.5.x releases because it makes life easier for those who write out-of-tree modules. It also overcomes my objection to the gratuitous change to the vfs module init function in Master compared to the other branches, because we hide the difference in the infrastructure.
Created attachment 7403 [details] Patchfile for Makefile.in for out-of-tree modules
Can I get someone to review the change so we can line them up to be pushed to 3.6.next and 3.5.next please?
Comment on attachment 7403 [details] Patchfile for Makefile.in for out-of-tree modules Looks good to me for 3.6.x and 3.5.x. Jeremy.
Re-assigning to Karolin for inclusion in 3.5.next and 3.6.next. Jeremy.
Pushed to v3-5-test and v3-6-test. Closing out bug report. Thanks!
*** Bug 8907 has been marked as a duplicate of this bug. ***