Openldap (LDAP) binding for Golang (go) ; no more support ; you may have a look at https://github.com/go-ldap/ldap

OpenLDAP

this is Openldap binding in GO language. I don't work any more with golang, so, please fork this project.

Installation :

Installation is easy and very quick, as you can see :

# install openldap library and devel packages
sudo apt-get install libldap libldap2-dev  # debian/ubuntu.
sudo urpmi openldap-devel # fedora, RH, ...

# install go
go get github.com/mqu/openldap

# verify you've got it :
(cd $GOPATH ; go list ./...) | grep openldap

Usage

  • Look a this exemple.
  • a more complex example making LDAP search that mimics ldapsearch command, printing out result on console.

Doc:

  • run go doc openldap,
  • will come soon, complete documentation in this Wiki.
  • look at _examples/*.go to see how to use this library.

Todo :

  • thread-safe test,
  • complete LDAP:GetOption() and LDAP:SetOption() method : now, they work only for integer values,
  • avoid using deprecated function (see LDAP_DEPRECATED flag and "// DEPRECATED" comments in *.go sources),
  • write some tests,
  • verify memory leaks (Valgrind),
  • support LDIF format (in, out),
  • add support for external commands (ldapadd, ldapdelete)
  • create an LDAP CLI (command line interface), like lftp, with commands like shell,
  • a nice GUI with GTK,
  • proxy, server,
  • what else ?

Links :

Licence :

Copyright (C) 2012 - Marc Quinton.

Use of this source code is governed by the MIT Licence : http://opensource.org/licenses/mit-license.php

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Owner
Marc Quinton
artisan du logiciel libre.
Marc Quinton
Similar Resources

Inspired by Have I Been Pwnd

Inspired by Have I Been Pwnd

Have I Been Redised Check it out at RedisPwned and Have I Been Redised How it works We scan the internet for exposed Redis databases broadcasting to t

Nov 14, 2021

Ugg boot is a tool for people wanting to have some comfort in their lives.

Ugg Boot Ugg boot is a tool for people wanting to have some comfort in their lives. It provides a simple way to update Go executables and list availab

Aug 28, 2022

Resolved the issue that Windows cannot detect the Internet even if it does have an Internet connection.

win-connect 中文文档 Background This program is built to resolved the issue that Windows cannot detect the Internet even if it does have an Internet conne

Dec 19, 2021

Basic LDAP v3 functionality for the GO programming language.

Basic LDAP v3 functionality for the GO programming language. Install For the latest version use: go get gopkg.in/ldap.v2 Import the latest version wi

May 24, 2022

SFTP backed by LDAP and S3-compatible object stores

RainSFTP RainSFTP is an implementaion of the Secure File Transfer Protocol backed by LDAP for authentication and an S3-compatible object store. This m

Nov 8, 2022

Github-contribution-graph - A tool for dynamically generated contribution graphs that show your GitHub contributions for the last 7 days

GitHub-Contribution-Graph An awesome tool for dynamically generated contribution

Dec 13, 2022

Laptop Booking Application in Golang and gRPC, load-balancing with NGINX, and fully compatible with HTTPS OpenAPI v3

Laptop Booking Application in Golang and gRPC Goals GitHub CI & Coverage Badge Serialize protobuf messages Create laptop unary gRPC Search laptop Serv

Jun 17, 2022

screen sharing for developers https://screego.net/

screen sharing for developers https://screego.net/

screego/server screen sharing for developers Huge thanks to sipgate for sponsoring this project! Intro In the past I've had some problems sharing my s

Jan 1, 2023
Comments
  • Runtime panic with Go 1.7.1 (due to new cgo pointer rules)

    Runtime panic with Go 1.7.1 (due to new cgo pointer rules)

    panic: runtime error: cgo argument has Go pointer to Go pointer

    I would guess this started with go 1.6 but this is the first time I've used this package since 1.4

  • go get github.com/mqu/openldap  in mac os  error

    go get github.com/mqu/openldap in mac os error

    go get github.com/mqu/openldap show error Cannot compile in OS X 10.11

    /Users/wenhuazhang/GoProjects/src/github.com/mqu/openldap/add-modify-delete.go:48:9: warning: 'ldap_add_ext_s' is deprecated: first deprecated in OS X 10.11 - use OpenDirectory Framework [-Wdeprecated-declarations] /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/ldap.h:1160:1: note: 'ldap_add_ext_s' has been explicitly marked deprecated here /Users/wenhuazhang/GoProjects/src/github.com/mqu/openldap/add-modify-delete.go:54:9: warning: 'ldap_modify_ext_s' is deprecated: first deprecated in OS X 10.11 - use OpenDirectory Framework [-Wdeprecated-declarations] /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/ldap.h:1430:1: note: 'ldap_modify_ext_s' has been explicitly marked deprecated here /Users/wenhuazhang/GoProjects/src/github.com/mqu/openldap/add-modify-delete.go:60:9: warning: 'ldap_rename_s' is deprecated: first deprecated in OS X 10.11 - use OpenDirectory Framework [-Wdeprecated-declarations] /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/ldap.h:1467:1: note: 'ldap_rename_s' has been explicitly marked deprecated here /Users/wenhuazhang/GoProjects/src/github.com/mqu/openldap/add-modify-delete.go:65:9: warning: 'ldap_mods_free' is deprecated: first deprecated in OS X 10.11 - use OpenDirectory Framework [-Wdeprecated-declarations] /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/ldap.h:2014:1: note: 'ldap_mods_free' has been explicitly marked deprecated here /Users/wenhuazhang/GoProjects/src/github.com/mqu/openldap/add-modify-delete.go:166:23: warning: 'ldap_delete_s' is deprecated: first deprecated in OS X 10.10 - use ldap_delete_ext_s [-Wdeprecated-declarations] /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/ldap.h:1363:1: note: 'ldap_delete_s' has been explicitly marked deprecated here

    github.com/mqu/openldap

    /Users/wenhuazhang/GoProjects/src/github.com/mqu/openldap/openldap.go:86:23: warning: 'ldap_bind_s' is deprecated: first deprecated in OS X 10.10 - use ldap_sasl_bind_s [-Wdeprecated-declarations] /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/ldap.h:1275:1: note: 'ldap_bind_s' has been explicitly marked deprecated here /Users/wenhuazhang/GoProjects/src/github.com/mqu/openldap/openldap.go:101:23: warning: 'ldap_initialize' is deprecated: first deprecated in OS X 10.11 - use OpenDirectory Framework [-Wdeprecated-declarations] /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/ldap.h:1541:1: note: 'ldap_initialize' has been explicitly marked deprecated here /Users/wenhuazhang/GoProjects/src/github.com/mqu/openldap/openldap.go:123:23: warning: 'ldap_search_s' is deprecated: first deprecated in OS X 10.10 - use ldap_search_ext_s [-Wdeprecated-declarations] /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/ldap.h:1925:1: note: 'ldap_search_s' has been explicitly marked deprecated here /Users/wenhuazhang/GoProjects/src/github.com/mqu/openldap/openldap.go:139:23: warning: 'ldap_start_tls_s' is deprecated: first deprecated in OS X 10.11 - use OpenDirectory Framework [-Wdeprecated-declarations] /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/ldap.h:1569:1: note: 'ldap_start_tls_s' has been explicitly marked deprecated here /Users/wenhuazhang/GoProjects/src/github.com/mqu/openldap/openldap.go:153:23: warning: 'ldap_unbind' is deprecated: first deprecated in OS X 10.10 - use ldap_unbind_ext [-Wdeprecated-declarations] /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/ldap.h:1967:1: note: 'ldap_unbind' has been explicitly marked deprecated here

    github.com/mqu/openldap

    /Users/wenhuazhang/GoProjects/src/github.com/mqu/openldap/options-errors.go:71:42: warning: 'ldap_err2string' is deprecated: first deprecated in OS X 10.11 - use OpenDirectory Framework [-Wdeprecated-declarations] /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/ldap.h:1384:1: note: 'ldap_err2string' has been explicitly marked deprecated here /Users/wenhuazhang/GoProjects/src/github.com/mqu/openldap/options-errors.go:88:23: warning: 'ldap_get_option' is deprecated: first deprecated in OS X 10.11 - use OpenDirectory Framework [-Wdeprecated-declarations] /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/ldap.h:978:1: note: 'ldap_get_option' has been explicitly marked deprecated here /Users/wenhuazhang/GoProjects/src/github.com/mqu/openldap/options-errors.go:105:23: warning: 'ldap_set_option' is deprecated: first deprecated in OS X 10.11 - use OpenDirectory Framework [-Wdeprecated-declarations] /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/ldap.h:984:1: note: 'ldap_set_option' has been explicitly marked deprecated here

    github.com/mqu/openldap

    /Users/wenhuazhang/GoProjects/src/github.com/mqu/openldap/results.go:111:23: warning: 'ldap_count_entries' is deprecated: first deprecated in OS X 10.11 - use OpenDirectory Framework [-Wdeprecated-declarations] /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/ldap.h:1633:1: note: 'ldap_count_entries' has been explicitly marked deprecated here /Users/wenhuazhang/GoProjects/src/github.com/mqu/openldap/results.go:126:23: warning: 'ldap_count_messages' is deprecated: first deprecated in OS X 10.11 - use OpenDirectory Framework [-Wdeprecated-declarations] /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/ldap.h:1588:1: note: 'ldap_count_messages' has been explicitly marked deprecated here /Users/wenhuazhang/GoProjects/src/github.com/mqu/openldap/results.go:140:23: warning: 'ldap_count_values_len' is deprecated: first deprecated in OS X 10.11 - use OpenDirectory Framework [-Wdeprecated-declarations] /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/ldap.h:1826:1: note: 'ldap_count_values_len' has been explicitly marked deprecated here /Users/wenhuazhang/GoProjects/src/github.com/mqu/openldap/results.go:155:42: warning: 'ldap_first_attribute' is deprecated: first deprecated in OS X 10.11 - use OpenDirectory Framework [-Wdeprecated-declarations] /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/ldap.h:1804:1: note: 'ldap_first_attribute' has been explicitly marked deprecated here /Users/wenhuazhang/GoProjects/src/github.com/mqu/openldap/results.go:169:42: warning: 'ldap_first_entry' is deprecated: first deprecated in OS X 10.11 - use OpenDirectory Framework [-Wdeprecated-declarations] /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/ldap.h:1623:1: note: 'ldap_first_entry' has been explicitly marked deprecated here /Users/wenhuazhang/GoProjects/src/github.com/mqu/openldap/results.go:183:42: warning: 'ldap_first_message' is deprecated: first deprecated in OS X 10.11 - use OpenDirectory Framework [-Wdeprecated-declarations] /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/ldap.h:1578:1: note: 'ldap_first_message' has been explicitly marked deprecated here /Users/wenhuazhang/GoProjects/src/github.com/mqu/openldap/results.go:197:42: warning: 'ldap_get_dn' is deprecated: first deprecated in OS X 10.11 - use OpenDirectory Framework [-Wdeprecated-declarations] /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/ldap.h:1662:1: note: 'ldap_get_dn' has been explicitly marked deprecated here /Users/wenhuazhang/GoProjects/src/github.com/mqu/openldap/results.go:212:42: warning: 'ldap_get_values_len' is deprecated: first deprecated in OS X 10.11 - use OpenDirectory Framework [-Wdeprecated-declarations] /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/ldap.h:1820:1: note: 'ldap_get_values_len' has been explicitly marked deprecated here /Users/wenhuazhang/GoProjects/src/github.com/mqu/openldap/results.go:226:23: warning: 'ldap_msgfree' is deprecated: first deprecated in OS X 10.11 - use OpenDirectory Framework [-Wdeprecated-declarations] /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/ldap.h:1869:1: note: 'ldap_msgfree' has been explicitly marked deprecated here /Users/wenhuazhang/GoProjects/src/github.com/mqu/openldap/results.go:241:42: warning: 'ldap_next_attribute' is deprecated: first deprecated in OS X 10.11 - use OpenDirectory Framework [-Wdeprecated-declarations] /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/ldap.h:1810:1: note: 'ldap_next_attribute' has been explicitly marked deprecated here /Users/wenhuazhang/GoProjects/src/github.com/mqu/openldap/results.go:255:42: warning: 'ldap_next_entry' is deprecated: first deprecated in OS X 10.11 - use OpenDirectory Framework [-Wdeprecated-declarations] /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/ldap.h:1628:1: note: 'ldap_next_entry' has been explicitly marked deprecated here /Users/wenhuazhang/GoProjects/src/github.com/mqu/openldap/results.go:269:42: warning: 'ldap_next_message' is deprecated: first deprecated in OS X 10.11 - use OpenDirectory Framework [-Wdeprecated-declarations] /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/ldap.h:1583:1: note: 'ldap_next_message' has been explicitly marked deprecated here /Users/wenhuazhang/GoProjects/src/github.com/mqu/openldap/results.go:287:23: warning: 'ldap_result' is deprecated: first deprecated in OS X 10.11 - use OpenDirectory Framework [-Wdeprecated-declarations] /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/ldap.h:1853:1: note: 'ldap_result' has been explicitly marked deprecated here /Users/wenhuazhang/GoProjects/src/github.com/mqu/openldap/results.go:298:2: warning: 'ldap_value_free_len' is deprecated: first deprecated in OS X 10.11 - use OpenDirectory Framework [-Wdeprecated-declarations] /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/ldap.h:1830:1: note: 'ldap_value_free_len' has been explicitly marked deprecated here

  • Close() causes SIGABRT after failing Bind()

    Close() causes SIGABRT after failing Bind()

    If a call to Bind() fails a later call to Close() on the Ldap object causes SIGABRT. I see that Bind() sets self.conn = nil if the ldap_bind_s() call is not successful; why does it do that?

    Assertion failed: (ld != NULL), function ldap_unbind_ext, file unbind.c, line 49.
    SIGABRT: abort
    PC=0x7fff963fc866
    signal arrived during cgo execution
    
    runtime.cgocall(0x40016e0, 0x427dd48)
        /usr/local/go/src/pkg/runtime/cgocall.c:149 +0x11b fp=0x427dd30
    github.com/mqu/openldap._Cfunc_ldap_unbind(0x0, 0x0)
        github.com/mqu/openldap/_obj/_cgo_defun.c:294 +0x31 fp=0x427dd48
    github.com/mqu/openldap.(*Ldap).Close(0xc210000020, 0xf, 0x427df00)
        /Users/fcy/go/src/github.com/mqu/openldap/openldap.go:134 +0x35 fp=0x427dde8
    main.main()
        /Users/fcy/go/src/github.com/fredcy/examples/ldap/main.go:41 +0x676 fp=0x427df48
    runtime.main()
        /usr/local/go/src/pkg/runtime/proc.c:220 +0x11f fp=0x427dfa0
    runtime.goexit()
        /usr/local/go/src/pkg/runtime/proc.c:1394 fp=0x427dfa8
    
    goroutine 3 [syscall]:
    runtime.goexit()
        /usr/local/go/src/pkg/runtime/proc.c:1394
    
Related tags
Scans a file or folder recursively for jar files that may be vulnerable to Log4Shell

Velocity A Minecraft server proxy with unparalleled server support, scalability, and flexibility. Velocity is licensed under the GPLv3 license. Goals

Jan 7, 2023
gh is GitHub on the command line. It brings pull requests, issues, and other GitHub concepts to the terminal next to where you are already working with git and your code
gh is GitHub on the command line. It brings pull requests, issues, and other GitHub concepts to the terminal next to where you are already working with git and your code

gh is GitHub on the command line. It brings pull requests, issues, and other GitHub concepts to the terminal next to where you are already working with git and your code

Jan 24, 2022
Websockify-go - A reverse proxy that support tcp, http, https, and the most important, noVNC, which makes it a websockify

websockify-go | mproxy a reverse proxy that support tcp, http, https, and the mo

Aug 14, 2022
An Etsy StatsD (https://github.com/etsy/statsd) implementation in Go

STATSD-GO Port of Etsy's statsd, written in Go. This was forked from https://github.com/amir/gographite to provide Ganglia submission support. USAGE U

Mar 5, 2021
Super fault-tolerant gateway for HTTP clusters, written in Go. White paper for reference - https://github.com/gptankit/serviceq-paper
Super fault-tolerant gateway for HTTP clusters, written in Go. White paper for reference - https://github.com/gptankit/serviceq-paper

ServiceQ ServiceQ is a fault-tolerant gateway for HTTP clusters. It employs probabilistic routing to distribute load during partial cluster shutdown (

Jul 16, 2022
Native ZooKeeper client for Go. This project is no longer maintained. Please use https://github.com/go-zookeeper/zk instead.

Native Go Zookeeper Client Library License 3-clause BSD. See LICENSE file. This Repository is No Longer Maintained Please use https://github.com/go-zo

Dec 19, 2022
This is a tool that allows you to check minecraft names availability, this tool can do around 3000~ names a minute or more!

Checker This is a tool that allows you to check minecraft names availability, this tool can do around 3000~ names a minute or more! Tutorial To instal

Feb 13, 2022
Go binding for gammu

gogammu is binding for SMS related functions of libGammu (documentation). gogammu/smsd is simple, MySQL based, SMS daemon, written entirely in Go (it

Dec 24, 2020
Iris Go binding

Iris Go binding This is the official Go language binding for the Iris cloud messaging framework. Version v1 of the binding is compatible with Iris v0.

Apr 22, 2022