aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go15
1 files changed, 12 insertions, 3 deletions
diff --git a/main.go b/main.go
index 26d46b3..d55601b 100644
--- a/main.go
+++ b/main.go
@@ -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")
}