Merge lp:~rye/ubuntuone-client/ignore-in-close-write-in-dirs-stable-3-0 into lp:ubuntuone-client

Proposed by Roman Yepishev
Status: Superseded
Proposed branch: lp:~rye/ubuntuone-client/ignore-in-close-write-in-dirs-stable-3-0
Merge into: lp:ubuntuone-client
Diff against target: 65 lines (+17/-2) (has conflicts)
4 files modified
Makefile.am (+5/-0)
configure.ac (+1/-1)
ubuntuone/platform/filesystem_notifications/linux.py (+10/-0)
windows/clientdefs.py (+1/-1)
Text conflict in Makefile.am
To merge this branch: bzr merge lp:~rye/ubuntuone-client/ignore-in-close-write-in-dirs-stable-3-0
Reviewer Review Type Date Requested Status
Ubuntu One hackers Pending
Review via email: mp+106613@code.launchpad.net

This proposal has been superseded by a proposal from 2012-05-21.

Commit message

Ignore IN_CLOSE_WRITE for directories

Description of the change

MANUAL TESTING ONLY

If you approve this, please also approve https://code.launchpad.net/~rye/ubuntuone-client/ignore-in-close-write-in-dirs/+merge/106612 which is the same code but for trunk.

This branch adds the same types of filters as are already in place to make sure that events IN_OPEN and IN_CLOSE_NOWRITE work only on files.

eCryptFS layer used in Ubuntu for Private directories can send IN_CLOSE_WRITE on directories breaking syncdaemon and preventing the users from running Ubuntu One with ~/.Private directory.

This patch does not have an automatic test since it is possible to trigger the bug only with eCryptFS mount.

To test:
0. Before patching:
1. Create a private ecryptfs directory: ecryptfs-setup-private and follow all the prompts including relogin.
2. After relogin add underlying ~/.Private folder to Ubuntu One: u1sdtool --create-folder=~/.Private
3. Notice that files do upload
4. Open this directory and put another file in it.

At this point no files will be uploaded for any Ubuntu One directory due to the unexpected event from INotify subsystem. The log will show:
exceptions.KeyError: "Unhandled Event in INotify: <Event dir=True mask=0x40000008 maskname=IN_CLOSE_WRITE|IN_ISDIR name='' path=/home/rtg/.Private pathname=/home/rtg/.Private wd=8 >"

5. Apply the patch and restart syncdaemon.
6. Add another file to the directory. Notice that the amount of entries in https://one.ubuntu.com/files/ in ~/.Private UDF corresponds to the number of files locally (filenames are encrypted).

To post a comment you must log in.
1192. By Alejandro J. Cura

Tests for the eCryptFS fix

Unmerged revisions

1192. By Alejandro J. Cura

Tests for the eCryptFS fix

1191. By Roman Yepishev

Ignore IN_CLOSE_WRITE for directories

1190. By dobey

[release] 3.0.1

1189. By dobey

Fix the Makefile such that tests will fail properly again

1188. By Facundo Batista

Use PathLockTree to get one GetDelta at a time.

1187. By Brian Curtin

No longer check whether or not we are actually running as admin on Windows

1186. By Diego Sarmentero

- Avoid creating SyncDaemonTool if is not already running and the user wants to close it. (LP: #907479).

1185. By Facundo Batista

Use the correct comparison to decide in which queue (LP: #978903).

1184. By Charles Kerr

Fix dirpath leak in syncdaemon_daemon_is_folder_enabled()

1183. By dobey

[release] 3.0.0

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile.am'
2--- Makefile.am 2012-05-15 13:25:37 +0000
3+++ Makefile.am 2012-05-21 11:50:22 +0000
4@@ -54,8 +54,13 @@
5 test: logging.conf $(clientdefs_DATA) Makefile
6 echo "$(PYTHONPATH)"
7 if test "x$(builddir)" == "x$(srcdir)"; then \
8+<<<<<<< TREE
9 PYTHONPATH="$(PYTHONPATH)" u1trial -r $(REACTOR) -p tests/platform/windows,tests/proxy -i "test_windows.py,test_darwin.py" tests || exit 1; \
10 PYTHONPATH="$(PYTHONPATH)" u1trial -r qt4 -p tests/platform/windows -i "test_windows.py,test_darwin.py" tests/proxy || exit 1; \
11+=======
12+ PYTHONPATH="$(PYTHONPATH)" u1trial -r $(REACTOR) -p tests/platform/windows,tests/proxy tests || exit 1; \
13+ PYTHONPATH="$(PYTHONPATH)" u1trial -r qt4 -p tests/platform/windows tests/proxy || exit 1; \
14+>>>>>>> MERGE-SOURCE
15 fi
16 rm -rf _trial_temp
17
18
19=== modified file 'configure.ac'
20--- configure.ac 2012-02-10 15:07:59 +0000
21+++ configure.ac 2012-05-21 11:50:22 +0000
22@@ -1,7 +1,7 @@
23 dnl Process this file with autoconf to produce a configure script.
24 AC_PREREQ(2.53)
25
26-AC_INIT([ubuntuone-client], [3.1])
27+AC_INIT([ubuntuone-client], [3.0.1])
28 AC_CONFIG_SRCDIR([config.h.in])
29
30 AM_INIT_AUTOMAKE([1.10 foreign])
31
32=== modified file 'tests/platform/os_helper/test_windows.py'
33=== modified file 'ubuntuone/platform/filesystem_notifications/linux.py'
34--- ubuntuone/platform/filesystem_notifications/linux.py 2012-05-14 21:24:24 +0000
35+++ ubuntuone/platform/filesystem_notifications/linux.py 2012-05-21 11:50:22 +0000
36@@ -212,6 +212,16 @@
37 if not (event.mask & pyinotify.IN_ISDIR):
38 self.general_processor.push_event(event)
39
40+ @validate_filename
41+ def process_IN_CLOSE_WRITE(self, event):
42+ """Filter IN_CLOSE_WRITE to make it happen only in files.
43+
44+ eCryptFS sends IN_CLOSE_WRITE event for lower directories.
45+
46+ """
47+ if not (event.mask & pyinotify.IN_ISDIR):
48+ self.general_processor.push_event(event)
49+
50 def process_IN_MOVE_SELF(self, event):
51 """Don't do anything here.
52
53
54=== modified file 'windows/clientdefs.py'
55--- windows/clientdefs.py 2012-04-09 20:07:05 +0000
56+++ windows/clientdefs.py 2012-05-21 11:50:22 +0000
57@@ -41,7 +41,7 @@
58 Q_ = lambda string: gettext.dgettext(GETTEXT_PACKAGE, string)
59
60 # pylint: disable-msg=C0301
61-VERSION = '0.1'
62+VERSION = '3.0.0'
63 LOCALEDIR = ''
64 LIBEXECDIR = ''
65 GETTEXT_PACKAGE = ''

Subscribers

People subscribed via source and target branches