rjeczalik/notify

Add option to skip first symlink or all symlinks

wavvs opened this issue · 0 comments

wavvs commented

Motivation

On my project I need to track filesystem changes inside a container from the outside. In Linux this can be done by tracking /proc/<pid>/root path. Since we are in /proc filesystem, we have "special" symlinks.

lrwxrwxrwx   1 root root 0 Jan  7 01:51 root -> /

It points to / root, which is not host's root. Notify follows this trap and watches host's root instead of /proc/<pid>/root/... path.

My suggestions:

  1. Option to disable the ability to follow symlinks.
  2. Option (or permanent solution) to disable the ability to follow symlink on path itself, which is passed to notify.Watch()
  3. ....?

For now, I just comment out canonical function in cleanpath, but it is just temporary solution.