# HG changeset patch # User Olaf Wintermann # Date 1362174294 -3600 # Node ID 5ec9abba1027c59d8f81163339a1bb28a9374818 # Parent aced2245fb1c4d7c5df7489e5f99152f907cb6d5 fixed acl_evaluate diff -r aced2245fb1c -r 5ec9abba1027 src/server/daemon/acl.c --- a/src/server/daemon/acl.c Fri Mar 01 21:15:52 2013 +0100 +++ b/src/server/daemon/acl.c Fri Mar 01 22:44:54 2013 +0100 @@ -121,20 +121,36 @@ // the acl denies access if(!user) { - pblock_nvinsert( - "www-authenticate", - "Basic realm=\"Webserver\"", - rq->srvhdrs); + char *value = NULL; + if(acl->authprompt) { + size_t realmlen = strlen(acl->authprompt); + size_t len = realmlen + 16; + value = pool_malloc(sn->pool, len); + if(value) { + snprintf( + value, + len, + "Basic realm=\"%s\"", + acl->authprompt); + } + } + if(!value) { + value = "Basic realm=\"login\""; + } + pblock_nvinsert("www-authenticate", value, rq->srvhdrs); protocol_status(sn, rq, PROTOCOL_UNAUTHORIZED, NULL); + } else { + user->free(user); } - user->free(user); return REQ_ABORTED; } elm = elm->next; } // ok - all acls allowed access - user->free(user); + if(user) { + user->free(user); + } return REQ_PROCEED; }