Merge lp:~facundo/ubuntu/lucid/pyinotify/fix-path-overlap into lp:ubuntu/lucid/pyinotify

Proposed by Facundo Batista
Status: Merged
Merged at revision: not available
Proposed branch: lp:~facundo/ubuntu/lucid/pyinotify/fix-path-overlap
Merge into: lp:ubuntu/lucid/pyinotify
Diff against target: 85 lines (+67/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/fix_path_overlap_in_move_self.patch (+59/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~facundo/ubuntu/lucid/pyinotify/fix-path-overlap
Reviewer Review Type Date Requested Status
Ubuntu branches Pending
Review via email: mp+21266@code.launchpad.net

Description of the change

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2010-01-29 15:42:42 +0000
3+++ debian/changelog 2010-03-12 17:51:21 +0000
4@@ -1,3 +1,10 @@
5+pyinotify (0.8.9-1ubuntu2) lucid; urgency=low
6+
7+ * Cherry picked patch from upstream to fix overlapping when renaming
8+ path in MOVE_SELF (LP: #530268)
9+
10+ -- Facundo Batista <facundo@canonical.com> Wed, 3 Mar 2010 17:49:22 -0300
11+
12 pyinotify (0.8.9-1ubuntu1) lucid; urgency=low
13
14 * Cherry picked patch from upstream to fix event arrival after removing a
15
16=== added file 'debian/patches/fix_path_overlap_in_move_self.patch'
17--- debian/patches/fix_path_overlap_in_move_self.patch 1970-01-01 00:00:00 +0000
18+++ debian/patches/fix_path_overlap_in_move_self.patch 2010-03-12 17:51:21 +0000
19@@ -0,0 +1,59 @@
20+From: Sebastien Martini <seb@dbzteam.org>
21+Subject: Fixed IN_MOVE_SELF renames of overlapping directories names
22+Origin: upstream,
23+ http://trac.dbzteam.org/pyinotify/changeset/c3cb39c167234e651ef20b1647161a073c2b9454
24+Bug: http://trac.dbzteam.org/pyinotify/ticket/38
25+Bug-Ubuntu: https://bugs.edge.launchpad.net/ubuntu/+source/pyinotify/+bug/530268
26+Reviewed-By: Facundo Batista <facundo@canonical.com>
27+Last-Update: 2010-03-12
28+
29+=== modified file 'python2/pyinotify.py'
30+--- pyinotify.orig/python2/pyinotify.py 2010-01-11 02:28:44 +0000
31++++ pyinotify/python2/pyinotify.py 2010-03-03 20:43:49 +0000
32+@@ -681,16 +681,17 @@
33+ if mv_:
34+ dest_path = mv_[0]
35+ watch_.path = dest_path
36++ # add the separator to the source path to avoid overlapping
37++ # path issue when testing with startswith()
38++ src_path += os.path.sep
39+ src_path_len = len(src_path)
40+- sep_len = len(os.path.sep)
41+ # The next loop renames all watches with src_path as base path.
42+ # It seems that IN_MOVE_SELF does not provide IN_ISDIR information
43+ # therefore the next loop is iterated even if raw_event is a file.
44+ for w in self._watch_manager.watches.values():
45+ if w.path.startswith(src_path):
46+ # Note that dest_path is a normalized path.
47+- w.path = os.path.join(dest_path,
48+- w.path[src_path_len + sep_len:])
49++ w.path = os.path.join(dest_path, w.path[src_path_len:])
50+ else:
51+ log.error("The pathname '%s' of this watch %s has probably changed "
52+ "and couldn't be updated, so it cannot be trusted "
53+
54+=== modified file 'python3/pyinotify.py'
55+--- pyinotify.orig/python3/pyinotify.py 2010-01-11 02:28:44 +0000
56++++ pyinotify/python3/pyinotify.py 2010-03-03 20:43:56 +0000
57+@@ -645,16 +645,17 @@
58+ if mv_:
59+ dest_path = mv_[0]
60+ watch_.path = dest_path
61++ # add the separator to the source path to avoid overlapping
62++ # path issue when testing with startswith()
63++ src_path += os.path.sep
64+ src_path_len = len(src_path)
65+- sep_len = len(os.path.sep)
66+ # The next loop renames all watches with src_path as base path.
67+ # It seems that IN_MOVE_SELF does not provide IN_ISDIR information
68+ # therefore the next loop is iterated even if raw_event is a file.
69+ for w in self._watch_manager.watches.values():
70+ if w.path.startswith(src_path):
71+ # Note that dest_path is a normalized path.
72+- w.path = os.path.join(dest_path,
73+- w.path[src_path_len + sep_len:])
74++ w.path = os.path.join(dest_path, w.path[src_path_len:])
75+ else:
76+ log.error("The pathname '%s' of this watch %s has probably changed "
77+ "and couldn't be updated, so it cannot be trusted "
78+
79
80=== modified file 'debian/patches/series'
81--- debian/patches/series 2010-01-29 15:42:42 +0000
82+++ debian/patches/series 2010-03-12 17:51:21 +0000
83@@ -1,1 +1,2 @@
84 wd_missing.patch
85+fix_path_overlap_in_move_self.patch

Subscribers

People subscribed via source and target branches

to all changes: