Deleting a document stored in the SD card does not work

Bug #1524293 reported by Elbarbudo
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ubuntu Document Viewer App
Fix Released
High
Stefano Verzegnassi

Bug Description

Download a file xyz.pdf
Open document Viewer
Slide right one document in the list : A red recycle bin appears on the left
tap on it : a dialog box pop up " Are you sure"?
Tad "delete"

The file is still here !

=====
SOLUTION:
The issue only happens when trying to delete files from the SD card.

Add the following write permission for external medias to our AppArmor profile.

"write_path": [
    "/media/*/*/[Dd][Oo][Cc][Uu][Mm][Ee][Nn][Tt][Ss]/"
]

Tags: bitesize

Related branches

Revision history for this message
Stefano Verzegnassi (verzegnassi-stefano) wrote :

Thanks for taking some time to report the issue.

Which version of docviewer are you using? I've just tested with 2.0.226 (on rc-proposed channel) and deletion of a document works for me.
Therefore, I need further informations in order to triage and confirm the issue.

Could you please check with another app (e.g. File Manager) if the file still exists? Also, could you attach the application log to this report? (also using pastebin would be okay).

Thanks in advance.

Changed in ubuntu-docviewer-app:
status: New → Incomplete
Revision history for this message
Elbarbudo (patricearnal) wrote :

Where can I find the docviewer version?

My phone is up-to-date according to the system parameters/update

Yes the file is still here in File Manager

What is the package of docviewer ?
ubuntu-bug docviewer leads to "package not installed" on the phone.

Revision history for this message
Stefano Verzegnassi (verzegnassi-stefano) wrote :

You need to reproduce the issue again, then you should be able to find the log in /home/phablet/.cache/upstart.
The file is called "application-click-com.ubuntu.docviewer_docviewer_<app_version>.log".

> Where can I find the docviewer version?
Which version of Ubuntu are you running on your device? (you can see it from the system settings)
The latest version of DocViewer is only available for the latest OTA.
In order to make this check easier, just let me know if you are able to open MS-Office or LibreOffice documents (this feature is only available in the latest release of the app).

I did some further attempt to reproduce the bug. All I found is that the list of available documents is not always updated when the app is recovered from suspension, which doesn't seem to be related to your issue.

Revision history for this message
Elbarbudo (patricearnal) wrote :

phablet@ubuntu-phablet:~/.cache/upstart ls -l application-click-com.ubuntu.docviewer_docviewer_2.0.226.log
-rw-r----- 1 phablet phablet 38822 déc. 9 14:00 application-click-com.ubuntu.docviewer_docviewer_2.0.226.log
phablet@ubuntu-phablet:~/.cache/upstart

OTA-8 20151118.2

Revision history for this message
Stefano Verzegnassi (verzegnassi-stefano) wrote :

The log has been really helpful, so thank you again!
Finally I've been able to reproduce it on my device.

The issue only happens when trying to delete a file from the SD card.

Relevant output of 'sudo dmesg | grep DEN':
[11669.122182] type=1400 audit(1449695726.600:234): apparmor="DENIED" operation="unlink" profile="com.ubuntu.docviewer_docviewer_2.0.226" name="/media/phablet/3C6E-3A51/Documents/2.pdf" pid=24169 comm="ubuntu-docviewe" requested_mask="d" denied_mask="d" fsuid=32011 ouid=32011

After a check at the application AppArmor template, I've seen that we don't have write permissions for adding/editing/removing files in the SD card.

I'm planning to fix it for the next Document Viewer release.

Thanks again!

summary: - Deleting a document from Viewer does not work
+ Deleting a document stored in the SD card does not work
Changed in ubuntu-docviewer-app:
status: Incomplete → Triaged
importance: Undecided → High
milestone: none → ww02-2016
tags: added: bitesize
description: updated
Changed in ubuntu-docviewer-app:
assignee: nobody → Stefano Verzegnassi (verzegnassi-stefano)
Revision history for this message
Elbarbudo (patricearnal) wrote :

Thank for the informations.

I think there is a general issue with the SD card :
the file manager always request a password to access the SD card whereas the terminal does not.

In both cases, the password was already issued, so I thought full access was granted.

I already posted a question about having the home directory on the SDcard, but it was closed with no answer.

Revision history for this message
Stefano Verzegnassi (verzegnassi-stefano) wrote :

Terminal-app requires a password when it's launched, so both the apps actually requires an authentication before accessing the SD card.

I'm not part of the Ubuntu File Manager team, what I'll write below is just an opinion as a Ubuntu Phone user.
Data in user's folders are as critical as data in a external storage. The same security policy should be used for these two "sources", and no password should be required when the user tries to access the SD card.
Other apps (e.g. camera-app, gallery-app) have a read/write SD card support, with no required password, since the version 1.0 of the confinement policies[1][2]

Thinking at a convergent Ubuntu device, whose owner may want to plug a USB pen drive, I believe this could be something strongly required.

I don't know where your report has been tracked, however I think this is something worth to be rediscussed. :)

[1] camera-app, gallery-app since version 1.0:
http://bazaar.launchpad.net/~ubuntu-security/apparmor-easyprof-ubuntu/trunk/view/head:/data/policygroups/ubuntu/1.0/picture_files

[2] music-app since 1.1:
http://bazaar.launchpad.net/~ubuntu-security/apparmor-easyprof-ubuntu/trunk/view/head:/data/policygroups/ubuntu/1.1/music_files

Changed in ubuntu-docviewer-app:
status: Triaged → In Progress
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :

Fix committed into lp:ubuntu-docviewer-app at revision 242, scheduled for release in ubuntu-docviewer-app, milestone ww02-2016

Changed in ubuntu-docviewer-app:
status: In Progress → Fix Committed
Changed in ubuntu-docviewer-app:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.