notify_inotify: fix small typo in inotify_map_mask_to_filter

Jeremy Allison jra at samba.org
Thu Apr 27 22:43:33 UTC 2017


On Thu, Apr 27, 2017 at 01:19:20PM -0400, Doug Nazar via samba-technical wrote:
> While mapping back to the filter in inotify_map_mask_to_filter() the
> check hard codes the index as 0 so it will fail for any but the
> first filter.
> 
> Tested against 4.5.8 but looks like the code is the same in HEAD.
> 
> Doug
> 

> diff -ur samba-4.5.8.orig/source3/smbd/notify_inotify.c samba-4.5.8/source3/smbd/notify_inotify.c
> --- samba-4.5.8.orig/source3/smbd/notify_inotify.c	2016-08-11 03:51:04.000000000 -0400
> +++ samba-4.5.8/source3/smbd/notify_inotify.c	2017-04-25 18:00:43.881718699 -0400
> @@ -97,7 +97,7 @@
>  	uint32_t filter = 0;
>  
>  	for (i = 0; i < ARRAY_SIZE(inotify_mapping); i++) {
> -		if (inotify_mapping[0].inotify_mask & mask) {
> +		if (inotify_mapping[i].inotify_mask & mask) {
>  			filter |= inotify_mapping[i].notify_mask;
>  		}
>  	}

Doug, here's the same but as a git-format patch with your
authorship attached. Are you OK with this ?

If so, can I get a second Team reviewer ?

Cheers,

	Jeremy.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-s3-smbd-inotify_map_mask_to_filter-incorrectly-index.patch
Type: text/x-diff
Size: 993 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20170427/9dbd455e/0001-s3-smbd-inotify_map_mask_to_filter-incorrectly-index.diff>


More information about the samba-technical mailing list