Skip to content

Commit 9f7b920

Browse files
committed
v2.10.9.
1 parent a5d3604 commit 9f7b920

File tree

17 files changed

+745
-289
lines changed

17 files changed

+745
-289
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ For more usage information & examples check the [Wiki](https://github.com/Macmod
183183
| <kbd>Ctrl</kbd> + <kbd>r</kbd> | Global | Reconnect to the server |
184184
| <kbd>Ctrl</kbd> + <kbd>u</kbd> | Global | Upgrade connection to use TLS (with StartTLS) |
185185
| <kbd>Ctrl</kbd> + <kbd>f</kbd> | Explorer & Search pages | Open the finder to search for cached objects & attributes with regex |
186+
| <kbd>Ctrl</kbd> + <kbd>b</kbd> | Explorer page | Open the explorer settings (Base DN & expand filter) |
187+
| <kbd>Ctrl</kbd> + <kbd>b</kbd> | Object Search page | Open the search settings (Base DN & scope) |
186188
| Right Arrow | Explorer panel | Expand the children of the selected object |
187189
| Left Arrow | Explorer panel | Collapse the children of the selected object |
188190
| <kbd>r</kbd> | Explorer panel | Reload the attributes and children of the selected object |

pkg/ldaputils/actions.go

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ const (
3333
type LDAPConn struct {
3434
Conn *ldap.Conn
3535
PagingSize uint32
36-
RootDN string
3736
DefaultRootDN string
3837
Flavor LDAPFlavor
3938
}
@@ -102,7 +101,6 @@ func NewLDAPConn(ldapServer string, ldapPort int, ldaps bool, tlsConfig *tls.Con
102101
return &LDAPConn{
103102
Conn: conn,
104103
PagingSize: pagingSize,
105-
RootDN: rootDN,
106104
DefaultRootDN: rootDN,
107105
}, nil
108106
}
@@ -539,11 +537,6 @@ func (lc *LDAPConn) QueryFirst(filter string) (*ldap.Entry, error) {
539537
// User Passwords
540538
// Reference: https://gist.github.com/Project0/61c13130563cf7f595e031d54fe55aab
541539
const (
542-
ldapAttrAccountName = "sAMAccountName"
543-
ldapAttrDN = "dn"
544-
ldapAttrUAC = "userAccountControl"
545-
ldapAttrUPN = "userPrincipalName" // username@logon.domain
546-
ldapAttrEmail = "mail"
547540
ldapAttrUnicodePw = "unicodePwd"
548541
controlTypeLdapServerPolicyHints = "1.2.840.113556.1.4.2239"
549542
controlTypeLdapServerPolicyHintsDeprecated = "1.2.840.113556.1.4.2066"
@@ -770,7 +763,7 @@ func (lc *LDAPConn) AddADIDNSZone(objectName string, props []adidns.DNSProperty,
770763
zoneContainer = "ForestDnsZones"
771764
}
772765

773-
zoneDN := fmt.Sprintf("DC=%s,CN=MicrosoftDNS,DC=%s,%s", objectName, zoneContainer, lc.RootDN)
766+
zoneDN := fmt.Sprintf("DC=%s,CN=MicrosoftDNS,DC=%s,%s", objectName, zoneContainer, lc.DefaultRootDN)
774767

775768
addRequest := ldap.NewAddRequest(zoneDN, nil)
776769
addRequest.Attribute("objectClass", []string{"top", "dnsZone"})
@@ -1046,7 +1039,7 @@ func (lc *LDAPConn) GetSecurityDescriptor(object string) (queryResult string, er
10461039
switch {
10471040
case isSamAccountName:
10481041
searchReq = ldap.NewSearchRequest(
1049-
lc.RootDN,
1042+
lc.DefaultRootDN,
10501043
ldap.ScopeWholeSubtree,
10511044
ldap.NeverDerefAliases, 0, 0, false,
10521045
samOrDn,
@@ -1209,14 +1202,14 @@ func (lc *LDAPConn) FindSamForSID(SID string) (resolvedSID string, err error) {
12091202
}
12101203

12111204
func (lc *LDAPConn) FindPrimaryGroupForSID(SID string) (groupSID string, err error) {
1212-
domainSID, err := lc.FindSIDForObject(lc.RootDN)
1205+
domainSID, err := lc.FindSIDForObject(lc.DefaultRootDN)
12131206
if err != nil {
12141207
return "", err
12151208
}
12161209

12171210
query := fmt.Sprintf("(objectSID=%s)", SID)
12181211
searchReq := ldap.NewSearchRequest(
1219-
lc.RootDN,
1212+
lc.DefaultRootDN,
12201213
ldap.ScopeWholeSubtree, 0, 0, 0, false,
12211214
query,
12221215
[]string{"primaryGroupID"},

0 commit comments

Comments
 (0)