aboutsummaryrefslogtreecommitdiff
path: root/read.go
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-03-09 19:00:45 +0100
committerAlex Auvolat <alex@adnab.me>2021-03-09 19:00:45 +0100
commit99d8955ab3b5e24552d1f2b621744d07013f58ac (patch)
tree5820b5b594aeea4d4bb366055efef62046221119 /read.go
parent1a20a64eff34336789c0e3b41db1de727e3fe998 (diff)
downloadbottin-99d8955ab3b5e24552d1f2b621744d07013f58ac.tar.gz
bottin-99d8955ab3b5e24552d1f2b621744d07013f58ac.zip
Refactor & add case normalization logic to putAttributes
Diffstat (limited to 'read.go')
-rw-r--r--read.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/read.go b/read.go
index b36b966..7887c93 100644
--- a/read.go
+++ b/read.go
@@ -17,11 +17,14 @@ func (server *Server) getAttribute(dn string, attr string) ([]string, error) {
return nil, err
}
+ // List all attributes of the object, this is needed because the attribute we are
+ // looking for can exist with different cases than the one specified here
pairs, _, err := server.kv.List(path+"/attribute=", &server.readOpts)
if err != nil {
return nil, err
}
+ // Collect values for the attribute, case-insensitively
values := []string{}
for _, pair := range pairs {
if strings.EqualFold(pair.Key, path+"/attribute="+attr) {