MOVE_SELF handling renames the directory incorrectly

Bug #530268 reported by Facundo Batista on 2010-03-01
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pyinotify (Ubuntu)
High
James Westby
Nominated for Lucid by Facundo Batista

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:

    tests/home_dir/root/test_dir

The dest_path is:

    tests/home_dir/root/test_dir_renamed

And the code *incorrectly* renames it to:

    tests/home_dir/root/test_dir_renamed/renamed

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
ProcEnviron:
 PATH=(custom, user)
 LANG=es_AR.utf8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.32-14.20-generic
SourcePackage: pyinotify
Uname: Linux 2.6.32-14-generic i686

Related branches

Facundo Batista (facundo) wrote :
Changed in pyinotify (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
Facundo Batista (facundo) wrote :

Note that this bug affects directly the Ubuntu One syncdaemon, because it scrambles the file paths and mixes the metadata the user has for them.

tags: added: patch
Changed in pyinotify (Ubuntu):
assignee: nobody → James Westby (james-w)
milestone: none → ubuntu-10.04-beta-2
Changed in pyinotify (Ubuntu):
importance: Medium → High
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pyinotify - 0.8.9-1ubuntu2

---------------
pyinotify (0.8.9-1ubuntu2) lucid; urgency=low

  * Cherry picked patch from upstream to fix overlapping when renaming
    path in MOVE_SELF (LP: #530268)
 -- Facundo Batista <email address hidden> Wed, 3 Mar 2010 17:49:22 -0300

Changed in pyinotify (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers