diff options
author | Alex Auvolat <alex@adnab.me> | 2020-02-02 13:51:47 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-02-02 13:53:29 +0100 |
commit | 0c801e02d5b9804c5444d4e923babc34ee05b61c (patch) | |
tree | cb1bcfe3b792614dd9b28ed0c30ae3de1b1d5f72 /main.go | |
parent | 4c037dcb94d2c663da9e624ba44dac0f833bc804 (diff) | |
download | bottin-0c801e02d5b9804c5444d4e923babc34ee05b61c.tar.gz bottin-0c801e02d5b9804c5444d4e923babc34ee05b61c.zip |
Remove spaces between dn components, use warnings when necessary
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -377,7 +377,14 @@ func (server *Server) objectExists(dn string) (bool, error) { return len(data) > 0, nil } -func (server *Server) checkSuffix(dn string, allow_extend bool) (string, error) { +func (server *Server) checkDN(dn string, allow_extend bool) (string, error) { + // 1. Canonicalize: remove spaces between things + dn, err := canonicalDN(dn) + if err != nil { + return "", err + } + + // 2. Check suffix (add it if allow_extend is set) suffix := server.config.Suffix if len(dn) < len(suffix) { if dn != suffix[len(suffix)-len(dn):] || !allow_extend { |