summaryrefslogtreecommitdiff
path: root/daemon/httpauthd.c
diff options
context:
space:
mode:
Diffstat (limited to 'daemon/httpauthd.c')
-rw-r--r--daemon/httpauthd.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/daemon/httpauthd.c b/daemon/httpauthd.c
index b26eb60..d4d70ea 100644
--- a/daemon/httpauthd.c
+++ b/daemon/httpauthd.c
@@ -69,6 +69,7 @@
extern ha_handler_t simple_handler;
extern ha_handler_t dummy_handler;
extern ha_handler_t ldap_handler;
+extern ha_handler_t ntlm_handler;
extern ha_handler_t pgsql_handler;
extern ha_handler_t mysql_handler;
@@ -78,6 +79,9 @@ ha_handler_t* g_handlerlist[] =
#if WITH_LDAP
&ldap_handler,
#endif
+#if WITH_NTLM
+ &ntlm_handler,
+#endif
#if WITH_PGSQL
&pgsql_handler,
#endif
@@ -85,7 +89,7 @@ ha_handler_t* g_handlerlist[] =
&mysql_handler,
#endif
&simple_handler,
- &dummy_handler
+ &dummy_handler
};
typedef struct httpauth_loaded
@@ -356,7 +360,7 @@ int main(int argc, char* argv[])
siginterrupt(SIGTERM, 1);
/* Open the system log */
- openlog("httpauthd", 0, LOG_AUTHPRIV);
+ openlog("httpauthd", 0, LOG_DAEMON);
ha_messagex(NULL, LOG_DEBUG, "accepting connections");
@@ -1091,7 +1095,7 @@ static int httpauth_processor(int ifd, int ofd)
ha_buffer_t buf;
ha_request_t rq;
int result = -1;
- int r;
+ int r = 0;
ASSERT(ifd != -1);
ASSERT(ofd != -1);
@@ -1457,28 +1461,33 @@ static int config_parse(const char* file, ha_buffer_t* buf)
{
int types = 0;
char* t;
+ char* v;
strlwr(value);
+ v = value;
/* Split the line into tokens at the spaces */
- while(*value)
+ while(*v)
{
- value = trim_space(value);
- t = value;
+ v = trim_space(v);
+ t = v;
while(*t && !isspace(*t))
t++;
- if(strncmp(value, "basic", 5) == 0)
+ if(strncmp(v, "basic", 5) == 0)
types |= HA_TYPE_BASIC;
- else if(strncmp(value, "digest", 6) == 0)
+ else if(strncmp(v, "digest", 6) == 0)
types |= HA_TYPE_DIGEST;
+ else if(strncmp(v, "ntlm", 4) == 0)
+ types |= HA_TYPE_NTLM;
+
else
errx(1, "invalid type for '%s': %s (line %d)", name, value, line);
- value = t;
+ v = t;
}
if(types == 0)