notify_inotify: fix small typo in inotify_map_mask_to_filter

Doug Nazar nazard at nazar.ca
Thu Apr 27 17:19:20 UTC 2017


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

-------------- next part --------------
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;
 		}
 	}


More information about the samba-technical mailing list