diff options
Diffstat (limited to 'modules/ldap/ldap.c')
-rw-r--r-- | modules/ldap/ldap.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/modules/ldap/ldap.c b/modules/ldap/ldap.c index d686f6b..b34c560 100644 --- a/modules/ldap/ldap.c +++ b/modules/ldap/ldap.c @@ -110,3 +110,3 @@ argz_copy(char ***dst, char **a) - b = calloc(i + 1, sizeof(b[0])); + b = calloc(n + 1, sizeof(b[0])); if (!b) @@ -202,3 +202,3 @@ parse_ldap_conf(const char *name, struct smap_option const *opt) line = 0; - while (p = fgets(buf, sizeof(buf), fp)) { + while ((p = fgets(buf, sizeof(buf), fp))) { size_t len; @@ -256,2 +256,3 @@ parse_ldap_conf(const char *name, struct smap_option const *opt) +#if 0 static int @@ -264,2 +265,3 @@ readconf(struct smap_option const *opt, const char *val, char **errmsg) } +#endif @@ -504,4 +506,2 @@ ldap_connect(struct ldap_conf *conf) LDAP *ld = NULL; - char *val; - unsigned long lval; @@ -607,4 +607,2 @@ get_passwd(struct ldap_conf *conf, struct berval *pwd, char **palloc) { - char *file; - if (conf->bindpwfile) { @@ -614,6 +612,6 @@ get_passwd(struct ldap_conf *conf, struct berval *pwd, char **palloc) - fd = open(file, O_RDONLY); + fd = open(conf->bindpwfile, O_RDONLY); if (fd == -1) { smap_error("can't open password file %s: %s", - file, strerror(errno)); + conf->bindpwfile, strerror(errno)); return -1; @@ -622,3 +620,3 @@ get_passwd(struct ldap_conf *conf, struct berval *pwd, char **palloc) smap_error("can't stat password file %s: %s", - file, strerror(errno)); + conf->bindpwfile, strerror(errno)); close(fd); @@ -633,3 +631,3 @@ get_passwd(struct ldap_conf *conf, struct berval *pwd, char **palloc) } - rc = full_read(fd, file, mem, st.st_size); + rc = full_read(fd, conf->bindpwfile, mem, st.st_size); close(fd); @@ -733,3 +731,2 @@ mod_ldap_init_db(const char *dbid, int argc, char **argv) { - LDAP *ldap; struct ldap_db *db; @@ -882,3 +879,2 @@ getvar(const char *var, size_t len, void *data) if (gd->ld) { - struct berval bv; char *p; @@ -991,4 +987,2 @@ mod_ldap_query(smap_database_t dbp, char const *inenv[5]; - char **env; - char **attrs; struct wordsplit ws; @@ -996,3 +990,2 @@ mod_ldap_query(smap_database_t dbp, int rc; - char *reply = NULL; LDAPMessage *res, *msg; |