Skip to content

Commit

Permalink
Minor bugfixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Macmod committed Nov 28, 2024
1 parent fd9fdd3 commit 8027ca8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions pkg/ldaputils/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,13 @@ func (lc *LDAPConn) FindNamingContexts() ([]string, error) {
return nil, fmt.Errorf("No entries found")
}

if len(searchResult.Entries[0].Attributes) < 1 {
return nil, fmt.Errorf("Naming contexts not found")
for _, x := range searchResult.Entries[0].Attributes {
if strings.ToLower(x.Name) == "namingcontexts" {
return x.Values, nil
}
}

return searchResult.Entries[0].Attributes[0].Values, nil
return []string{}, fmt.Errorf("Naming contexts not found")
}

func (lc *LDAPConn) FindRootDN() (string, error) {
Expand Down
2 changes: 1 addition & 1 deletion tui/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ func reloadAttributesPanel(node *tview.TreeNode, attrsTable *tview.Table, useCac

if Colors {
var refValue string
if !ExpandAttrs || len(cellValues) == 1 {
if !FormatAttrs && (!ExpandAttrs || len(cellValues) == 1) {
refValue = attribute.Values[idx]
} else {
refValue = cellValue
Expand Down

0 comments on commit 8027ca8

Please sign in to comment.