Bug 49953 - Make exam folder for students immutable
Make exam folder for students immutable
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: UMC - Exam mode
UCS@school 4.4
Other Linux
: P5 normal (vote)
: UCS@school 4.4 v3-errata
Assigned To: Ole Schwiegert
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-08-02 08:37 CEST by Ole Schwiegert
Modified: 2019-11-14 17:57 CET (History)
1 user (show)

See Also:
What kind of report is it?: Feature Request
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ole Schwiegert univentionstaff 2019-08-02 08:37:08 CEST
As a teacher I want the class work folder not to be moved or renamed by pupils so that the class work mode can correctly collect the folders.

Further requirements:
- The subfolders must be editable.

Acceptance criteria:
1 Assuming that I am writing a class test as a student, it should not be possible for me to rename or move the class test folder.
Comment 1 Ole Schwiegert univentionstaff 2019-08-02 08:52:26 CEST
Implemented in oschwieg/4.4/49953

The proposed behavior is now:

Upon starting an exam the i-bit (immutable file attribute) is set on the $EXAM_USER_HOME/Klassenarbeiten folder. This makes the folder immutable for all users (including root). It cannot be removed or renamed. Also its direct children cannot be changed (since it would mutate the folder itself) which means the actual exam folder cannot be mutated and no additional files/folders can be placed inside of it.

When finishing an exam the immutable bit is removed from the folder after collecting the results to not interfere with other functionalities like removing/archiving the exam users home etc.

Please evaluate if the proposed solution is sufficient and in case reopen for merge and build.
Comment 2 Ole Schwiegert univentionstaff 2019-08-05 08:40:27 CEST
Unsetting the bit now on exam creation to allow subsequent exams with the same users at the same time to create exam folder
Comment 3 Daniel Tröder univentionstaff 2019-08-09 10:11:45 CEST
reopen:
* Please move datadir_*_immutable() method(s) to u.m.c.m.distribution.util.Project.
* Proposing different API: add public methods datadir_set_immutable() and datadir_unset_immutable() that call private _set_datadir_immutable(flag).
* Please use chflags(stat.UF_IMMUTABLE) instead of subprocess(chattr).

OK: Jankins didn't complain today
OK: my manual tests: single and two concurrent exams can be created, files are editable, directory and parent dir cannot be removed or renamed, inside exam-dir files can be created, edited, deleted
Comment 4 Ole Schwiegert univentionstaff 2019-08-09 10:33:41 CEST
As discussed the function stays in its current location. A consolidation of all exam specific changes to projects in its own class would be desired and will be discussed in the team. The function was renamed to better describe its dual purpose

Package: ucs-school-umc-exam
Version: 9.0.1-14A~4.4.0.201908091031
Branch: ucs_4.4-0
Scope: ucs-school-4.4
Comment 5 Daniel Tröder univentionstaff 2019-08-09 10:48:15 CEST
OK: code change
OK: tests
OK: advisory
Comment 6 Sönke Schwardt-Krummrich univentionstaff 2019-11-14 17:57:07 CET
UCS@school 4.4 v4 has been released.

https://docs.software-univention.de/changelog-ucsschool-4.4v4-de.html

If this error occurs again, please clone this bug.