Univention Bugzilla – Attachment 10994 Details for
Bug 42080
users/user open() unexpectedly modifies users
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
test script / reproducer
test_42080.py (text/x-python), 1.09 KB, created by
Florian Best
on 2022-10-10 15:27:55 CEST
(
hide
)
Description:
test script / reproducer
Filename:
MIME Type:
Creator:
Florian Best
Created:
2022-10-10 15:27:55 CEST
Size:
1.09 KB
patch
obsolete
># pytest-3 -s -l -vv --tb=native test_42080.py >import tempfile >import subprocess > >import pytest > >import univention.admin.modules >import univention.testing.strings as uts > > >def test_bug42080(udm, ucr): > """Create a valid ldap acl object""" > primary_group = udm.create_object('groups/group', name=uts.random_name()) > user, username = udm.create_user(primaryGroup=primary_group) > with tempfile.NamedTemporaryFile('w', prefix='50_test_') as temp: > temp.write(f'\n\naccess to dn.exact="{primary_group}" by dn.exact="{user}" none stop by * +0 break\n\n') > temp.flush() > subprocess.check_call(f'python3 -m univention.lib.ldap_extension ucs_registerLDAPExtension --packagename ucs-test --packageversion 1.0 --acl {temp.name}', shell=True) > > lo = univention.admin.uldap.access(base=ucr['ldap/base'], binddn=user, bindpw='univention') > po = univention.admin.uldap.position(lo.base) > univention.admin.modules.update() > obj = univention.admin.modules.get('users/user').object(None, lo, po, user) > obj.open() > assert obj['primaryGroup'] == '' > with pytest.raises(univention.admin.uexceptions.permissionDenied): > obj.modify()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 42080
: 10994