[PATCH] for "testparm should check for invalid vfs objects"

Amit amitkuma at redhat.com
Thu Aug 23 10:29:05 UTC 2018


Thanks Stefan,

But problem here is vfs_find_backend_entry() is static inside
./source3/smbd/vfs.c
And I want to use in source3/utils/testparm.c which generating reference
not found exception.

I tried creating "./source3/smbd/vfs.h" and moving 
vfs_find_backend_entry() as non-staticbut lot of related code.
Working on same.

Thanks

On 08/21/2018 07:20 PM, Stefan Metzmacher wrote:
> Hello Amit,
>
>> I tried using getting vfs_object list as done in smbd_vfs_init(), Since
>> I donot have connection_struct i used #define GLOBAL_SECTION_SNUM    
>> (-1). But values are not retrieved.
> Testparm should have the snum for the section it is checking.
> do_per_share_checks(int s), 's' is the one you need.
>
>>         int test = -1, o=0;
>>         char **vfs_objects_test = lp_vfs_objects(test);
>>         while(vfs_objects_test[o]){
>>                 printf("vfs_objects_test=%s\n",vfs_objects_test[o]);
>>                 o++;
>>         }
> Within the loop you need a logic like vfs_init_custom(), you need the
> logic that converts the string 'vfs_object' into module_path and
> module_name and then the following check:
>
>         entry = vfs_find_backend_entry(module_name);
>         if (!entry) {
>                 NTSTATUS status;
>
>                 status = smb_load_module("vfs", module_path);
>                 if (!NT_STATUS_IS_OK(status)) {
>                         DEBUG(0, ("error probing vfs module '%s': %s\n",
>                                   module_path, nt_errstr(status)));
>                         goto fail;
>                 }
>
>                 entry = vfs_find_backend_entry(module_name);
>                 if (!entry) {
>                         DEBUG(0,("Can't find a vfs module
> [%s]\n",vfs_object));
>                         goto fail;
>                 }
>         }
>
>> Also have do we have any module extracted using 'waf' which can refereed
>> as for reference.
> It could get a list, but only with internal modules, at buildtime.
>
> If a packager moved some modules to separate rpm/deb packages and those
> are not installed, the list would still be wrong.
>
> I hope that helps...
>
> metze

-- 
Thanks
Amit Kumar
!!If you stumble, get back up. 
What happened yesterday, no longer matters.
Today is another day to move closer to your GOAL!!



More information about the samba-technical mailing list