diff options
author | Alex Auvolat <alex@adnab.me> | 2020-01-26 21:03:18 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-01-26 21:03:18 +0100 |
commit | 8e4537d2ef7cad3428d1ca668568d928f2a472d3 (patch) | |
tree | 3618552d5ac9658bebc9f6d34cf8d0114dfc423c /main.go | |
parent | 0bd2aeef061618d933477c71b69d209d6599bda2 (diff) | |
download | bottin-8e4537d2ef7cad3428d1ca668568d928f2a472d3.tar.gz bottin-8e4537d2ef7cad3428d1ca668568d928f2a472d3.zip |
Fixes
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -1,6 +1,7 @@ package main -// @FIXME: Panics if invalid keys are in consul (consulToDN in util.go) +// @FIXME: Auto populate entryuuid creatorsname createtimestamp modifiersname modifytimestamp (uuid: github.com/google/uuid, timestamps: 20060102150405Z) +// @FIXME: Use memberof and not memberOf // @FIXME: Implement missing search filters (in applyFilter) // @FIXME: Add an initial prefix to the consul key value @@ -112,6 +113,8 @@ func readConfig() Config { } func main() { + flag.Parse() + ldap.Logger = log.New(os.Stdout, "[ldapserver] ", log.LstdFlags) config := readConfig() @@ -739,7 +742,10 @@ func (server *Server) handleDeleteInternal(state *State, r *message.DelRequest) return ldap.LDAPResultNoSuchObject, fmt.Errorf("Not found: %s", dn) } for _, item := range items { - itemDN, _ := consulToDN(item.Key) + itemDN, _, err := consulToDN(item.Key) + if err != nil { + continue + } if itemDN != dn { return ldap.LDAPResultNotAllowedOnNonLeaf, fmt.Errorf( "Cannot delete %d as it has children", dn) @@ -833,7 +839,10 @@ func (server *Server) handleModifyInternal(state *State, r *message.ModifyReques prevEntry := Entry{} for _, item := range items { - itemDN, attr := consulToDN(item.Key) + itemDN, attr, err := consulToDN(item.Key) + if err != nil { + continue + } if itemDN != dn { panic("itemDN != dn in handleModifyInternal") } |