Messages in this thread | | | Subject | Re: fanotify bug on gdb -- hard crash | From | Eric Paris <> | Date | Tue, 30 Dec 2014 19:21:49 -0500 |
| |
On Mon, 2014-12-29 at 13:06 +0800, ivo welch wrote: > thank you, eric. will do. I read up on it above and now understand it better.
Great let us know if it keeps giving you trouble!
> the example in the man page seems somewhat misfortunate. I would use > an example that does not, by default, lock up the user system. > (perhaps add a second example with the _PERM feature that shows how it > responds.)
The link you gave does respond and allow permissions:
if (metadata->fd >= 0) {
/* Handle open permission event */
if (metadata->mask & FAN_OPEN_PERM) { printf("FAN_OPEN_PERM: ");
/* Allow file to be opened */
response.fd = metadata->fd; response.response = FAN_ALLOW; write(fd, &response, sizeof(struct fanotify_response)); }
That's the key bit of the example... If you use gdb and never get to there, you are in a bit of trouble, I agree!
| |