Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating entries in database #201

Closed
biotom opened this issue Dec 17, 2018 · 1 comment
Closed

Creating entries in database #201

biotom opened this issue Dec 17, 2018 · 1 comment

Comments

@biotom
Copy link

biotom commented Dec 17, 2018

Hi, everybody,
Apologies if this isn't the right place to ask this, but I'm trying to write some code to add an entry to my example LDAP server. I'm hoping for the entry to have the attributes cn, ou, dc, and dc. I can connect to the database fine, but I get ' op=0 RESULT tag=105 err=2 text=no attributes provided' when I try to add the entry.

My code is:
var controls = []ldap.Control{}
func main() {
conn, err := ldap.DialURL("ldap://localhost:389")
...
} else {
newRequest := ldap.NewAddRequest("cn=tom,ou=users,dc=example,dc=org", controls)
conn.Add(newRequest)
}
}

I'm sure the issue is something to do with the controls I'm passing in (or lack thereof), but I'm pretty new to LDAP and relatively new to Go, so I'm not sure what I'm doing wrong. Is there some more detailed documentation anywhere I could read, or is there anything obvious I'm not getting right?

Thank you, and apologies if this isn't the right place to ask this.

@biotom
Copy link
Author

biotom commented Dec 19, 2018

I managed to fix this! I'll try and work it into a readable example, if that would be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant