#include "portable.h"
-#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
-#include <time.h>
-#include <ac/unistd.h>
+#include <ac/stdlib.h>
#include <ac/string.h>
+#include <ac/time.h>
+#include <ac/unistd.h>
#include <lber.h>
#include <ldap.h>
-#include <ldif.h>
+#include "ldif.h"
#include "maint_form.h" /* for HTML Form manipulations */
/* default values */
if (strcompare(getenv("REQUEST_METHOD"),"POST"))
{
printf("<p>++ Error - This script should be referenced with a METHOD of POST.\n");
- exit(1);
+ exit( EXIT_FAILURE );
}
if (strcompare(getenv("CONTENT_TYPE"),"application/x-www-form-urlencoded"))
{
printf("<p>++ Error - This script can only be used to decode form results. \n");
- exit(1);
+ exit( EXIT_FAILURE );
}
cl = atoi(getenv("CONTENT_LENGTH"));
printf("%s%s%s", "This script expected a 'FORM' value returned ",
"and did not get one. Make sure the HTML used for this ",
"script is correct.");
- exit(1);
+ exit( EXIT_FAILURE );
}
/* Looking for:
time(&now);
sprintf(temp,"\n==< Results >==\n\n");
fputs(temp,logfp);
- sprintf(temp,"** performing ldap_open at %s\n", ctime(&now));
+ sprintf(temp,"** performing ldap_init at %s\n", ctime(&now));
fputs(temp,logfp);
fflush(logfp);
fclose(logfp);
}
}
- if ( (ld = ldap_open(ldap_data.servername, ldap_data.ldap_port_num) ) == NULL)
+ if ( (ld = ldap_init(ldap_data.servername, ldap_data.ldap_port_num) ) == NULL)
{
- printf("<font color=red><b>ldap_open error</b></font>\n");
+ printf("<font color=red><b>ldap_init error</b></font>\n");
if (ldap_data.debug != 0) {
if ((logfp = fopen("web_ldap.log","a")) == 0) {
}
else {
- sprintf(temp,"++ ldap_open error\n");
+ sprintf(temp,"++ ldap_init error\n");
fputs(temp,logfp);
fflush(logfp);
fclose(logfp);
}
}
printf("</body>\n</html>\n");
- exit(1);
+ exit( EXIT_FAILURE );
}
/*authenticate as nobody */
}
}
printf("</body>\n</html>\n");
- exit(1);
+ exit( EXIT_FAILURE );
}
printf("<b>Directory Lookup Results</b>\n<pre>\n");