version 1.10, 2011/11/18 09:51:31 |
version 1.10.6.1, 2014/08/20 00:02:22 |
|
|
/* $eterna: auth-bozo.c,v 1.17 2011/11/18 09:21:15 mrg Exp $ */ |
/* $eterna: auth-bozo.c,v 1.17 2011/11/18 09:21:15 mrg Exp $ */ |
|
|
/* |
/* |
* Copyright (c) 1997-2011 Matthew R. Green |
* Copyright (c) 1997-2014 Matthew R. Green |
* All rights reserved. |
* All rights reserved. |
* |
* |
* Redistribution and use in source and binary forms, with or without |
* Redistribution and use in source and binary forms, with or without |
Line 74 bozo_auth_check(bozo_httpreq_t *request, |
|
Line 74 bozo_auth_check(bozo_httpreq_t *request, |
|
} |
} |
request->hr_authrealm = bozostrdup(httpd, dir); |
request->hr_authrealm = bozostrdup(httpd, dir); |
|
|
snprintf(authfile, sizeof(authfile), "%s/%s", dir, AUTH_FILE); |
if ((size_t)snprintf(authfile, sizeof(authfile), "%s/%s", dir, AUTH_FILE) >= |
|
sizeof(authfile)) { |
|
return bozo_http_error(httpd, 404, request, |
|
"authfile path too long"); |
|
} |
if (stat(authfile, &sb) < 0) { |
if (stat(authfile, &sb) < 0) { |
debug((httpd, DEBUG_NORMAL, |
debug((httpd, DEBUG_NORMAL, |
"bozo_auth_check realm `%s' dir `%s' authfile `%s' missing", |
"bozo_auth_check realm `%s' dir `%s' authfile `%s' missing", |
Line 119 bozo_auth_cleanup(bozo_httpreq_t *reques |
|
Line 123 bozo_auth_cleanup(bozo_httpreq_t *reques |
|
|
|
if (request == NULL) |
if (request == NULL) |
return; |
return; |
if (request->hr_authuser) |
free(request->hr_authuser); |
free(request->hr_authuser); |
free(request->hr_authpass); |
if (request->hr_authpass) |
free(request->hr_authrealm); |
free(request->hr_authpass); |
|
if (request->hr_authrealm) |
|
free(request->hr_authrealm); |
|
} |
} |
|
|
int |
int |