Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 42057 Details for
Bug 67932
ldapdns Gentoo howto
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to allow LDAP URLs
ldapdns-sockconn.patch (text/plain), 1.57 KB, created by
Steve-o
on 2004-10-17 14:04:05 UTC
(
hide
)
Description:
Patch to allow LDAP URLs
Filename:
MIME Type:
Creator:
Steve-o
Created:
2004-10-17 14:04:05 UTC
Size:
1.57 KB
patch
obsolete
>diff -urN ldapdns-2.04.original/engine.c ldapdns-2.04/engine.c >--- ldapdns-2.04.original/engine.c 2003-03-29 22:55:30.000000000 -0500 >+++ ldapdns-2.04/engine.c 2004-10-17 09:01:41.000000000 -0400 >@@ -171,7 +171,7 @@ > #endif > > x = strchr(hostnamestr, ':'); >- if (!x) { >+ if (!x || (*(x+1) && *(x+1) == '/')) { > port = LDAP_PORT; > } else { > port = atoi(x+1); >@@ -180,8 +180,12 @@ > > o->message_sent = 0; > o->message_wait = 0; // XXX >- o->ldap_con = ldap_init(hostnamestr, port); >- if (x) *x = ':'; /* egad */ >+ if (ldap_is_ldap_url(hostnamestr)) { >+ ldap_initialize(&(o->ldap_con), hostnamestr); >+ } else { >+ o->ldap_con = ldap_init(hostnamestr, port); >+ if (x) *x = ':'; /* egad */ >+ } > > if (!o->ldap_con) > return -1; >@@ -3655,6 +3659,7 @@ > str_init(retbuf); > str_copy(retbuf, x); > for (h = str(retbuf); h && *h;) { /* on init: np if it infinites */ >+ int uri=0; > for (x = h; *x && *x != ',' && *x != ' ' > && *x != ';' && *x != '\t'; x++); > if (*x) { >@@ -3666,18 +3671,24 @@ > p = LDAP_PORT; > for (y = h; *y && *y != ':'; y++); > if (*y && *y == ':') { >- *y = 0; >- y++; >- p = atoi(y); >- if (p == -1) >- p = LDAP_PORT; >+ if (*(y+1) && *(y+1) == '/') { /* detect ldap:// uri */ >+ uri=1; >+ } else { >+ *y = 0; >+ y++; >+ p = atoi(y); >+ if (p == -1) >+ p = LDAP_PORT; >+ } > } > > str_init(hbuf); > str_copy(hbuf, h); >- str_addch(hbuf, ':'); >- sprintf(spbuf, "%d", p); >- str_cat(hbuf, spbuf); >+ if (!uri) { >+ str_addch(hbuf, ':'); >+ sprintf(spbuf, "%d", p); >+ str_cat(hbuf, spbuf); >+ } > > list_push(&ldapdns.hosts, str(hbuf)); > h = x;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 67932
:
42056
| 42057 |
42058
|
42214
|
68054