aboutsummaryrefslogtreecommitdiff
path: root/memberof.go
diff options
context:
space:
mode:
Diffstat (limited to 'memberof.go')
-rw-r--r--memberof.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/memberof.go b/memberof.go
index cd0686a..e07ed6c 100644
--- a/memberof.go
+++ b/memberof.go
@@ -13,8 +13,8 @@ func (server *Server) memberOfAdd(member string, group string) {
}
// Return early if group is already in memberOf
- for _, mb := range memberGroups {
- if mb == group {
+ for _, g := range memberGroups {
+ if g == group {
server.logger.Warnf("Inconsistency detected, %s was memberOf %s at a time when it didn't exist! (not an issue anymore)",
member, group)
return
@@ -23,7 +23,7 @@ func (server *Server) memberOfAdd(member string, group string) {
// Add group to memberOf
memberGroups = append(memberGroups, group)
- err = server.addElements(member, Entry{
+ err = server.putAttributes(member, Entry{
ATTR_MEMBEROF: memberGroups,
})
if err != nil {
@@ -41,9 +41,9 @@ func (server *Server) memberOfRemove(member string, group string) {
// Filter out group
newMemberOf := []string{}
- for _, mb := range memberOf {
- if mb != group {
- newMemberOf = append(newMemberOf, mb)
+ for _, g := range memberOf {
+ if g != group {
+ newMemberOf = append(newMemberOf, g)
}
}
@@ -55,7 +55,7 @@ func (server *Server) memberOfRemove(member string, group string) {
}
// Update value of memberOf
- err = server.addElements(member, Entry{
+ err = server.putAttributes(member, Entry{
ATTR_MEMBEROF: newMemberOf,
})
if err != nil {
@@ -105,7 +105,7 @@ func (server *Server) memberOfResync() error {
}
if len(keepMember) != len(member) {
server.logger.Warnf("Writing new member list for %s", dn)
- err = server.addElements(dn, Entry{
+ err = server.putAttributes(dn, Entry{
ATTR_MEMBER: keepMember,
})
if err != nil {
@@ -134,7 +134,7 @@ func (server *Server) memberOfResync() error {
if different {
server.logger.Warnf("Fixing memberOf for %s (%d -> %d)",
dn, len(prevMemberOf), len(newMemberOfV))
- err = server.addElements(dn, Entry{
+ err = server.putAttributes(dn, Entry{
ATTR_MEMBEROF: newMemberOfV,
})
if err != nil {