亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? auth_basic.c

?? 代理服務器 squid-2.6.STABLE16
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* * $Id: auth_basic.c,v 1.25 2006/07/30 23:27:04 hno Exp $ * * DEBUG: section 29    Authenticator * AUTHOR: Duane Wessels * * SQUID Web Proxy Cache          http://www.squid-cache.org/ * ---------------------------------------------------------- * *  Squid is the result of efforts by numerous individuals from *  the Internet community; see the CONTRIBUTORS file for full *  details.   Many organizations have provided support for Squid's *  development; see the SPONSORS file for full details.  Squid is *  Copyrighted (C) 2001 by the Regents of the University of *  California; see the COPYRIGHT file for full details.  Squid *  incorporates software developed and/or copyrighted by other *  sources; see the CREDITS file for full details. * *  This program is free software; you can redistribute it and/or modify *  it under the terms of the GNU General Public License as published by *  the Free Software Foundation; either version 2 of the License, or *  (at your option) any later version. *   *  This program is distributed in the hope that it will be useful, *  but WITHOUT ANY WARRANTY; without even the implied warranty of *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the *  GNU General Public License for more details. *   *  You should have received a copy of the GNU General Public License *  along with this program; if not, write to the Free Software *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * *//* The functions in this file handle authentication. * They DO NOT perform access control or auditing. * See acl.c for access control and client_side.c for auditing */#include "squid.h"#include "auth_basic.h"static voidauthenticateStateFree(authenticateStateData * r){    if (r->auth_user_request) {	authenticateAuthUserRequestUnlock(r->auth_user_request);	r->auth_user_request = NULL;    }    cbdataFree(r);}/* Basic Scheme */static HLPCB authenticateBasicHandleReply;static AUTHSACTIVE authenticateBasicActive;static AUTHSAUTHED authenticateBasicAuthenticated;static AUTHSAUTHUSER authenticateBasicAuthenticateUser;static AUTHSCONFIGURED authBasicConfigured;static AUTHSDIRECTION authenticateBasicDirection;static AUTHSDECODE authenticateBasicDecodeAuth;static AUTHSDUMP authBasicCfgDump;static AUTHSFIXERR authenticateBasicFixErrorHeader;static AUTHSFREE authenticateBasicFreeUser;static AUTHSFREECONFIG authBasicFreeConfig;static AUTHSPARSE authBasicParse;static AUTHSCHECKCONFIG authBasicCheckConfig;static AUTHSINIT authBasicInit;static AUTHSSTART authenticateBasicStart;static AUTHSSTATS authenticateBasicStats;static AUTHSUSERNAME authenticateBasicUsername;static AUTHSSHUTDOWN authBasicDone;static helper *basicauthenticators = NULL;static auth_basic_config *basicConfig = NULL;static int authbasic_initialised = 0;MemPool *basic_data_pool = NULL;/* * * Public Functions * */AUTHSSETUP authSchemeSetup_basic;voidauthSchemeSetup_basic(authscheme_entry_t * authscheme){    assert(!authbasic_initialised);    authscheme->Active = authenticateBasicActive;    authscheme->parse = authBasicParse;    authscheme->checkconfig = authBasicCheckConfig;    authscheme->dump = authBasicCfgDump;    authscheme->init = authBasicInit;    authscheme->authAuthenticate = authenticateBasicAuthenticateUser;    authscheme->authenticated = authenticateBasicAuthenticated;    authscheme->configured = authBasicConfigured;    authscheme->authFixHeader = authenticateBasicFixErrorHeader;    authscheme->FreeUser = authenticateBasicFreeUser;    authscheme->freeconfig = authBasicFreeConfig;    authscheme->authStart = authenticateBasicStart;    authscheme->authStats = authenticateBasicStats;    authscheme->authUserUsername = authenticateBasicUsername;    authscheme->getdirection = authenticateBasicDirection;    authscheme->oncloseconnection = NULL;    authscheme->decodeauth = authenticateBasicDecodeAuth;    authscheme->donefunc = authBasicDone;    authscheme->authConnLastHeader = NULL;}/* internal functions */static voidauthBasicDone(void){    if (basicauthenticators)	helperShutdown(basicauthenticators);    authbasic_initialised = 0;    if (!shutting_down)	return;    if (basicauthenticators)	helperFree(basicauthenticators);    basicauthenticators = NULL;    if (basic_data_pool) {	memPoolDestroy(basic_data_pool);	basic_data_pool = NULL;    }    debug(29, 2) ("authBasicDone: Basic authentication Shutdown.\n");}static intauthenticateBasicActive(){    return (authbasic_initialised == 1) ? 1 : 0;}static intauthBasicConfigured(){    if ((basicConfig != NULL) && (basicConfig->authenticate != NULL) &&	(basicConfig->authenticateChildren != 0) &&	(basicConfig->basicAuthRealm != NULL)) {	debug(29, 9) ("authBasicConfigured: returning configured\n");	return 1;    }    debug(29, 9) ("authBasicConfigured: returning unconfigured\n");    return 0;}static intauthenticateBasicAuthenticated(auth_user_request_t * auth_user_request){    basic_data *basic_auth = auth_user_request->auth_user->scheme_data;    if ((basic_auth->flags.credentials_ok == 1) && (basic_auth->credentials_checkedtime + basicConfig->credentialsTTL > squid_curtime))	return 1;    debug(29, 4) ("User not authenticated or credentials need rechecking.\n");    return 0;}#if UNUSED_CODEstatic intauthenticateBasiccmpUsername(basic_data * u1, basic_data * u2){    return strcmp(u1->username, u2->username);}#endif/* log a basic user in */static voidauthenticateBasicAuthenticateUser(auth_user_request_t * auth_user_request, request_t * request, ConnStateData * conn, http_hdr_type type){    auth_user_t *auth_user;    basic_data *basic_auth;    assert(auth_user_request->auth_user != NULL);    auth_user = auth_user_request->auth_user;    assert(auth_user->scheme_data != NULL);    basic_auth = auth_user->scheme_data;    /* if the password is not ok, do an identity */    if (basic_auth->flags.credentials_ok != 1)	return;    /* are we about to recheck the credentials externally? */    if ((basic_auth->credentials_checkedtime + basicConfig->credentialsTTL) <= squid_curtime) {	debug(29, 4) ("authBasicAuthenticate: credentials expired - rechecking\n");	return;    }    /* we have been through the external helper, and the credentials haven't expired */    debug(29, 9) ("authenticateBasicAuthenticateuser: user '%s' authenticated\n",	basic_auth->username);    /* Decode now takes care of finding the auth_user struct in the cache */    /* after external auth occurs anyway */    auth_user->expiretime = current_time.tv_sec;    return;}intauthenticateBasicDirection(auth_user_request_t * auth_user_request){/* null auth_user is checked for by authenticateDirection */    auth_user_t *auth_user = auth_user_request->auth_user;    basic_data *basic_auth = auth_user->scheme_data;    switch (basic_auth->flags.credentials_ok) {    case 0:			/* not checked */	return -1;    case 1:			/* checked & ok */	if (basic_auth->credentials_checkedtime + basicConfig->credentialsTTL <= squid_curtime)	    return -1;	return 0;    case 2:			/* paused while waiting for a username:password check on another request */	return -1;    case 3:			/* authentication process failed. */	return 0;    }    return -2;}voidauthenticateBasicFixErrorHeader(auth_user_request_t * auth_user_request, HttpReply * rep, http_hdr_type type, request_t * request){    if (basicConfig->authenticate) {	debug(29, 9) ("authenticateFixErrorHeader: Sending type:%d header: 'Basic realm=\"%s\"'\n", type, basicConfig->basicAuthRealm);	httpHeaderPutStrf(&rep->header, type, "Basic realm=\"%s\"", basicConfig->basicAuthRealm);    }}/* free any allocated configuration details */voidauthBasicFreeConfig(authScheme * scheme){    if (basicConfig == NULL)	return;    assert(basicConfig == scheme->scheme_data);    if (basicConfig->authenticate)	wordlistDestroy(&basicConfig->authenticate);    if (basicConfig->basicAuthRealm)	safe_free(basicConfig->basicAuthRealm);    xfree(basicConfig);    basicConfig = NULL;}voidauthenticateBasicFreeUser(auth_user_t * auth_user){    basic_data *basic_auth = auth_user->scheme_data;    debug(29, 5) ("authenticateBasicFreeUser: Clearing Basic scheme data\n");    if (basic_auth->username)	xfree(basic_auth->username);    if (basic_auth->passwd)	xfree(basic_auth->passwd);    memPoolFree(basic_data_pool, auth_user->scheme_data);    auth_user->scheme_data = NULL;}static voidauthenticateBasicHandleReply(void *data, char *reply){    authenticateStateData *r = data;    auth_user_t *auth_user;    basic_data *basic_auth;    auth_basic_queue_node *tmpnode;    int valid;    char *t = NULL;    debug(29, 9) ("authenticateBasicHandleReply: {%s}\n", reply ? reply : "<NULL>");    if (reply) {	if ((t = strchr(reply, ' ')))	    *t++ = '\0';	if (*reply == '\0')	    reply = NULL;    }    assert(r->auth_user_request != NULL);    assert(r->auth_user_request->auth_user->auth_type == AUTH_BASIC);    auth_user = r->auth_user_request->auth_user;    basic_auth = auth_user->scheme_data;    if (reply && (strncasecmp(reply, "OK", 2) == 0))	basic_auth->flags.credentials_ok = 1;    else {	basic_auth->flags.credentials_ok = 3;	safe_free(r->auth_user_request->message);	if (t && *t)	    r->auth_user_request->message = xstrdup(t);    }    basic_auth->credentials_checkedtime = squid_curtime;    valid = cbdataValid(r->data);    if (valid)	r->handler(r->data, NULL);    cbdataUnlock(r->data);    while (basic_auth->auth_queue) {	tmpnode = basic_auth->auth_queue->next;	valid = cbdataValid(basic_auth->auth_queue->data);	if (valid)	    basic_auth->auth_queue->handler(basic_auth->auth_queue->data, NULL);	cbdataUnlock(basic_auth->auth_queue->data);	xfree(basic_auth->auth_queue);	basic_auth->auth_queue = tmpnode;    }    authenticateStateFree(r);}static voidauthBasicCfgDump(StoreEntry * entry, const char *name, authScheme * scheme){    auth_basic_config *config = scheme->scheme_data;    wordlist *list = config->authenticate;    storeAppendPrintf(entry, "%s %s", name, "basic");    while (list != NULL) {	storeAppendPrintf(entry, " %s", list->key);	list = list->next;    }    storeAppendPrintf(entry, "\n%s %s realm %s\n", name, "basic", config->basicAuthRealm);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人av资源| 91国产丝袜在线播放| 亚洲美女区一区| 日韩欧美一区二区视频| www.欧美.com| 美女一区二区三区在线观看| 国产精品久久久久久久久动漫| 欧美一区二区网站| 91美女片黄在线| 成人一级黄色片| 国模无码大尺度一区二区三区 | 亚洲视频图片小说| 欧美www视频| 欧美电影一区二区| 91在线视频免费91| 国产成人精品免费视频网站| 日韩精品福利网| 亚洲精品视频观看| 亚洲视频在线观看一区| 日本一区二区久久| 久久午夜老司机| 日韩免费观看高清完整版在线观看| 日本韩国欧美一区二区三区| 国产**成人网毛片九色 | 久久众筹精品私拍模特| 91精品欧美一区二区三区综合在| www.亚洲国产| 国产69精品久久久久毛片| 国产一区视频网站| 看国产成人h片视频| 香港成人在线视频| 午夜欧美电影在线观看| 亚洲乱码一区二区三区在线观看| 国产精品女主播在线观看| 久久久精品人体av艺术| 久久免费精品国产久精品久久久久 | 日本不卡1234视频| 日本va欧美va欧美va精品| 日本午夜一区二区| 亚洲成av人在线观看| 亚洲18色成人| 丝袜美腿一区二区三区| 午夜国产不卡在线观看视频| 性欧美疯狂xxxxbbbb| 天天综合网天天综合色| 婷婷开心激情综合| 亚洲第一成人在线| 亚洲国产成人高清精品| 亚洲一区二区三区四区在线观看| 亚洲国产精品久久久男人的天堂| 偷拍一区二区三区四区| 天堂午夜影视日韩欧美一区二区| 亚洲午夜免费视频| 美女一区二区三区在线观看| 久久精品国产第一区二区三区| 国产一区欧美二区| 成人国产精品免费观看动漫| 播五月开心婷婷综合| av高清不卡在线| 在线视频中文字幕一区二区| 欧美日韩免费视频| 日韩精品一区二| 国产欧美视频一区二区三区| 中文字幕一区在线观看视频| 亚洲一区av在线| 蜜桃av一区二区在线观看| 国产乱码精品一区二区三区忘忧草| 国产一区 二区| 不卡欧美aaaaa| 欧美日韩在线综合| 精品久久久久一区二区国产| 国产女人aaa级久久久级| 亚洲欧美日韩久久精品| 亚洲成人av一区| 国产美女在线精品| 色综合咪咪久久| 日韩三级视频在线观看| 亚洲国产成人一区二区三区| 亚洲成人综合在线| 国产成人自拍高清视频在线免费播放| 成人av电影免费观看| 欧美军同video69gay| 国产婷婷一区二区| 亚洲国产欧美一区二区三区丁香婷| 理论片日本一区| 一本久久a久久精品亚洲| 日韩亚洲欧美中文三级| 国产精品成人一区二区艾草| 狂野欧美性猛交blacked| 国产传媒久久文化传媒| 欧美三级在线视频| 久久久久国产一区二区三区四区 | 成人国产精品免费网站| 91精品一区二区三区久久久久久| 国产精品免费视频一区| 亚洲va欧美va国产va天堂影院| 国产成人aaa| 5月丁香婷婷综合| 亚洲免费高清视频在线| 国产真实乱子伦精品视频| 欧美视频在线一区| 中文字幕精品一区二区精品绿巨人| 亚洲444eee在线观看| 99国产精品久| 久久久不卡网国产精品二区| 日本黄色一区二区| 国产亚洲精品中文字幕| 婷婷丁香久久五月婷婷| 午夜一区二区三区视频| 国产一区二区久久| 欧美精品亚洲二区| 中文字幕在线观看一区| 韩国一区二区在线观看| 欧美又粗又大又爽| 中文一区二区完整视频在线观看| 奇米一区二区三区| 91官网在线免费观看| 亚洲色图20p| jlzzjlzz欧美大全| 久久嫩草精品久久久精品一| 九九精品一区二区| 欧美一区二区三区的| 性做久久久久久| 欧美日韩中字一区| 亚洲国产一区二区三区| 欧美在线观看一区| 亚洲免费电影在线| 91丨porny丨中文| 亚洲欧洲三级电影| www.亚洲色图.com| 国产精品欧美极品| 波多野结衣精品在线| 中文字幕精品一区| 成人亚洲精品久久久久软件| 国产欧美中文在线| 国产a精品视频| 亚洲国产成人午夜在线一区| 成人手机在线视频| 亚洲国产精品国自产拍av| 懂色av中文字幕一区二区三区| 26uuu欧美| 成人自拍视频在线观看| 国产精品福利影院| 色素色在线综合| 亚洲福利一二三区| 制服视频三区第一页精品| 日本中文字幕一区二区视频| 日韩一区二区三区免费看| 麻豆成人av在线| 久久精品亚洲一区二区三区浴池 | 国产区在线观看成人精品| 国产不卡一区视频| 国产精品不卡在线| 91麻豆免费看片| 亚洲国产精品一区二区www在线| 欧美人xxxx| 美女视频免费一区| 国产欧美一区二区精品性色超碰 | 精油按摩中文字幕久久| 国产亚洲欧美日韩俺去了| 成人精品国产一区二区4080 | 国产乱对白刺激视频不卡| 国产蜜臀av在线一区二区三区| 9色porny自拍视频一区二区| 亚洲宅男天堂在线观看无病毒| 欧美区在线观看| 国产精品一区二区三区99| 亚洲卡通欧美制服中文| 69久久99精品久久久久婷婷| 国产一区不卡在线| 亚洲精品久久嫩草网站秘色| 日韩一区二区视频在线观看| 成人免费观看视频| 午夜精品视频在线观看| 欧美精品一区男女天堂| 色88888久久久久久影院野外| 日韩电影在线一区| 中国av一区二区三区| 欧美日韩在线电影| 国产精品资源在线观看| 亚洲精选视频免费看| 日韩精品在线网站| 91女神在线视频| 精品亚洲免费视频| 一区二区三区在线不卡| 精品福利在线导航| 在线中文字幕一区二区| 国产一区二区三区在线观看免费 | 亚洲天堂中文字幕| 欧美一级艳片视频免费观看| 99re免费视频精品全部| 麻豆精品一区二区三区| 一区二区三区中文字幕精品精品 | 一区二区三区加勒比av| 久久嫩草精品久久久精品一| 欧美日韩一区二区在线观看| 福利91精品一区二区三区| 日韩av不卡在线观看| 曰韩精品一区二区| 国产色一区二区|