Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mime types for sharedlib and executable #33595

Merged
merged 1 commit into from
Dec 14, 2018
Merged

Conversation

sharidas
Copy link
Contributor

@sharidas sharidas commented Nov 20, 2018

Add mime types for application/x-sharedlib
and application/x-executable

Signed-off-by: Sujith H sharidasan@owncloud.com

Description

Add mime type mapping for application/x-sharedlib and application/x-executable. This would help files detected with the mentioned missing mime types. Hence this pr adds application/x-sharedlib and application/x-executable mime types to mimetypemapping.dist.json file.

Related Issue

  • Fixes <issue_link>

Motivation and Context

Add missing mime types mapping to the mimetypemapping.dist.json file. The missing mime types detected are application/x-sharedlib and application/x-executable.

How Has This Been Tested?

  • Enable firewall app.
  • Navigate to Admin -> Settings -> security page. Add a group with name sharedlib block
  • Select File mimetype upload from the drop down list and from the select drop down select is. Add application/x-sharedlib to the text field.
  • Select Blocked Requests onlyfrom the drop down next toSave Rulesbutton. Click the buttonSave Rules`.
  • Now upload a file libau.so.
  • In the log file user should see :
{"reqId":"pSacFi2oCtqQNupse4gN","level":2,"time":"2018-11-20T12:12:32+00:00","remoteAddr":"::1","user":"admin","app":"firewall","method":"PUT","url":"\/testing3\/remote.php\/dav\/files\/admin\/libau.so","message":"Firewall blocked request due to a matching rule \"sharedlib block\""}

Screenshots (if appropriate):

  • .so file
    sharedlib
  • .dll file
    dll

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

Open tasks:

  • Backport (if applicable set "backport-request" label and remove when the backport was done)

@sharidas sharidas added this to the development milestone Nov 20, 2018
@sharidas sharidas self-assigned this Nov 20, 2018
@sharidas
Copy link
Contributor Author

  • Should we address files without extension? ( context : https://github.com/owncloud/enterprise/issues/2955#issuecomment-440199384 )
    • The files without extension, like executables, which can have application/x-sharedlib mime type.
    • The files without extension may also have application/x-executable mime type.
      Eg: printf '\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\2\0' > /tmp/file
      The file /tmp/file will have mime type application/x-executable.

Add  mime types for application/x-sharedlib
and application/x-executable

Signed-off-by: Sujith H <sharidasan@owncloud.com>
@codecov
Copy link

codecov bot commented Dec 14, 2018

Codecov Report

Merging #33595 into master will decrease coverage by 0.54%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #33595      +/-   ##
============================================
- Coverage     64.76%   64.22%   -0.55%     
+ Complexity    18330    18269      -61     
============================================
  Files          1198     1193       -5     
  Lines         69382    69076     -306     
  Branches       1276     1277       +1     
============================================
- Hits          44938    44363     -575     
- Misses        24072    24341     +269     
  Partials        372      372
Flag Coverage Δ Complexity Δ
#javascript 52.91% <ø> (-0.07%) 0 <ø> (ø)
#phpunit 65.53% <ø> (-0.6%) 18269 <ø> (-61)
Impacted Files Coverage Δ Complexity Δ
apps/files/lib/ActivityHelper.php 0% <0%> (-100%) 8% <0%> (ø)
apps/files_external/lib/Command/Config.php 0% <0%> (-80%) 0% <0%> (ø)
apps/comments/lib/Activity/Listener.php 25.58% <0%> (-69.77%) 11% <0%> (ø)
apps/systemtags/lib/Activity/Listener.php 0% <0%> (-62.89%) 29% <0%> (-3%)
lib/public/SystemTag/MapperEvent.php 38.46% <0%> (-61.54%) 5% <0%> (ø)
lib/private/Share/Share.php 13.26% <0%> (-30.11%) 70% <0%> (ø)
lib/private/Repair/Apps.php 7.28% <0%> (-19.35%) 44% <0%> (-4%)
apps/systemtags/lib/Activity/Extension.php 0% <0%> (-15%) 46% <0%> (-1%)
lib/public/Share.php 28.57% <0%> (-14.29%) 7% <0%> (ø)
lib/private/Migration/ConsoleOutput.php 55% <0%> (-10%) 9% <0%> (ø)
... and 41 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1be81f0...3083f9a. Read the comment docs.

@codecov
Copy link

codecov bot commented Dec 14, 2018

Codecov Report

Merging #33595 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #33595   +/-   ##
=========================================
  Coverage     64.76%   64.76%           
  Complexity    18330    18330           
=========================================
  Files          1198     1198           
  Lines         69382    69382           
  Branches       1276     1276           
=========================================
  Hits          44938    44938           
  Misses        24072    24072           
  Partials        372      372
Flag Coverage Δ Complexity Δ
#javascript 52.98% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 66.13% <ø> (ø) 18330 <ø> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1be81f0...3083f9a. Read the comment docs.

@sharidas sharidas changed the title [WIP] Add mime types for sharedlib and executable Add mime types for sharedlib and executable Dec 14, 2018
@sharidas
Copy link
Contributor Author

As per the discussion at #33595 (comment), I have added

  • dll support.

Copy link
Contributor

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@PVince81 PVince81 merged commit 25d1521 into master Dec 14, 2018
@delete-merged-branch delete-merged-branch bot deleted the add-new-mimetypes branch December 14, 2018 12:55
@PVince81
Copy link
Contributor

@sharidas please backport

@sharidas
Copy link
Contributor Author

Backport to stable10 PR #33893

@davitol davitol mentioned this pull request Jan 3, 2019
39 tasks
@lock lock bot locked as resolved and limited conversation to collaborators Dec 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants