completed ldap support

This commit is contained in:
roberto@precise64
2012-03-10 15:21:08 +01:00
parent bd15fd9da1
commit e8d96b8f84
3 changed files with 12 additions and 12 deletions
+1 -6
View File
@@ -239,7 +239,7 @@ void uwsgi_opt_ldap_dump(char *opt, char *foo, void *bar) {
exit(0);
}
void uwsgi_ldap_config() {
void uwsgi_ldap_config(char *url) {
LDAP *ldp;
LDAPMessage *results, *entry;
@@ -248,7 +248,6 @@ void uwsgi_ldap_config() {
char *attr;
char *uwsgi_attr;
char *url = "ldap:///";
char *url_slash;
int desired_version = LDAP_VERSION3;
@@ -256,10 +255,6 @@ void uwsgi_ldap_config() {
LDAPURLDesc *ldap_url;
if (uwsgi.ldap) {
url = uwsgi.ldap;
}
if (!ldap_is_ldap_url(url)) {
uwsgi_log("invalid LDAP url.\n");
exit(1);
+7 -1
View File
@@ -223,7 +223,7 @@ static struct uwsgi_option uwsgi_base_options[] = {
{"zmq", required_argument, 0, "create a zeromq pub/sub pair", uwsgi_opt_set_str, &uwsgi.zeromq,0},
#endif
#ifdef UWSGI_LDAP
{"ldap", required_argument, 0, "load configuration from ldap server", uwsgi_opt_set_str, &uwsgi.ldap, 0},
{"ldap", required_argument, 0, "load configuration from ldap server", uwsgi_opt_load_ldap, NULL, UWSGI_OPT_IMMEDIATE},
{"ldap-schema", no_argument, 0, "dump uWSGI ldap schema", uwsgi_opt_ldap_dump, NULL, UWSGI_OPT_IMMEDIATE},
{"ldap-schema-ldif", no_argument, 0, "dump uWSGI ldap schema in ldif format", uwsgi_opt_ldap_dump_ldif, NULL, UWSGI_OPT_IMMEDIATE},
#endif
@@ -3864,6 +3864,12 @@ void uwsgi_opt_load_json(char *opt, char *filename, void *none) {
}
#endif
#ifdef UWSGI_LDAP
void uwsgi_opt_load_ldap(char *opt, char *url, void *none) {
uwsgi_ldap_config(url);
}
#endif
void uwsgi_opt_flock(char *opt, char *filename, void *none) {
int fd = open(filename, O_RDWR);
+4 -5
View File
@@ -1449,10 +1449,6 @@ struct uwsgi_server {
int no_server;
int command_mode;
#ifdef UWSGI_LDAP
char *ldap;
#endif
int xml_round2;
char *cwd;
@@ -2026,7 +2022,7 @@ void uwsgi_sqlite3_config(char *, char *[]);
#ifdef UWSGI_LDAP
void uwsgi_opt_ldap_dump(char *, char *, void *);
void uwsgi_opt_ldap_dump_ldif(char *, char *, void *);
void uwsgi_ldap_config(void);
void uwsgi_ldap_config(char *);
#endif
inline int uwsgi_strncmp(char *, int, char *, int);
@@ -2653,6 +2649,9 @@ void uwsgi_opt_load_sqlite3(char *, char *, void *);
#ifdef UWSGI_JSON
void uwsgi_opt_load_json(char *, char *, void *);
#endif
#ifdef UWSGI_LDAP
void uwsgi_opt_load_ldap(char *, char *, void *);
#endif
void uwsgi_opt_set_umask(char *, char *, void *);
void uwsgi_opt_add_spooler(char *, char *, void *);