diff -u nautilus-2.22.3/debian/patches/series nautilus-2.22.3/debian/patches/series --- nautilus-2.22.3/debian/patches/series +++ nautilus-2.22.3/debian/patches/series @@ -13,2 +13,3 @@ #81_gnome-app-install.patch +90_from_svn_dont_allow_recursive_copies.patch 99_ltmain_as-needed.patch -p0 diff -u nautilus-2.22.3/debian/changelog nautilus-2.22.3/debian/changelog --- nautilus-2.22.3/debian/changelog +++ nautilus-2.22.3/debian/changelog @@ -1,3 +1,11 @@ +nautilus (1:2.22.3-0ubuntu2) hardy-proposed; urgency=low + + * debian/patches/90_from_svn_dont_allow_recursive_copies.patch: + - change from svn, don't allow recursive copies in the same directory + (lp: #232190) + + -- Sebastien Bacher Fri, 30 May 2008 12:53:09 +0200 + nautilus (1:2.22.3-0ubuntu1) hardy-proposed; urgency=low * New upstream version (lp: #235594): only in patch2: unchanged: --- nautilus-2.22.3.orig/debian/patches/90_from_svn_dont_allow_recursive_copies.patch +++ nautilus-2.22.3/debian/patches/90_from_svn_dont_allow_recursive_copies.patch @@ -0,0 +1,114 @@ +--- trunk/libnautilus-private/nautilus-file-operations.c 2008/05/04 00:05:12 14130 ++++ trunk/libnautilus-private/nautilus-file-operations.c 2008/05/05 09:43:48 14131 +@@ -3221,6 +3221,26 @@ + } + } + ++static gboolean ++test_dir_is_parent (GFile *child, GFile *root) ++{ ++ GFile *f; ++ ++ f = g_file_dup (child); ++ while (f) { ++ if (g_file_equal (f, root)) { ++ g_object_unref (f); ++ return TRUE; ++ } ++ f = g_file_get_parent (f); ++ } ++ ++ if (f) { ++ g_object_unref (f); ++ } ++ return FALSE; ++} ++ + /* Debuting files is non-NULL only for toplevel items */ + static void + copy_move_file (CopyMoveJob *copy_job, +@@ -3261,6 +3281,41 @@ + dest = get_target_file (src, dest_dir, same_fs); + } + ++ ++ /* Don't allow recursive move/copy into itself. ++ * (We would get a file system error if we proceeded but it is nicer to ++ * detect and report it at this level) */ ++ if (test_dir_is_parent (dest_dir, src)) { ++ if (job->skip_all_error) { ++ g_error_free (error); ++ goto out; ++ } ++ ++ /* the run_warning() frees all strings passed in automatically */ ++ primary = copy_job->is_move ? g_strdup (_("You cannot move a folder into itself.")) ++ : g_strdup (_("You cannot copy a folder into itself.")); ++ secondary = g_strdup (_("The destination folder is inside the source folder.")); ++ ++ response = run_warning (job, ++ primary, ++ secondary, ++ NULL, ++ GTK_STOCK_CANCEL, SKIP_ALL, SKIP, ++ NULL); ++ ++ if (response == 0 || response == GTK_RESPONSE_DELETE_EVENT) { ++ abort_job (job); ++ } else if (response == 1) { /* skip all */ ++ job->skip_all_error = TRUE; ++ } else if (response == 2) { /* skip */ ++ /* do nothing */ ++ } else { ++ g_assert_not_reached (); ++ } ++ ++ goto out; ++ } ++ + retry: + + error = NULL; +@@ -3788,6 +3843,41 @@ + + dest = get_target_file (src, dest_dir, same_fs); + ++ ++ /* Don't allow recursive move/copy into itself. ++ * (We would get a file system error if we proceeded but it is nicer to ++ * detect and report it at this level) */ ++ if (test_dir_is_parent (dest_dir, src)) { ++ if (job->skip_all_error) { ++ g_error_free (error); ++ goto out; ++ } ++ ++ /* the run_warning() frees all strings passed in automatically */ ++ primary = move_job->is_move ? g_strdup (_("You cannot move a folder into itself.")) ++ : g_strdup (_("You cannot copy a folder into itself.")); ++ secondary = g_strdup (_("The destination folder is inside the source folder.")); ++ ++ response = run_warning (job, ++ primary, ++ secondary, ++ NULL, ++ GTK_STOCK_CANCEL, SKIP_ALL, SKIP, ++ NULL); ++ ++ if (response == 0 || response == GTK_RESPONSE_DELETE_EVENT) { ++ abort_job (job); ++ } else if (response == 1) { /* skip all */ ++ job->skip_all_error = TRUE; ++ } else if (response == 2) { /* skip */ ++ /* do nothing */ ++ } else { ++ g_assert_not_reached (); ++ } ++ ++ goto out; ++ } ++ + retry: + + flags = G_FILE_COPY_NOFOLLOW_SYMLINKS | G_FILE_COPY_NO_FALLBACK_FOR_MOVE; +