|
Lines 43-49
description = 'Write SAML enabled groups to json file, to be read by the service
Link Here
|
| 43 |
filter = '(objectClass=univentionSAMLEnabledGroup)' |
43 |
filter = '(objectClass=univentionSAMLEnabledGroup)' |
| 44 |
attributes = ['enabledServiceProviderIdentifierGroup'] |
44 |
attributes = ['enabledServiceProviderIdentifierGroup'] |
| 45 |
path = '/etc/simplesamlphp/serviceprovider_enabled_groups.json' |
45 |
path = '/etc/simplesamlphp/serviceprovider_enabled_groups.json' |
| 46 |
tmp_path = '/tmp/serviceprovider_enabled_groups.json' |
46 |
tmp_path = '/etc/simplesamlphp/serviceprovider_enabled_groups.json.new' |
| 47 |
uid = pwd.getpwnam("samlcgi").pw_uid |
47 |
uid = pwd.getpwnam("samlcgi").pw_uid |
| 48 |
gid = grp.getgrnam("samlcgi").gr_gid |
48 |
gid = grp.getgrnam("samlcgi").gr_gid |
| 49 |
|
49 |
|
|
Lines 86-92
def handler(dn, new, old):
Link Here
|
| 86 |
|
86 |
|
| 87 |
with open(tmp_path, 'w+') as outfile: |
87 |
with open(tmp_path, 'w+') as outfile: |
| 88 |
json.dump(data, outfile) |
88 |
json.dump(data, outfile) |
| 89 |
os.chmod(tmp_path, 0600) |
89 |
os.chmod(tmp_path, 0o600) |
| 90 |
os.chown(tmp_path, uid, gid) |
90 |
os.chown(tmp_path, uid, gid) |
| 91 |
shutil.move(tmp_path, path) |
91 |
shutil.move(tmp_path, path) |
| 92 |
finally: |
92 |
finally: |