diff options
author | Alex Auvolat <alex@adnab.me> | 2020-02-13 14:41:33 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-02-13 14:41:49 +0100 |
commit | 13d8cf028a7841df54da31650918fe0f142df2d8 (patch) | |
tree | 0802d05040ccc19ec5c393222275748e56b655fa /main.go | |
parent | 49be2069f63d8f2909840ad504063c773d0ba7ed (diff) | |
download | bottin-13d8cf028a7841df54da31650918fe0f142df2d8.tar.gz bottin-13d8cf028a7841df54da31650918fe0f142df2d8.zip |
Add a function to resync member/memberOf values over the database
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -65,6 +65,7 @@ type State struct { type Entry map[string][]string var configFlag = flag.String("config", "./config.json", "Configuration file path") +var resyncFlag = flag.Bool("resync", false, "Check and re-synchronize memberOf values before launch") func readConfig(logger *log.Logger) Config { config_file := ConfigFile{ @@ -171,6 +172,13 @@ func main() { logger.Fatal(err) } + if *resyncFlag { + err = bottin.memberOfResync() + if err != nil { + logger.Fatal(err) + } + } + // Create routes routes := ldap.NewRouteMux() @@ -267,7 +275,7 @@ func (server *Server) init() error { base_attributes := Entry{ "objectClass": []string{"top", "dcObject", "organization"}, - "structuralObjectClass": []string{"Organization"}, + "structuralObjectClass": []string{"organization"}, ATTR_CREATORSNAME: []string{server.config.Suffix}, ATTR_CREATETIMESTAMP: []string{genTimestamp()}, ATTR_ENTRYUUID: []string{genUuid()}, |