s3: smbd: inotify_map_mask_to_filter incorrectly indexes an array.
authorDoug Nazar <nazard@nazar.ca>
Thu, 27 Apr 2017 22:41:24 +0000 (15:41 -0700)
committerJeremy Allison <jra@samba.org>
Fri, 28 Apr 2017 01:18:23 +0000 (03:18 +0200)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12760

Signed-off-by: Doug Nazar <nazard@nazar.ca>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
source3/smbd/notify_inotify.c

index 3848dd6..74855a9 100644 (file)
@@ -97,7 +97,7 @@ static uint32_t inotify_map_mask_to_filter(uint32_t mask)
        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;
                }
        }