notify_inotify: fix small typo in inotify_map_mask_to_filter

Christof Schmitt cs at samba.org
Thu Apr 27 22:58:29 UTC 2017


On Tue, Apr 25, 2017 at 11:21:54PM -0400, Doug Nazar 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.
> 
> 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;
>  		}
>  	}

yes, this looks wrong. I saw that you also sent the patch to
samba-technical. I can help to move this forward.

Christof



More information about the samba-technical mailing list