亚洲欧美第一页_禁久久精品乱码_粉嫩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精品国产日韩91久久久久久| 91.麻豆视频| 一本到不卡免费一区二区| 最新高清无码专区| 国产精品二三区| 国产一区视频导航| 91国偷自产一区二区三区观看| 亚洲毛片av在线| 亚洲国产高清在线观看视频| 亚洲亚洲精品在线观看| 欧美一区二区三区免费视频| 欧美人与z0zoxxxx视频| 亚洲日穴在线视频| 成人精品国产福利| 国产人妖乱国产精品人妖| 久久激情五月激情| 日韩欧美专区在线| 毛片av一区二区三区| 欧美一区二区三区系列电影| 午夜免费欧美电影| 3d动漫精品啪啪1区2区免费| 亚洲尤物视频在线| 欧美三区在线观看| 性欧美大战久久久久久久久| 欧美日韩国产综合视频在线观看| 一区二区三区在线看| 在线观看91精品国产入口| 国产精品高潮呻吟| 91丨porny丨首页| 亚洲视频狠狠干| 色综合久久久久久久| 亚洲综合在线第一页| 欧美精品久久99| 久久不见久久见免费视频7| 日韩亚洲欧美一区| 黄色日韩三级电影| 中文字幕不卡的av| 色综合天天在线| 亚洲一区二区三区美女| 欧美精品久久一区| 极品美女销魂一区二区三区| 国产日产亚洲精品系列| 91蝌蚪国产九色| 五月婷婷激情综合网| 日韩午夜在线观看| 成人福利视频在线看| 亚洲精选在线视频| 日韩一区二区电影网| 国产精品91一区二区| 亚洲免费在线视频| 在线不卡中文字幕| 国产馆精品极品| 亚洲一区二区精品视频| 日韩精品一区二区三区三区免费| 成人免费看片app下载| 亚洲6080在线| 久久精品日产第一区二区三区高清版| 91网上在线视频| 麻豆91精品视频| 亚洲欧美综合在线精品| 欧美精品欧美精品系列| 不卡一二三区首页| 另类专区欧美蜜桃臀第一页| 国产精品国产精品国产专区不片| 欧美人狂配大交3d怪物一区| 国产精品自拍网站| 日韩电影在线一区| 国产精品人成在线观看免费| 欧美一区永久视频免费观看| 91年精品国产| 国产福利一区在线| 日产精品久久久久久久性色| 日韩毛片视频在线看| 精品国产在天天线2019| 欧美午夜片在线看| 成人综合在线网站| 久久国产免费看| 亚洲444eee在线观看| 亚洲人成精品久久久久久| 久久久av毛片精品| 欧美精品v国产精品v日韩精品| www.欧美日韩| 国产精品亚洲第一区在线暖暖韩国| 青娱乐精品在线视频| 亚洲精品伦理在线| 国产精品欧美综合在线| 日韩午夜激情视频| 91精品国产91热久久久做人人| 一本色道久久综合亚洲精品按摩| 国产成人高清在线| 国产一区美女在线| 精品影视av免费| 另类中文字幕网| 久久av老司机精品网站导航| 午夜精品在线看| 日韩经典中文字幕一区| 亚洲成人一区二区在线观看| 亚洲精品久久久蜜桃| 亚洲欧美影音先锋| 国产精品久久久久影院老司| 亚洲国产精品v| 国产精品视频一区二区三区不卡| 欧美激情一二三区| 国产精品毛片无遮挡高清| 国产拍揄自揄精品视频麻豆| 国产女主播视频一区二区| 久久久高清一区二区三区| 国产午夜亚洲精品羞羞网站| 国产欧美日韩另类视频免费观看| 久久久久久一二三区| 国产亚洲短视频| 欧美激情一区二区三区不卡 | 91精品国产综合久久久蜜臀粉嫩| 色欧美片视频在线观看在线视频| 91视频一区二区| 色拍拍在线精品视频8848| 在线免费精品视频| 9191久久久久久久久久久| 日韩一区二区在线播放| 精品少妇一区二区三区视频免付费 | 日韩一区二区视频在线观看| 日韩欧美一二三四区| 久久久一区二区三区| 国产精品你懂的| 亚洲国产欧美日韩另类综合| 午夜av电影一区| 毛片av中文字幕一区二区| 国产91在线看| 欧洲另类一二三四区| 69精品人人人人| 国产三级精品在线| 一区二区三区中文字幕| 日韩影院在线观看| 国产伦精一区二区三区| eeuss鲁一区二区三区| 欧洲一区二区av| 国产网红主播福利一区二区| 一区二区在线观看视频在线观看| 日韩成人免费电影| 国产剧情在线观看一区二区 | 国产精品一区专区| 在线观看日韩精品| 久久久久久亚洲综合| 亚洲乱码日产精品bd| 六月丁香综合在线视频| av一区二区三区| 欧美一级二级在线观看| 中文字幕一区二区三中文字幕| 日韩高清在线观看| 91在线小视频| 精品国产乱码久久久久久夜甘婷婷 | 精品亚洲欧美一区| 日本高清视频一区二区| 精品国产91乱码一区二区三区| 亚洲黄色av一区| 国产高清在线观看免费不卡| 制服丝袜亚洲播放| 亚洲人成7777| 成人激情校园春色| 精品奇米国产一区二区三区| 亚洲自拍偷拍网站| 成人免费视频视频| 欧美大片一区二区| 亚洲一区二区三区中文字幕在线| 成人毛片视频在线观看| 精品日韩一区二区三区| 日韩中文字幕亚洲一区二区va在线| av中文一区二区三区| 国产亚洲综合在线| 久久99国内精品| 欧美一级日韩不卡播放免费| 一区二区三区在线影院| www.在线欧美| 国产精品三级久久久久三级| 久久9热精品视频| 日韩你懂的在线观看| 丝袜国产日韩另类美女| 色香蕉久久蜜桃| 亚洲乱码国产乱码精品精小说 | 日韩欧美综合在线| 婷婷丁香久久五月婷婷| 在线观看日韩电影| 夜夜嗨av一区二区三区| 色综合久久综合| 亚洲人成网站影音先锋播放| 99久久99久久久精品齐齐| 一区视频在线播放| 色综合天天综合网国产成人综合天| 国产精品国产三级国产aⅴ中文 | 国产激情偷乱视频一区二区三区|