diff options
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") } |