Bug 38835 - Disable user even if the license count is exceeded
Disable user even if the license count is exceeded
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UDM (Generic)
UCS 4.0
Other Linux
: P5 normal (vote)
: UCS 4.0-2-errata
Assigned To: Alexander Kramer
Arvid Requate
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-07-06 09:22 CEST by Stefan Gohmann
Modified: 2015-08-06 17:51 CEST (History)
4 users (show)

See Also:
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):
Max CVSS v3 score:


Attachments
Patch: Disable user even if the license count is exceeded (843 bytes, patch)
2015-07-24 08:01 CEST, Alexander Kramer
Details | Diff
Patch: Disable user even if the license count is exceeded (878 bytes, patch)
2015-07-24 09:41 CEST, Alexander Kramer
Details | Diff
user_users_modify_returncode.patch (792 bytes, patch)
2015-08-04 14:28 CEST, Arvid Requate
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Gohmann univentionstaff 2015-07-06 09:22:58 CEST
It should be possible to disable a user if the license count is exceeded.
Comment 1 Alexander Kramer univentionstaff 2015-07-24 08:01:25 CEST
Created attachment 7047 [details]
Patch: Disable user even if the license count is exceeded

As requested with this patch it is possible to disable user accounts even if the license is exceeded.

FYI:
It is only possible to deactivate all accounts and activation is forbidden.

It is still possible to change other user values with the deactivation request. E.g. you can change the user name etc. at the same time as you will deactivate this user. 
IMHO this doesn't matter because you cannot activate this user unless the license isn't exceeded any more.
Comment 2 Alexander Kramer univentionstaff 2015-07-24 09:41:31 CEST
Created attachment 7048 [details]
Patch: Disable user even if the license count is exceeded

As discussed with Sönke I fixed the problem that a deactivated user could be changed arbitrarily.

Besides checking if all accounts are deactivated I also check if the status of disbaled has been change.
Comment 3 Alexander Kramer univentionstaff 2015-07-24 13:52:38 CEST
r62397
univention-directory-manager-modules (10.0.31-7) 
* Bug #38835: Disable user even if the license count is exceeded

Successful build
Package: univention-directory-manager-modules
Version: 10.0.31-7.1329.201507241347
Branch: ucs_4.0-0
Scope: errata4.0-2

r62398
ymal file
Comment 4 Alexander Kramer univentionstaff 2015-07-24 14:13:09 CEST
Merging changes to 4.1-0

r62399
univention-directory-manager-modules (11.0.0-1) 
* Bug #38835: Version bump for 4.1-0 and merging from 4.0-2

Successful build
Package: univention-directory-manager-modules
Version: 11.0.0-1.1330.201507241410
Branch: ucs_4.1-0
Scope:
Comment 5 Alexander Kläser univentionstaff 2015-07-31 15:28:17 CEST
Changes: OK, works as expected
YAML: OK
4.1-0 merge: FAIL, the changelog number has not been increased correctly.
Comment 6 Arvid Requate univentionstaff 2015-08-04 14:18:34 CEST
This adjustment breaks univention-s4-connector in case of trivial (no-op) modifies. In this case univention.s4connector.ucs.modify_in_ucs now returns "None" instead on "True". This leads to all users showing up as rejected on sync from S4 to UCS. I experienced this in an AD Takeover scenario.
Comment 7 Arvid Requate univentionstaff 2015-08-04 14:28:13 CEST
Created attachment 7081 [details]
user_users_modify_returncode.patch

I guess this will fix that regression.
Comment 8 Alexander Kramer univentionstaff 2015-08-04 15:02:49 CEST
(In reply to Arvid Requate from comment #7)
> Created attachment 7081 [details]
> user_users_modify_returncode.patch
> 
> I guess this will fix that regression.

As requested I adpated the code

ucs4.0-2
r62621 applied patch
r62622 debian/changelog

Successful build
Package: univention-directory-manager-modules
Version: 10.0.31-10.1333.201508041458
Branch: ucs_4.0-0
Scope: errata4.0-2
Comment 9 Alexander Kramer univentionstaff 2015-08-04 15:14:36 CEST
r62627 yaml for 4.0-2

ucs4.1-0
r62626 patch and changelog

Successful build
Package: univention-directory-manager-modules
Version: 11.0.0-3.1334.201508041510
Branch: ucs_4.1-0
Comment 10 Arvid Requate univentionstaff 2015-08-04 16:46:14 CEST
Fix, advisory and merge ok.
Comment 11 Janek Walkenhorst univentionstaff 2015-08-06 17:51:58 CEST
<http://errata.univention.de/ucs/4.0/278.html>