Bug 34241

Summary: Regression: Writing of config files should be an atomic operation
Product: UCS Reporter: Philipp Hahn <hahn>
Component: UCRAssignee: Philipp Hahn <hahn>
Status: CLOSED FIXED QA Contact: Stefan Gohmann <gohmann>
Severity: normal    
Priority: P5 CC: best, damrose, gohmann, jmm, walkenhorst
Version: UCS 3.2Flags: hahn: Patch_Available+
Target Milestone: UCS 3.2-1-errata   
Hardware: All   
OS: Linux   
See Also: https://forge.univention.org/bugzilla/show_bug.cgi?id=34233
What kind of report is it?: --- 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): API change, Troubleshooting
Max CVSS v3 score:
Bug Depends on: 33842    
Bug Blocks:    
Attachments: Fix atomic write to preserve old file permission

Description Philipp Hahn univentionstaff 2014-03-04 12:56:50 CET
Created attachment 5810 [details]
Fix atomic write to preserve old file permission

+++ This bug was initially created as a clone of Bug #33842 +++
Regression UCS-3.2-{0→1}, detected through Bug #34233:
With only "Mode" given but without "User" or "Group" the owner/group are not carried over, if the owner/group is changes through an explicit "chown" on the generated file:

# ./51file_permissions -vvvf
FAIL: /tmp/ucs-test-33842-f0 0660 bin!=root bin!=root
FAIL: /tmp/ucs-test-33842-f4 0400 bin!=root bin!=root
FAIL: /tmp/ucs-test-33842-m0 0664 bin!=root bin!=root
FAIL: /tmp/ucs-test-33842-m4 0400 bin!=root bin!=root
FAIL: /tmp/ucs-test-33842-d0 0660 bin!=root bin!=root
FAIL: /tmp/ucs-test-33842-d4 0400 bin!=root bin!=root
Comment 1 Philipp Hahn univentionstaff 2014-03-10 11:47:54 CET
The file permission and ownership information is now copied implicitly from the previous file, before any explicit modifications are applied afterwards.

ucr: r48422
univention-config-registry_9.0.6-5.453.201403101139
ucs-test_4.0.163-1.677.201403101144
yaml: r48423
Comment 2 Stefan Gohmann univentionstaff 2014-03-12 12:04:34 CET
Code: OK
YAML: OK
Tests: OK
Comment 3 Moritz Muehlenhoff univentionstaff 2014-03-17 13:00:28 CET
http://errata.univention.de/ucs/3.2/70.html