[Bug 530268] Re: MOVE_SELF handling renames the directory incorrectly

Facundo Batista facundo at canonical.com
Mon Apr 19 20:25:50 BST 2010

** Changed in: pyinotify (Ubuntu)
   Importance: Medium => High

MOVE_SELF handling renames the directory incorrectly
You received this bug notification because you are a member of Ubuntu
Sponsors Team, which is a direct subscriber.

Status in “pyinotify” package in Ubuntu: Confirmed

Bug description:
I have a path fully watched. Rename one directory from "test_dir", to "test_dir_renamed" (note that they "overlap").

So, it gets into process_IN_MOVE_SELF(), and tries to fix the paths that it has in the watch managers.

In the loop where it checks which paths to choose, it gets:  "tests/home_dir/root/test_dir_renamed".

The src_path is:


The dest_path is:  


And the code *incorrectly* renames it to:


One way to avoid this overlapping issue is to add the "/" to the source_path, so you don't get in the trap of comparing with .startswith(). 

A patch is attached here that fixes the problem in the described way.

ProblemType: Bug
Architecture: i386
Date: Mon Mar  1 16:46:16 2010
DistroRelease: Ubuntu 10.04
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release i386 (20091028.5)
Package: python-pyinotify 0.8.9-1ubuntu1
PackageArchitecture: all
 PATH=(custom, user)
ProcVersionSignature: Ubuntu 2.6.32-14.20-generic
SourcePackage: pyinotify
Uname: Linux 2.6.32-14-generic i686

More information about the Ubuntu-sponsors mailing list