[PATCH] for "testparm should check for invalid vfs objects"
Amit
amitkuma at redhat.com
Mon Aug 27 07:04:27 UTC 2018
Hello All,
New patch. PFA
Thanks
Amit
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!!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: invalid_vfs_object.patch
Type: text/x-patch
Size: 1396 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20180827/9b5046f3/invalid_vfs_object.bin>
More information about the samba-technical
mailing list