Bug 46709 - (4.2) Files uploaded by IE11 are not distributed to teacher/students
Summary: (4.2) Files uploaded by IE11 are not distributed to teacher/students
Status: CLOSED FIXED
Alias: None
Product: UCS@school
Classification: Unclassified
Component: UMC - Exam mode
Version: UCS@school 4.2
Hardware: Other Linux
: P5 normal
Target Milestone: UCS@school 4.2 v8
Assignee: Sönke Schwardt-Krummrich
QA Contact: Jürn Brodersen
URL:
Keywords:
Depends on:
Blocks: 46710 46730
  Show dependency treegraph
 
Reported: 2018-03-21 10:07 CET by Sönke Schwardt-Krummrich
Modified: 2018-04-06 22:09 CEST (History)
0 users

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 3: Will affect average number of installed domains
How will those affected feel about the bug?: 3: A User would likely not purchase the product
User Pain: 0.257
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Customer ID: 00009
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sönke Schwardt-Krummrich univentionstaff 2018-03-21 10:07:43 CET
A customer reported that files uploaded by IE11 are not distributed to teacher/students. The management-console-module-schoolexam.log show the following lines:

16.03.18 15:54:43.211  MODULE      ( INFO    ) : Detected filename '\\\\dcgsmitte\\netlogon\\univention-netlogon-logon.cmd' as '\\\\dcgsmitte\\netlogon\\univention-netlogon-logon.cmd'
16.03.18 15:54:43.211  MODULE      ( INFO    ) : Received file '/var/tmp/univention-management-console-frontend/152121208311437-709BXj7sn', saving it to '/tmp/ucsschool-exam-upload-NSfB4U/\\\\dcgsmitte\\netlogon\\un
ivention-netlogon-logon.cmd'

A test showed that IE11 sends the windows path as "filename" during upload.
Another short test resulted in the following log entry:

20.03.18 13:03:48.757  MODULE      ( INFO    ) : Detected filename 'C:\\Windows\\Installer\\{2690E265-61BB-4655-89E6-A26A54CBCBD5}\\foobar.exe' as .........

Chrome and Firefox send only the filename (here "univention-netlogon-logon.cmd" resp. "foobar.exe").

This also affects the UMC distribution module.
Comment 1 Sönke Schwardt-Krummrich univentionstaff 2018-03-22 12:58:02 CET
It turned out that the Internet Explorer transfers a UNC path or a Windows
path to the UMC when uploading the files in the MIME header. The UMC and
the UMC modules (distribution and exam) handle this correctly at first and
create a temporary file which, for example
/tmp/ucsschool-distribution-upload-1O4qSl/ with a file name as specified in
the MIME header
(→ /tmp/ucsschool-distribution-upload-1O4qSl/\\\\dcgsmitte\netlogon\foobar.txt
or /tmp/ucsschool-distribution-upload-1O4qSl/C:\mydir\foobar.txt).

The file has now arrived correctly on the school server and is saved with
the UNC path as file name. What is now causing problems is the fact that
Internet Explorer then tells the UMC module that it has uploaded the file
"foobar.txt" (not as UNC path) when creating a distribution project/class
work. This means that the file referenced in the request is not found again
and therefore is not distributed to the users.
Firefox and Chrome correctly send only the file name in the MIME header.

The upload function of both modules has now been adapted to use the
characters after the last backslash as file name, provided that at least
one backslash is included.
Fallback: if there is no character after the last backslash, the backslashes
in the file name of the MIME header are replaced with underscores and
leading/trailing underscores are removed.

In my tests, files could now be successfully uploaded with Chrome and IE11
to the two UMC modules.

Two simple test scripts have been added to ucs-test-ucsschool to check if
the files uploaded with/without UNC path are correctly *only* stored with
file names in the temporary directory:
18_distribute_filename_problems
101_exam_mode_filename_problems

PLEASE NOTE: that all commits have been done with bug number 46710!

Package: ucs-test-ucsschool
Version: 4.0.4-71A~4.2.0.201803221256

Package: ucs-school-umc-exam
Version: 7.0.4-20A~4.2.0.201803221254

Package: ucs-school-umc-distribution
Version: 15.0.1-6A~4.2.0.201803221254

1b0fc078 Bug #46710: add changelog entry
abed9a08 Bug #46710, #46709, #46719, #46720: Merge branch 'sschwardt/46710/42/file_upload' into 4.2
c3e2d9e7 Bug #46710: add advisories
15537293 Bug #46710: add changelog entries
d4d04d61 Bug #46710: add ucs-test to check if prolematic MIME filenames are fixed correctly
7794816f Bug #46710: strip filename if it contains backslashes
Comment 2 Jürn Brodersen univentionstaff 2018-03-22 15:17:07 CET
Note:
IE only sends the full path if the page is considered to be in the intranet zone. (Apparently for better compatibility with sites from the early nineties...)

That's why I weren't able to reproduce this before.
Comment 3 Jürn Brodersen univentionstaff 2018-03-23 08:34:02 CET
Files with backslashes uploaded through linux now don't work.
But the distribution of such files probably didn't work anyways?

Feel free to move that into a separate bug
Comment 4 Sönke Schwardt-Krummrich univentionstaff 2018-03-23 10:30:13 CET
(In reply to Jürn Brodersen from comment #2)
> IE only sends the full path if the page is considered to be in the intranet
> zone. (Apparently for better compatibility with sites from the early
> nineties...)

Good catch.

(In reply to Jürn Brodersen from comment #3)
> Files with backslashes uploaded through linux now don't work.
> But the distribution of such files probably didn't work anyways?
> 
> Feel free to move that into a separate bugBug 46730
Comment 5 Jürn Brodersen univentionstaff 2018-03-23 10:59:00 CET
Ok
What I tested:
File upload through Chrome -> OK
File upload through IE -> OK
File upload through IE with site in intranet zone (the broken part) -> OK
File distribution -> OK
Tests -> OK
YAML -> OK

-> Verified
Comment 6 Sönke Schwardt-Krummrich univentionstaff 2018-04-06 22:09:05 CEST
UCS@school 4.2 v8 has been released.

https://docs.software-univention.de/changelog-ucsschool-4.2v8-de.html

If this error occurs again, please clone this bug.