diff options
author | Alex Auvolat <alex@adnab.me> | 2020-01-26 23:12:00 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-01-26 23:12:00 +0100 |
commit | 8a605f44b017621eb2bd739d6c7c1de213d7a13f (patch) | |
tree | 5cdfeb584c9deaa57eab54ed153bc62079b7a796 /main.go | |
parent | e9fb34bb26779df5442aff9889de0854bff05902 (diff) | |
download | bottin-8a605f44b017621eb2bd739d6c7c1de213d7a13f.tar.gz bottin-8a605f44b017621eb2bd739d6c7c1de213d7a13f.zip |
Don't do stupid things like use a dn as a pattern
Also add metadata fields in objects created on initialization
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -205,6 +205,9 @@ func (server *Server) init() error { base_attributes := Entry{ "objectClass": []string{"top", "dcObject", "organization"}, "structuralObjectClass": []string{"Organization"}, + ATTR_CREATORSNAME: []string{server.config.Suffix}, + ATTR_CREATETIMESTAMP: []string{genTimestamp()}, + ATTR_ENTRYUUID: []string{genUuid()}, } suffix_dn, err := parseDN(server.config.Suffix) if err != nil { @@ -227,9 +230,11 @@ func (server *Server) init() error { "objectClass": []string{"simpleSecurityObject", "organizationalRole"}, "description": []string{"LDAP administrator"}, "cn": []string{"admin"}, - ATTR_USERPASSWORD: []string{admin_pass_hash}, "structuralObjectClass": []string{"organizationalRole"}, - "permissions": []string{"read", "write"}, + ATTR_USERPASSWORD: []string{admin_pass_hash}, + ATTR_CREATORSNAME: []string{server.config.Suffix}, + ATTR_CREATETIMESTAMP: []string{genTimestamp()}, + ATTR_ENTRYUUID: []string{genUuid()}, } err = server.addElements(admin_dn, admin_attributes) @@ -373,5 +378,3 @@ func (server *Server) handleBindInternal(state *State, r *message.BindRequest) ( } return ldap.LDAPResultInvalidCredentials, nil } - - |