Bug Hunting Session
Bug 104065 - Could not execute embedded OLE object in Linux environment
Summary: Could not execute embedded OLE object in Linux environment
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: x86-64 (AMD64) Linux (All)
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: OLE-Object-Interoperability
  Show dependency treegraph
 
Reported: 2016-11-20 19:50 UTC by Rizal Muttaqin
Modified: 2018-01-04 09:19 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
A MS Word document with embedded picture object (277.98 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2016-11-20 19:50 UTC, Rizal Muttaqin
Details
Screenshot of MS Word 2013 opening this file on Win10 (38.78 KB, image/png)
2016-11-23 12:21 UTC, Mike Kaganski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rizal Muttaqin 2016-11-20 19:50:12 UTC
Created attachment 128893 [details]
A MS Word document with embedded picture object

I'm from Indonesia, currently trying to use LibreOffice in the office. Actually I always use LibreOffice in my personal laptop and in this new quarter I'm facing new office policy to migrate my office machine to GNU/Linux based operating system (Ubuntu exactly). So, naturally I've to deal with many old MS Office files. 

In the first place there's no big problem apart from little formatting change in Writer but one point I messed up: OLE object. So I'm unable to open embedded object such as picture, plain text or Excel spreadsheet, etc in a Word OOXML (.docx) document. 

I've found a workaround: rename .docx file to .zip then extract it and search for embedded file in a specific folder. Oh it's very frustrating to do that. And I have to create same type of document with embedded object as icon in Word OOXML format.

But whenever I opened the document in a Windows (*type version here*) environment, every office including WPS Office and LibreOffice could execute object as expected (double click on the object and then it would be opened by correspondence program). This problem seems occurred in Ubuntu machine (or any OS other than Windows may be?) proved by the absence of "Activate Contents" context menu when right clicking on the object.

For testing purpose, I've created a new file by MS Word 2007.
The step to created such file is : Insert -> Object -> Create from file -> Display as an icon then OK.
Comment 1 Buovjaga 2016-11-20 19:55:27 UTC
I confirm it opens on Windows 10, but not on Linux.

Arch Linux 64-bit, KDE Plasma 5
Version: 5.3.0.0.alpha1+
Build ID: f533b3f39956fe8028c1f7f7cc3c37b0feed8b57
CPU Threads: 8; OS Version: Linux 4.8; UI Render: default; VCL: kde4; Layout Engine: new; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on November 19th 2016

Arch Linux 64-bit
LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4
Comment 2 m.a.riosv 2016-11-21 23:15:46 UTC
Please take a look to this thread on the AOo forum
https://forum.openoffice.org/en/forum/viewtopic.php?f=7&t=1550
There is a nice explanation about OLE object.

In this case if works on windows and not in Linux, looks as the application of the OLE object it's not installed on Linux. I think not a bug.
Comment 3 Rizal Muttaqin 2016-11-22 06:50:45 UTC
(In reply to m.a.riosv from comment #2)
> Please take a look to this thread on the AOo forum
> https://forum.openoffice.org/en/forum/viewtopic.php?f=7&t=1550
> There is a nice explanation about OLE object.
> 
> In this case if works on windows and not in Linux, looks as the application
> of the OLE object it's not installed on Linux. I think not a bug.


Does "Application of the OLE object it's not installed by default on Linux" means OLE Object is a Windows only technology? So why does the feature is available in LibreOffice for Linux? From what I've read here:

https://en.wikipedia.org/wiki/Object_Linking_and_Embedding

"If software that understands an OLE object is not available, the object is usually replaced by a picture (bitmap representation of the object) or not displayed at all"

The situation look familiar here, LibreOffice in Linux threat an OLE object in a document created by MS Word as a "passive" picture (moreover just an icon) rather an executable one and in other hand threat an OLE object embedded in a document created by LibreOffice Writer itself as a blank selection square when we click on it that's not displayed at all.

I don't have any advance experience in software development but if then this is not a bug instead on a feature impartiality related to operating system, would the developer consider to implement an API or whatever such as this one : https://www.decalage.info/python/oletools or remove OLE Object Insert option completely for Linux build because normal user would expect the OLE Object Insert option is working normally.
Comment 4 Mike Kaganski 2016-11-23 11:51:00 UTC
The OLEs open on Windows not because it's Windows, but because there are OLE Servers installed on Windows. The "corresponding program" you mentioned in comment 0 should be MS Office, isn't it?
Comment 5 Buovjaga 2016-11-23 11:58:15 UTC
(In reply to Mike Kaganski from comment #4)
> The OLEs open on Windows not because it's Windows, but because there are OLE
> Servers installed on Windows. The "corresponding program" you mentioned in
> comment 0 should be MS Office, isn't it?

No it is not. It is the Windows image viewer or any associated image viewer. The file is a .jpg. I don't have MSO.
Comment 6 Michael Stahl (CIB) 2016-11-23 12:08:28 UTC
LibreOffice documents can contain 2 different kinds of embedded objects:
* Windows native OLE embedded objects
* embedded objects for which LibreOffice has its own import filter

If LibreOffice doesn't have a filter for the object, it can only be opened on Windows via native OLE.

Unfortunately the UI uses the words "Insert OLE object" for both types,
which is a bit confusing (see bug 82625).

for the embedded object in the attached document, it appears that
LO cannot detect the document type.

the "file" tool isn't doing any better:
> file word/embeddings/oleObject1.bin 
word/embeddings/oleObject1.bin: Composite Document File V2 Document, Cannot read section info

the document.xml contains "<o:OLEObject Type="Embed" ProgID="Package" ...",
no idea what "Package" means here.
Comment 7 Mike Kaganski 2016-11-23 12:16:19 UTC
(In reply to Buovjaga from comment #5)
> It is the Windows image viewer or any associated image viewer.
> The file is a .jpg. I don't have MSO.

Ok, but this, unfortunately, just hides the same reason. Windows OLE requires specific OLE handler to be present on the system.

Is that actually "any associated image viewer"? It could be so; if so, it just means that the OLE handler installed for this type of OLE actually extracts the image and then calls system's viewer; while usually that is not the case: more often, only specific app opens the OLE. Do you see different apps opening the same embedding if you change system's image viewer?
Comment 8 Mike Kaganski 2016-11-23 12:21:50 UTC
Created attachment 128956 [details]
Screenshot of MS Word 2013 opening this file on Win10

E.g. for me on Windows 10, with MS Office 2013, it opens like this.
Comment 9 Buovjaga 2016-11-23 12:23:57 UTC
(In reply to Mike Kaganski from comment #7)
> (In reply to Buovjaga from comment #5)
> > It is the Windows image viewer or any associated image viewer.
> > The file is a .jpg. I don't have MSO.
> 
> Ok, but this, unfortunately, just hides the same reason. Windows OLE
> requires specific OLE handler to be present on the system.
> 
> Is that actually "any associated image viewer"? It could be so; if so, it
> just means that the OLE handler installed for this type of OLE actually
> extracts the image and then calls system's viewer; while usually that is not
> the case: more often, only specific app opens the OLE. Do you see different
> apps opening the same embedding if you change system's image viewer?

Yes, on the Win 10 VM it used whatever comes with Windows and now on my Win 7 it uses my default viewer Irfanview.

Win 7 Pro 64-bit Version: 5.3.0.0.alpha1+
Build ID: 172325bedf69bbc162f3c1948264451c90c105a3
CPU Threads: 4; OS Version: Windows 6.1; UI Render: default; Layout Engine: new; 
TinderBox: Win-x86@39, Branch:master, Time: 2016-11-21_05:26:40
Locale: fi-FI (fi_FI); Calc: group
Comment 10 Mike Kaganski 2016-11-23 12:26:11 UTC
The previous screenshot shows that the type of the object is "OLE Package object" (translated from Russian).
This means that there must exist "OLE Package" server on system, that can treat such packages.
Comment 11 QA Administrators 2017-11-24 17:34:27 UTC Comment hidden (obsolete)
Comment 12 Mike Kaganski 2018-01-03 20:23:53 UTC
I can open the image in the test document on Ubuntu 16.04 64-bit with Version: 5.4.4.2
Build ID: 1:5.4.4~rc2-0ubuntu0.16.04.1~lo1
CPU threads: 2; OS: Linux 4.4; UI render: default; VCL: gtk2; 
Locale: en-US (en_US.UTF-8); Calc: group

I suppose that the OS might have included the required application for the data object; or possibly I have installed something there that enables me now to handle the "Package" packages (sorry for pun) :)
Comment 13 Mike Kaganski 2018-01-04 08:46:12 UTC
Fixed by:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=75367918028dffb7a137d29644a7a6e1f7af7c9b

author	Caolán McNamara <caolanm@redhat.com>	2017-01-12 09:49:36 +0000
committer	Caolán McNamara <caolanm@redhat.com>	2017-01-12 11:18:51 +0000
commit	75367918028dffb7a137d29644a7a6e1f7af7c9b
tree	ec796f2d28c0cecc355670ed5a70571b8df7cbd9
parent	a70a62c013318b45eb23d6451d442bc6f702a282
in extremis dump Ole10Native payload and launch system viewer on it
so embedded plain text documents/source code/etc in word documents can be viewed
by us under Linux