1 Index: samba-3.6.6/source3/smbd/notify_inotify.c
2 ===================================================================
3 --- samba-3.6.6.orig/source3/smbd/notify_inotify.c
4 +++ samba-3.6.6/source3/smbd/notify_inotify.c
5 @@ -77,6 +77,7 @@ struct inotify_private {
6 struct sys_notify_context *ctx;
8 struct inotify_watch_context *watches;
9 + bool broken_inotify; /* Late stop for broken system */
12 struct inotify_watch_context {
13 @@ -241,8 +242,15 @@ static void inotify_handler(struct event
14 filenames, and thus can't know how much to allocate
17 - if (ioctl(in->fd, FIONREAD, &bufsize) != 0 ||
19 + if ((ioctl(in->fd, FIONREAD, &bufsize) != 0) && (errno == EACCES)) {
21 + * Workaround for broken system (SELinux policy bug fixed since long but it is always better not to loop on EACCES)
24 + in->broken_inotify = True;
28 DEBUG(0,("No data on inotify fd?!\n"));
31 @@ -300,6 +308,7 @@ static NTSTATUS inotify_setup(struct sys
35 + in->broken_inotify = False;
37 ctx->private_data = in;
38 talloc_set_destructor(in, inotify_destructor);
39 @@ -394,6 +403,10 @@ NTSTATUS inotify_watch(struct sys_notify
41 in = talloc_get_type(ctx->private_data, struct inotify_private);
43 + if (in->broken_inotify) {
44 + return NT_STATUS_OK;
47 mask = inotify_map(e);
49 /* this filter can't be handled by inotify */