From cfbd7554437455c0b246d879381a517a886558f8 Mon Sep 17 00:00:00 2001 From: Alexandre Deckner Date: Fri, 12 Mar 2010 17:09:36 +0000 Subject: [PATCH] * When launching an app by signature, check against the correct device trash when checking if an executable is in the trash. When using find_directory(B_TRASH_DIRECTORY... to check if an entry is in the trash one should always pass the entry's volume otherwise you might be checking in the wrong trash. Might happen elsewhere in the tree, will have an opengrok look. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35826 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/app/Roster.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/kits/app/Roster.cpp b/src/kits/app/Roster.cpp index 3d7df462ed..102bb5f2c1 100644 --- a/src/kits/app/Roster.cpp +++ b/src/kits/app/Roster.cpp @@ -142,8 +142,11 @@ can_app_be_used(const entry_ref* ref) // check whether the file is in trash BPath trashPath; BDirectory directory; + BVolume volume; if (error == B_OK - && find_directory(B_TRASH_DIRECTORY, &trashPath) == B_OK + && volume.SetTo(ref->device) == B_OK + && find_directory(B_TRASH_DIRECTORY, &trashPath, false, &volume) + == B_OK && directory.SetTo(trashPath.Path()) == B_OK && directory.Contains(&entry)) { error = B_LAUNCH_FAILED_APP_IN_TRASH;