Bug 54039 - Prevent duplicate share definitions (samba and nfs)
Prevent duplicate share definitions (samba and nfs)
Status: NEW
Product: UCS
Classification: Unclassified
Component: UMC - Shares
UCS 5.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: UMC maintainers
UMC maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2021-11-09 12:11 CET by Jürn Brodersen
Modified: 2021-11-09 16:14 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 Jürn Brodersen univentionstaff 2021-11-09 12:11:09 CET
Prevent duplicate share definitions (samba and nfs)

Shares with the same configuration create problems for samba and nfs. I think we should check if a duplicate share already exists and throw an error to prevent broken samba and/or nfs configurations

Problems for samba:
The share configuration in /etc/samba/shares.conf.d/ will be overwritten with the new share.

Problems for nfs:
The nfs server doesn't start and throws an error "exportfs: duplicated export entries".

Duplicate key for samba:
univentionShareHost + univentionShareSambaName

Duplicate key for nfs:
univentionShareHost + univentionSharePath + univentionShareNFSAllowed
This needs to be checked for each "univentionShareNFSAllowed" entry separately.


This broke the test "90_ucsschool/22_computerroom_module_settings.py", because an earlier test overwrote the "Marktplatz" share.
Comment 1 Florian Best univentionstaff 2021-11-09 14:22:00 CET
I think we already have basic logic which prevents to create a share underneath of pathes which are already a share.
Comment 2 Jürn Brodersen univentionstaff 2021-11-09 14:51:05 CET
(In reply to Florian Best from comment #1)
> I think we already have basic logic which prevents to create a share
> underneath of pathes which are already a share.

I got no error creating two shares with the same path or a subpath.

Tested on UCS5 with UCS@school. I created the shares using the umc shares module.
Comment 3 Florian Best univentionstaff 2021-11-09 14:54:20 CET
OK, then I confused it with a bug which is not implemented yet. Duplicate of Bug #44495 ?
Comment 4 Jürn Brodersen univentionstaff 2021-11-09 16:14:17 CET
(In reply to Florian Best from comment #3)
> OK, then I confused it with a bug which is not implemented yet. Duplicate of
> Bug #44495 ?

Thanks! I hadn't searched for "nested".
I think we should keep the bugs separate for now.
As far as I understand it, bug #44495 is about how ACL are handled for shares on the same path as another share. The solution to that might need some more discussion (should we only warn about it? add some ACL inheritance mechanism? etc).

Though I can imagine the solution for bug #44495 including a fix for this as well and this bug becoming a duplicate.