Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 600289 Details for
Bug 761281
ldaps scheme should be used when ssl is enabled
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
A proposed patch
nss_ldap-253-ldaps.patch (text/plain), 2.59 KB, created by
Jakub Hrozek
on 2012-07-25 12:12:47 UTC
(
hide
)
Description:
A proposed patch
Filename:
MIME Type:
Creator:
Jakub Hrozek
Created:
2012-07-25 12:12:47 UTC
Size:
2.59 KB
patch
obsolete
>diff -up nss_ldap-253/util.c.ldaps nss_ldap-253/util.c >--- nss_ldap-253/util.c.ldaps 2012-07-25 07:17:41.000000000 -0400 >+++ nss_ldap-253/util.c 2012-07-25 07:39:18.000000000 -0400 >@@ -58,6 +58,8 @@ > #include "ldap-nss.h" > #include "util.h" > >+#define MAX_HOSTS 1024 >+ > static char rcsId[] = "$Id: util.c,v 2.132 2006/01/25 20:30:27 lukeh Exp $"; > > static NSS_STATUS do_getrdnvalue (const char *dn, >@@ -705,34 +707,54 @@ do_add_uris (ldap_config_t *result, char > } > > static NSS_STATUS >-do_add_hosts (ldap_config_t *result, char *hosts) >+do_add_hosts (ldap_config_t *result, char **hosts, size_t nhost) > { > /* Add a space separated list of hosts */ >- char *p; >+ size_t i; > NSS_STATUS stat = NSS_SUCCESS; >+ char *schema = result->ldc_ssl_on == SSL_LDAPS ? "ldaps" : "ldap"; > >- for (p = hosts; p != NULL; ) >+ for (i=0; i < nhost; i++) > { > char b[NSS_LDAP_CONFIG_BUFSIZ]; >- char *q = strchr (p, ' '); >- >- if (q != NULL) >- *q = '\0'; > >- snprintf (b, sizeof(b), "ldap://%s", p); >+ snprintf (b, sizeof(b), "%s://%s", schema, hosts[i]); > > stat = _nss_ldap_add_uri (result, b); >- >- p = (q != NULL) ? ++q : NULL; >- >+ free(hosts[i]); > if (stat != NSS_SUCCESS) > break; >+ > } > > return stat; > } > > static NSS_STATUS >+do_track_hosts (char **bufstart, size_t bufmax, >+ size_t *bufptr, char *hosts) >+{ >+ char *p; >+ >+ for (p = hosts; p != NULL; ) >+ { >+ char *q = strchr (p, ' '); >+ if (q != NULL) >+ *q = '\0'; >+ >+ if (*bufptr >= bufmax) return NSS_TRYAGAIN; >+ >+ bufstart[*bufptr] = strdup(p); >+ if (!bufstart[*bufptr]) return NSS_TRYAGAIN; >+ (*bufptr)++; >+ >+ p = (q != NULL) ? ++q : NULL; >+ } >+ >+ return NSS_SUCCESS; >+} >+ >+static NSS_STATUS > do_readline(FILE *fp, char **buf, size_t *bufsize) > { > char *newbuf; >@@ -784,6 +806,8 @@ _nss_ldap_readconfig (ldap_config_t ** p > NSS_STATUS rstat = NSS_SUCCESS; > ldap_config_t *result; > struct stat statbuf; >+ char *hostbuf[MAX_HOSTS]; >+ size_t hostptr = 0; > > if (bytesleft (*buffer, *buflen, ldap_config_t *) < sizeof (ldap_config_t)) > { >@@ -857,7 +881,7 @@ _nss_ldap_readconfig (ldap_config_t ** p > > if (!strcasecmp (k, NSS_LDAP_KEY_HOST)) > { >- stat = do_add_hosts (result, v); >+ stat = do_track_hosts (hostbuf, MAX_HOSTS, &hostptr, v); > if (stat != NSS_SUCCESS) > break; > } >@@ -1264,6 +1288,11 @@ _nss_ldap_readconfig (ldap_config_t ** p > } > } > >+ stat = do_add_hosts(result, hostbuf, hostptr); >+ if (stat != NSS_SUCCESS) { >+ return stat; >+ } >+ > if (result->ldc_uris[0] == NULL) > { > stat = NSS_NOTFOUND;
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 761281
: 600289