Bug 115659 - Apparmor profile for senddoc is broken
Summary: Apparmor profile for senddoc is broken
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.0.1.1 release
Hardware: All Linux (All)
: medium normal
Assignee: Olivier Tilloy
URL:
Whiteboard: target:6.0.2 target:6.1.0
Keywords:
: 115646 115711 115727 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-02-12 18:08 UTC by Olivier Tilloy
Modified: 2020-04-24 19:26 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Tilloy 2018-02-12 18:08:58 UTC
Description:
Bug originally reported here: https://launchpad.net/bugs/1748895

Steps to Reproduce:
1. With apparmor profiles loaded, try sending the current doc by e-mail from the file menu

Actual Results:  
An error message box saying: "LibreOffice is unable to find a working email configuration. Please save your document locally and attached from within your eMAIL client."

Expected Results:
The preferred e-mail client is opened and starts composing an e-mail with the current document attached


Reproducible: Always


User Profile Reset: No



Additional Info:


User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/64.0.3282.140 Chrome/64.0.3282.140 Safari/537.36
Comment 1 Olivier Tilloy 2018-02-12 18:10:53 UTC
The apparmor profile for senddoc is broken in several ways:

 - the path to the installed executable is incorrect
 - it's missing an exception for xdg-email, which is used to create a new e-mail
 - it's missing an include statement for <abstractions/ubuntu-helpers>, which provides the sanitized_helper profile
Comment 2 Olivier Tilloy 2018-02-12 18:20:20 UTC
Fix proposed for review: https://gerrit.libreoffice.org/#/c/49614/
Comment 3 Commit Notification 2018-02-13 21:00:39 UTC
Olivier Tilloy committed a patch related to this issue.
It has been pushed to "libreoffice-6-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=60119a71e0f712f461b290abb009c7d8e62603b2&h=libreoffice-6-0

tdf#115659 Apparmor profile fixes for senddoc

It will be available in 6.0.2.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Rene Engelhard 2018-02-14 06:55:28 UTC
> An error message box saying: "LibreOffice is unable to find a working email configuration. Please save your document locally and attached from within your eMAIL client."

Interesting I get that also with apparmor only in complain mode...
Comment 5 Commit Notification 2018-02-14 07:00:31 UTC
Olivier Tilloy committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=92dbf3f70eafd4974290fc488f51c05093950dbf

tdf#115659 Apparmor profile fixes for senddoc

It will be available in 6.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Xisco Faulí 2018-02-14 10:21:21 UTC
*** Bug 115711 has been marked as a duplicate of this bug. ***
Comment 7 Xisco Faulí 2018-02-14 10:21:59 UTC
Moving to ASSIGNED
Comment 8 Bernard Moreton 2018-02-15 10:15:32 UTC
So there are 2 target dates - I hope that "Send" will become functional again in 6.0.2.  Sending documents is pretty fundamental, and new users especially will be discouraged that it doesn't work.
Comment 9 Xisco Faulí 2018-02-15 17:41:00 UTC
*** Bug 115727 has been marked as a duplicate of this bug. ***
Comment 10 Xisco Faulí 2018-02-21 23:22:58 UTC
*** Bug 115646 has been marked as a duplicate of this bug. ***
Comment 11 Ralph Stahl 2018-03-02 12:25:30 UTC
Build-ID: 1:6.0.2~rc1-0ubuntu0.16.04.1~lo1

"Send document as e-mail"
"Send PDF as email" 

does not work  as advertised for version 6.0.2, nothing happens, no error message (that's new...).
Extras/Options/Internet/E-Mail is set to /usr/bin/thunderbird.
Okay, it is rc1 yet...
Comment 12 Olivier Tilloy 2018-03-02 13:11:57 UTC
Ralph: try unsetting the Extras/Options/Internet/E-Mail preference. Libreoffice will default to xdg-email, which is allowed and will do the right thing if thunderbird is configured as your default e-mail client.
Comment 13 Ralph Stahl 2018-03-02 13:49:25 UTC
Olivier, this works! Why not with /usr/bin/thunderbird? Respectively, what for is this configuration? Is this documented somewhere? 
Thank you :-).
Comment 14 Olivier Tilloy 2018-03-02 16:09:06 UTC
(In reply to Ralph Stahl from comment #13)
> Olivier, this works! Why not with /usr/bin/thunderbird? Respectively, what
> for is this configuration? Is this documented somewhere? 

I'm not sure whether this is documented. I suppose it's for overriding the the system default, or for systems that don't have xdg-email.
The apparmor profile cannot add entries for every possible e-mail client out there.
Comment 15 Bernard Moreton 2018-03-03 16:33:50 UTC
Sadly, unsetting tools/options/internet/email does not work for me, not even when quitting LO and then re-starting before trying to Send.  Trying to Send now leaves me in limbo, somewhere between LO and my email client (Claws), with neither having focus, so alt-tab gets me nowhere until I manually reassert focus on one or the other.
Build ID: 1:6.0.2~rc1-0ubuntu0.16.04.1~lo1
on Ubunto 16.04.4 LTS

Help (on tools/options/internet/email) is not at all helpful,
and Browse isn't either - on my system it includes claws-mail.

If I select xdg-email, then I get the same result s for Claws.
xdg-email --attach <FILE> works fine for me from the command line.

If AppArmor has to be enforced, then suitable documentation should be provided for new users.  It seems that security is now a step ahead of usability?
Comment 16 Olivier Tilloy 2018-03-05 14:17:57 UTC
Bernard, I can observe the issue you describe if I set claws as my default e-mail client. It's not an apparmor related issue though, as it still happens after unloading all the libreoffice apparmor profiles.

Would you mind filing a new bug to track that issue separately? Thanks!
Comment 17 Bernard Moreton 2018-03-05 17:15:14 UTC
Done that, Olivier - Bug 116211.
I originally reported this on a separate report, which then got linked to this apparmor one ...
Comment 18 Xisco Faulí 2018-06-04 08:49:30 UTC
A polite ping to Olivier Tilloy:
Is this bug fixed? if so, could you please close it as RESOLVED FIXED ? Otherwise, Could you please explain what's missing?
Thanks
Comment 19 Olivier Tilloy 2018-08-08 21:15:24 UTC
This is fixed indeed.
Comment 20 BarryHavenga 2019-04-03 15:45:43 UTC
I am experiencing a similar problem with Libreoffice 6.2.2 running on KDE-Neon.

Tools/Options/InternetE-Mail is blank.

Selecting File/Send/Email_Document, the Thunderbird (default email client) compose screen is evoked but the document which was supposed to be attached is not.
Comment 21 BarryHavenga 2019-04-03 15:46:48 UTC Comment hidden (obsolete)
Comment 22 BarryHavenga 2019-04-03 15:47:25 UTC Comment hidden (obsolete)
Comment 23 TISSENDIER Pierre 2020-04-03 07:48:43 UTC
I am experiencing a similar problem with Libreoffice 6.4.2.2 running on Ubuntu 18.04 LTS snap version and ppa version

In snap version :
1-Tools/Options/InternetE-Mail is "/home/myuser/Applications/thunderbird/thunderbird %u"

Selecting File/Send/Email_Document, the Thunderbird (default email client) compose screen is evoked but the document which was supposed to be attached is not.

2-Tools/Options/InternetE-Mail is "/home/myuser/Applications/thunderbird/thunderbird"

Selecting File/Send/Email_Document, the Thunderbird (default email client) compose screen is not evoked.


I'm test also this macro :
sub calculatror
	r=shell(ConvertToURL("file:///usr/bin/gnome-calculator"),2)
	print r
	r=shell("/usr/bin/gnome-calculator",2)
	print r
end sub

I'm get "file not found" ???

In ppa version all is right !
Comment 24 TISSENDIER Pierre 2020-04-03 07:55:16 UTC

*** This bug has been marked as a duplicate of bug 130982 ***
Comment 25 Buovjaga 2020-04-24 19:26:25 UTC
(In reply to BarryHavenga from comment #20)
> I am experiencing a similar problem with Libreoffice 6.2.2 running on
> KDE-Neon.
> 
> Tools/Options/InternetE-Mail is blank.
> 
> Selecting File/Send/Email_Document, the Thunderbird (default email client)
> compose screen is evoked but the document which was supposed to be attached
> is not.

Please open a new report for this and please use 6.4.x to test it.

Everyone: don't be naughty and change the status...