From 6f500d41d273d723f6b8eb0f27823fa8199d2136 Mon Sep 17 00:00:00 2001 From: cbay <> Date: Thu, 14 Apr 2016 11:23:02 +0200 Subject: [PATCH] Do not follow symlinks pointing to directories when auto_add=True. --- python2/pyinotify.py | 2 +- python3/pyinotify.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python2/pyinotify.py b/python2/pyinotify.py index d2f0816..cab26f2 100755 --- a/python2/pyinotify.py +++ b/python2/pyinotify.py @@ -716,7 +716,7 @@ def process_IN_CREATE(self, raw_event): # also be new. created_dir_wd = addw_ret.get(created_dir) if ((created_dir_wd is not None) and (created_dir_wd > 0) and - os.path.isdir(created_dir)): + os.path.isdir(created_dir) and not os.path.islink(created_dir)): try: for name in os.listdir(created_dir): inner = os.path.join(created_dir, name) diff --git a/python3/pyinotify.py b/python3/pyinotify.py index bc24313..dc4cffc 100755 --- a/python3/pyinotify.py +++ b/python3/pyinotify.py @@ -699,7 +699,7 @@ def process_IN_CREATE(self, raw_event): # also be new. created_dir_wd = addw_ret.get(created_dir) if ((created_dir_wd is not None) and (created_dir_wd > 0) and - os.path.isdir(created_dir)): + os.path.isdir(created_dir) and not os.path.islink(created_dir)): try: for name in os.listdir(created_dir): inner = os.path.join(created_dir, name)