Issue 73301 - support application/octet-stream mime type in package manager
Summary: support application/octet-stream mime type in package manager
Status: CLOSED DUPLICATE of issue 84019
Alias: None
Product: udk
Classification: Code
Component: code (show other issues)
Version: OOo 1.0.0
Hardware: All All
: P3 Trivial (vote)
Target Milestone: AOO PleaseHelp
Assignee: flr
QA Contact: issues@udk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-09 13:51 UTC by flr
Modified: 2008-02-04 15:14 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
patch (1.32 KB, text/plain)
2007-01-09 13:53 UTC, flr
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description flr 2007-01-09 13:51:52 UTC
Add support for the "application/octet-stream" mime type such sthat binary
chunks can be given a mime type without the package manager complaining.

Also added the attribute executable="true" which sets the exec flag to a file.

Sample:
<manifest:file-entry
  manifest:media-type="application/octet-stream;executable=true" 
  manifest:full-path="OdfConverter"/>
Comment 1 flr 2007-01-09 13:53:19 UTC
Created attachment 42031 [details]
patch
Comment 2 flr 2007-01-09 13:54:05 UTC
added patch
Comment 3 Mathias_Bauer 2007-01-14 20:24:51 UTC
Who is supposed to integrate the patch? Please assign it to a suitable developer
or nothing will happen. :-)
Comment 4 mmeeks 2007-01-16 10:46:33 UTC
Mathias - does that mean you're happy with the patch ? if so great we can commit
to a CWS etc. any suggestions for QA ? and/or can we share an existing writer
CWS with someone else (to save overhead) ?
Comment 5 Mathias_Bauer 2007-01-16 10:53:12 UTC
No, I didn't have a look on it. But I wanted to tell Florian that nothing will
happen to this patch until it is assigned to a developer that can review it. The
only thing that will happen is that our "initial response time" statistics gets
worse because it ridiculously considers patches still assigned to the submitter
also.

I think the best owner for this patch issue would be "jl".

I wonder whether this patch can cause security problems but I leave this up to
the specialists.
Comment 6 Mathias_Bauer 2007-04-10 10:48:08 UTC
This patch is still not assigned correctly so it isn't probable that something
will happen here. Does that mean that we can close this issue?
Comment 7 flr 2007-04-11 08:18:31 UTC
flr->mba: Feel free to reassign this to the correct person.
Comment 8 Mathias_Bauer 2007-04-11 11:42:25 UTC
I assume that the requirement is that the package manager should allow that
arbitrary binary content can be added that is just unpacked but not processed
further. For this purpose the type of the binary file is completely irrelevant
so that using "application/octet-stream" looks appropriate.

Of course the package manager shouldn't complain or warn about such unknown types.
Comment 9 kai.sommerfeld 2007-04-11 14:39:27 UTC
kso->flr: One question re. the executable attribute: Why do you need this at
all? If you assemble your oxt file on Linux/Un*x, all file attributes are
preserved in the archive and should be restored *automatically* when the oxt
file gets unzipped by the Extension Manager. If Extension Manager does not
restore file attributes correctly, I consider this a bug in the unzip code it is
using. 
Comment 10 kai.sommerfeld 2007-04-11 14:47:39 UTC
added myself to cc.
Comment 11 Mathias_Bauer 2007-04-20 23:12:16 UTC
wrong component
Comment 12 kai.sommerfeld 2007-04-24 08:41:16 UTC
KSO->FLR: Please provide the missing bits of information.
Comment 13 flr 2007-04-24 08:48:17 UTC
flr->kso: To the best of my knowledge .ZIPs can't store UNIX flags.
Have you ever been able to store the UNIX flags inside .ZIPs as you suggested
above or is this just a "try this first" comment?
Comment 14 kai.sommerfeld 2007-04-24 10:08:58 UTC
KSO->FLR: I used zip 2.31 / unzip 5.52 on openSuSE 10.2 and it seems to handle
UN*X filesystem flags correctly:

temp/ziptest> ll
total 24
-rwxr-xr-x 1 kso entwick 6521 2007-04-24 10:35 executable.sh
-r--r--r-- 1 kso entwick 6521 2007-04-24 10:35 readonly.txt
-rw-rw-rw- 1 kso entwick 6521 2007-04-24 10:34 readwrite.txt
temp/ziptest>
temp/ziptest> zip ziptest.zip ./*
  adding: executable.sh (deflated 19%)
  adding: readonly.txt (deflated 19%)
  adding: readwrite.txt (deflated 19%)
temp/ziptest>
temp/ziptest> rm -f executable.sh readonly.txt readwrite.txt
temp/ziptest>
temp/ziptest> ll
total 16
-rw-r--r-- 1 kso entwick 16190 2007-04-24 10:47 ziptest.zip
temp/ziptest>
temp/ziptest> unzip ziptest.zip
Archive:  ziptest.zip
  inflating: executable.sh
  inflating: readonly.txt
  inflating: readwrite.txt
temp/ziptest>
temp/ziptest> ll
total 40
-rwxr-xr-x 1 kso entwick  6521 2007-04-24 10:35 executable.sh
-r--r--r-- 1 kso entwick  6521 2007-04-24 10:35 readonly.txt
-rw-rw-rw- 1 kso entwick  6521 2007-04-24 10:34 readwrite.txt
-rw-r--r-- 1 kso entwick 16190 2007-04-24 10:47 ziptest.zip
temp/ziptest>
Comment 15 joachim.lingner 2007-05-10 13:39:41 UTC
JL->FLR: It seems that KSO's solution, that is using zip on unix, solves the
problem. Therefore back to you. 
Comment 16 flr 2007-05-10 13:52:17 UTC
maybe. But its yet unclear whether OOo houours the system bits according to
kso's idea?

I give it to kso so that he can validate whether his idea would work.

 
Comment 17 kai.sommerfeld 2007-05-10 15:32:03 UTC
kso->flr: exec flag gets lost. A problem with the zlib we're using? Will check that.
Comment 18 kai.sommerfeld 2007-05-10 15:34:36 UTC
kso->flr: Thus, we do agree that in case OOo would preserve the flags your patch
is not needed?
Comment 19 flr 2007-05-10 15:52:57 UTC
Kind of:
a) we still need to get rid of the warning message in case of unknown items.
This is where I introduced the "application/octet-stream" mime type
b) "executable=true" only sets the user exec flag (never others or all). So
allowing the full unix flags in the zlib might be a security problem.
Maybe you can have a discussion with mba about this 'cause he raised the issue.
Comment 20 Stephan Bergmann 2007-05-10 16:02:31 UTC
> "executable=true" only sets the user exec flag (never others or all)

which leaves this feature broken in general (think deployment to shared layer)
Comment 21 kai.sommerfeld 2007-05-10 16:09:44 UTC
kso->flr: If there is no manifest entry for a file contained in the package,
Extension Manager simply unpacks it -- without complaining about unknown mime
type. This problem is a direct result of your solution for setting the exec
flag, because it requires a manifest entry.

Thus, if we decide to fix zlib (or whatever is needed to automatically restore
the flags stored in the zip file), nothing needs to be changed in the Extension
Manager code.
Comment 22 kai.sommerfeld 2007-05-10 16:19:04 UTC
Regarding security: I'm not an expert here, but my proposed solution does not
have those problems, because it only manipulates permission flags for files
contained in the package.
Comment 23 kai.sommerfeld 2007-05-21 09:05:56 UTC
Florian, 

 I thought about the topic again. There is one aspect that speaks for the
solution you suggested. One would like to be able to provide oxt files
containing stuff for multiple platforms and to be able to build this oxt on
every platform. With my solution, one  can only build the oxt on Linux/Un*x if
the oxt shall contain files which require the executable flag. 

 Thus, I would be happy to get a patch from you that extends the original patch
the way that

a) not only the user executable flag can be changed. As Stephan already pointed
out, this is needed in order to be able install the oxt for all users.
b) only only changing of attributes of files that are contained in the oxt.
(security)
Comment 24 Stephan Bergmann 2007-06-27 16:48:00 UTC
To prevent frustration among patch writers, all issues of type
PATCH are monitored for extended inactivity periods, see
<http://eis.services.openoffice.org/patchreport/irt_index.html> and
<http://eis.services.openoffice.org/patchreport/iit_index.html>.
Please proceed with this issue in an appropriate way, to satisfy
the statistics and avoid frustration.  Thanks.

[http://wiki.services.openoffice.org/wiki/Uno/Misc/InactivePatchIssueReminder]
Comment 25 pavel 2007-08-02 15:33:26 UTC
Will we do something for 2.3 or no?

If so, please proceed - today is code freeze. If not, please change target accordingly.
Comment 26 flr 2007-08-02 16:22:41 UTC
/me has not done any work on this.
kso: did you started implementing you suggestions?
Comment 27 kai.sommerfeld 2007-08-14 16:04:53 UTC
flr: As I wrote on May 21, there is nothing to do for me. If you extend your
original patch like suggested, we all should be happy. :-)
Comment 28 flr 2007-08-14 16:38:11 UTC
flr->kso: Hmmm --- got it wrong then. Thought we would work together on this...
Comment 29 thb 2007-11-21 13:32:28 UTC
I now need a fix for this, as well. The pdf import in its current state also
needs an external executable (which for obvious reasons need the executable flag
on *nix)
Comment 30 joachim.lingner 2007-12-03 09:51:48 UTC
I fixed this for issue 84019.
Comment 31 flr 2007-12-03 10:29:58 UTC
*LOL*. So where is this solutions different from mine except that it allows you
to set executions bits for any file?
Comment 32 kai.sommerfeld 2007-12-03 11:21:02 UTC
flr: re "LOL": The difference is not a different concept, but that JL
implemented a complete solution (which indeed conceptionally very similar to
what you've suggested). We all agreed months ago that your concept is okay, but
that your implementation needs to be completed. I kindly requested a complete
patch from you (wrt. to fixed support for shared extensions and the security
problem), months ago. You never came back with a completed patch. Now, we needed
this functionality by ourself and the consequence is that we implemented it.
Comment 33 flr 2007-12-03 11:29:58 UTC
And suddenly there are 
a) no security concerns?
b) no "use zip exec flags" etc?
Why that? If you needed a solution why ask me to implement the "zip" stuff and
post concerns regarding security and then when you need it do not listen to your
own advice at all?
Makes no sense to me!
Comment 34 kai.sommerfeld 2007-12-03 12:29:39 UTC
flr: I really suggest you to (again) read the things that were said in this
issue before writing further comments.

>------- Additional comments from kso Mon May 21 08:05:56 +0000 2007 -------
>
[...]
>
> I thought about the topic again. There is one aspect that speaks for the
>solution you suggested. One would like to be able to provide oxt files
>containing stuff for multiple platforms and to be able to build this oxt on
>every platform. With my solution, one  can only build the oxt on Linux/Un*x if
>the oxt shall contain files which require the executable flag. 
>
> Thus, I would be happy to get a patch from you that extends the original patch
>the way that
>
 That said, my suggestion to use the "right" zip to preserve file attributes was
obsolete (I thought).

>a) not only the user executable flag can be changed. As Stephan already pointed
>out, this is needed in order to be able install the oxt for all users.
 JL implemented this.

>b) only only changing of attributes of files that are contained in the oxt.
>(security)
 JL implemented this as well.

===============================

>------ Additional comments from flr Thu Aug 2 15:22:41 +0000 2007 -------
>
>/me has not done any work on this.
>kso: did you started implementing you suggestions?
>
>------- Additional comments from kso Tue Aug 14 15:04:53 +0000 2007 -------
>
>flr: As I wrote on May 21, there is nothing to do for me. If you extend your
>original patch like suggested, we all should be happy. :-)
>------- Additional comments from flr Tue Aug 14 15:38:11 +0000 2007 -------
>
>flr->kso: Hmmm --- got it wrong then. Thought we would work together on this...

 After reading this, I considered the confusions about what to do as solved.
Comment 35 Mathias_Bauer 2008-01-11 14:03:47 UTC
Correct me if I'm wrong but I think this issue now is obsolete as the problem
was fixed in another issue already?! 
In that case it should be closed before it can confuse the poor release status
meeting attendees. :-)
Comment 36 Mathias_Bauer 2008-02-04 13:47:50 UTC
Florian?!
Please either close this issue or change the target. It would help keeping track
of 2.4 development.
Comment 37 Martin Hollmichel 2008-02-04 14:34:31 UTC
set to OOoLater as Fridrich suggested in release status meeting. 
Comment 38 kai.sommerfeld 2008-02-04 15:14:03 UTC
duplicate.

*** This issue has been marked as a duplicate of 84019 ***
Comment 39 kai.sommerfeld 2008-02-04 15:14:28 UTC
.