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

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

?? auth_basic.c

?? 代理服務器 squid-2.6.STABLE16
?? C
?? 第 1 頁 / 共 2 頁
字號:
    storeAppendPrintf(entry, "%s %s children %d\n", name, "basic", config->authenticateChildren);    storeAppendPrintf(entry, "%s %s concurrency %d\n", name, "basic", config->authenticateConcurrency);    storeAppendPrintf(entry, "%s %s credentialsttl %d seconds\n", name, "basic", (int) config->credentialsTTL);    storeAppendPrintf(entry, "%s %s casesensitive %s\n", name, "basic", config->casesensitive ? "on" : "off");    storeAppendPrintf(entry, "%s %s blankpassword %s\n", name, "basic", config->blankpassword ? "on" : "off");}static voidauthBasicParse(authScheme * scheme, int n_configured, char *param_str){    if (scheme->scheme_data == NULL) {	assert(basicConfig == NULL);	/* this is the first param to be found */	scheme->scheme_data = xmalloc(sizeof(auth_basic_config));	memset(scheme->scheme_data, 0, sizeof(auth_basic_config));	basicConfig = scheme->scheme_data;	basicConfig->basicAuthRealm = xstrdup("Squid proxy-caching web server");	basicConfig->authenticateChildren = 5;	basicConfig->credentialsTTL = 2 * 60 * 60;	/* two hours */    }    basicConfig = scheme->scheme_data;    if (strcasecmp(param_str, "program") == 0) {	if (basicConfig->authenticate)	    wordlistDestroy(&basicConfig->authenticate);	parse_wordlist(&basicConfig->authenticate);    } else if (strcasecmp(param_str, "children") == 0) {	parse_int(&basicConfig->authenticateChildren);    } else if (strcasecmp(param_str, "concurrency") == 0) {	parse_int(&basicConfig->authenticateConcurrency);    } else if (strcasecmp(param_str, "realm") == 0) {	parse_eol(&basicConfig->basicAuthRealm);    } else if (strcasecmp(param_str, "credentialsttl") == 0) {	parse_time_t(&basicConfig->credentialsTTL);    } else if (strcasecmp(param_str, "casesensitive") == 0) {	parse_onoff(&basicConfig->casesensitive);    } else if (strcasecmp(param_str, "blankpassword") == 0) {	parse_onoff(&basicConfig->blankpassword);    } else {	debug(29, 0) ("unrecognised basic auth scheme parameter '%s'\n", param_str);    }}static voidauthBasicCheckConfig(authScheme * scheme){    auth_basic_config *config = scheme->scheme_data;    requirePathnameExists("auth_param basic program", config->authenticate->key);}static voidauthenticateBasicStats(StoreEntry * sentry){    storeAppendPrintf(sentry, "Basic Authenticator Statistics:\n");    helperStats(sentry, basicauthenticators);}CBDATA_TYPE(authenticateStateData);/* authenticateBasicUsername: return a pointer to the username in the */char *authenticateBasicUsername(auth_user_t * auth_user){    basic_data *basic_auth = auth_user->scheme_data;    if (basic_auth)	return basic_auth->username;    return NULL;}static basic_data *authBasicDataNew(void){    basic_data *temp;    temp = memPoolAlloc(basic_data_pool);    assert(temp != NULL);    temp->username = NULL;    temp->passwd = NULL;    temp->auth_queue = NULL;    return temp;}#if UNUSED_CODEstatic voidauthBasicDataFree(basic_data * basic_auth){}#endifstatic auth_user_t *authBasicAuthUserFindUsername(const char *username){    auth_user_hash_pointer *usernamehash;    debug(29, 9) ("authBasicAuthUserFindUsername: Looking for user '%s'\n", username);    if (username && (usernamehash = hash_lookup(proxy_auth_username_cache, username))) {	while (usernamehash) {	    if ((usernamehash->auth_user->auth_type == AUTH_BASIC) &&		!strcmp(username, usernamehash->key))		return usernamehash->auth_user;	    usernamehash = usernamehash->next;	}    }    return NULL;}/* * Decode a Basic [Proxy-]Auth string, linking the passed auth_user_request structure  * to any existing user structure or creating one if needed. Note that just returning * will be treated as "cannot decode credentials". Use the message field to return a  * descriptive message to the user. */static voidauthenticateBasicDecodeAuth(auth_user_request_t * auth_user_request, const char *proxy_auth){    char *sent_auth;    char *cleartext;    basic_data *basic_auth, local_basic;    auth_user_t *auth_user;    dlink_node *node;    /* decode the username */    /* trim BASIC from string */    while (xisgraph(*proxy_auth))	proxy_auth++;    local_basic.passwd = NULL;    /* Trim leading whitespace before decoding */    while (xisspace(*proxy_auth))	proxy_auth++;    /* username and password */    sent_auth = xstrdup(proxy_auth);    /* Trim trailing \n before decoding */    strtok(sent_auth, "\n");    cleartext = uudecode(sent_auth);    xfree(sent_auth);    /*     * Don't allow NL or CR in the credentials.     * Oezguer Kesim <oec@codeblau.de>     */    debug(29, 9) ("authenticateBasicDecodeAuth: cleartext = '%s'\n", cleartext);    if (strcspn(cleartext, "\r\n") != strlen(cleartext)) {	debug(29, 1) ("authenticateBasicDecodeAuth: bad characters in authorization header '%s'\n",	    proxy_auth);	xfree(cleartext);	return;    }    local_basic.username = cleartext;    if ((cleartext = strchr(local_basic.username, ':')) != NULL)	*(cleartext)++ = '\0';    local_basic.passwd = cleartext;    if (cleartext == NULL) {	debug(29, 4) ("authenticateBasicDecodeAuth: no password in proxy authorization header '%s'\n",	    proxy_auth);	local_basic.passwd = NULL;	auth_user_request->message = xstrdup("no password was present in the HTTP [proxy-]authorization header. This is most likely a browser bug");    } else if (*cleartext == '\0' && !basicConfig->blankpassword) {	debug(29, 4) ("authenticateBasicDecodeAuth: Disallowing empty password,"	    "user is '%s'\n", local_basic.username);	local_basic.passwd = NULL;	auth_user_request->message = xstrdup("Request denied because you provided an empty password. Users MUST have a password.");    }    /* special case: we have to free the strings for user and password     * if we are not returning a filled out structure      */    if (local_basic.passwd == NULL) {	if (local_basic.username) {	    /* log the username */	    debug(29, 9) ("authBasicDecodeAuth: Creating new user for logging '%s'\n", local_basic.username);	    /* new auth_user */	    auth_user = authenticateAuthUserNew("basic");	    /* new scheme data */	    basic_auth = authBasicDataNew();	    /* save the credentials */	    basic_auth->username = local_basic.username;	    /* link the scheme data in */	    auth_user->scheme_data = basic_auth;	    /* set the auth_user type */	    auth_user->auth_type = AUTH_BROKEN;	    /* link the request to the user */	    auth_user_request->auth_user = auth_user;	    /* lock for the auth_user_request link */	    authenticateAuthUserLock(auth_user);	    node = dlinkNodeNew();	    dlinkAdd(auth_user_request, node, &auth_user->requests);	}	return;    } else {	local_basic.passwd = xstrndup(cleartext, USER_IDENT_SZ);    }    if (!basicConfig->casesensitive)	Tolower(local_basic.username);    /* now lookup and see if we have a matching auth_user structure in memory. */    if ((auth_user = authBasicAuthUserFindUsername(local_basic.username)) == NULL) {	/* the user doesn't exist in the username cache yet */	debug(29, 9) ("authBasicDecodeAuth: Creating new user '%s'\n", local_basic.username);	/* new auth_user */	auth_user = authenticateAuthUserNew("basic");	/* new scheme data */	basic_auth = authBasicDataNew();	/* save the credentials */	basic_auth->username = local_basic.username;	basic_auth->passwd = local_basic.passwd;	/* link the scheme data in */	auth_user->scheme_data = basic_auth;	/* set the auth_user type */	auth_user->auth_type = AUTH_BASIC;	/* current time for timeouts */	auth_user->expiretime = current_time.tv_sec;	/* this auth_user struct is the 'lucky one' to get added to the username cache */	/* the requests after this link to the auth_user */	/* store user in hash */	authenticateUserNameCacheAdd(auth_user);    } else {	debug(29, 9) ("authBasicDecodeAuth: Found user '%s' in the user cache as '%p'\n", local_basic.username, auth_user);	xfree(local_basic.username);	basic_auth = auth_user->scheme_data;	if (strcmp(local_basic.passwd, basic_auth->passwd)) {	    debug(29, 4) ("authBasicDecodeAuth: new password found. Updating in user master record and resetting auth state to unchecked\n");	    basic_auth->flags.credentials_ok = 0;	    xfree(basic_auth->passwd);	    basic_auth->passwd = local_basic.passwd;	} else	    xfree(local_basic.passwd);	if (basic_auth->flags.credentials_ok == 3) {	    debug(29, 4) ("authBasicDecodeAuth: last attempt to authenticate this user failed, resetting auth state to unchecked\n");	    basic_auth->flags.credentials_ok = 0;	}    }    /* link the request to the user */    auth_user_request->auth_user = auth_user;    /* lock for the auth_user_request link */    authenticateAuthUserLock(auth_user);    node = dlinkNodeNew();    dlinkAdd(auth_user_request, node, &auth_user->requests);    return;}/* Initialize helpers and the like for this auth scheme. Called AFTER parsing the * config file */static voidauthBasicInit(authScheme * scheme){    static int init = 0;    if (basicConfig->authenticate) {	if (!basic_data_pool)	    basic_data_pool = memPoolCreate("Basic Scheme User Data", sizeof(basic_data));	authbasic_initialised = 1;	if (basicauthenticators == NULL)	    basicauthenticators = helperCreate("basicauthenticator");	basicauthenticators->cmdline = basicConfig->authenticate;	basicauthenticators->n_to_start = basicConfig->authenticateChildren;	basicauthenticators->concurrency = basicConfig->authenticateConcurrency;	basicauthenticators->ipc_type = IPC_STREAM;	helperOpenServers(basicauthenticators);	if (!init) {	    cachemgrRegister("basicauthenticator",		"Basic User Authenticator Stats",		authenticateBasicStats, 0, 1);	    init++;	}	CBDATA_INIT_TYPE(authenticateStateData);    }}/* send the initial data to a basic authenticator module */static voidauthenticateBasicStart(auth_user_request_t * auth_user_request, RH * handler, void *data){    authenticateStateData *r = NULL;    char buf[8192];    char user[1024], pass[1024];    basic_data *basic_auth;    assert(auth_user_request);    assert(handler);    assert(auth_user_request->auth_user->auth_type == AUTH_BASIC);    assert(auth_user_request->auth_user->scheme_data != NULL);    basic_auth = auth_user_request->auth_user->scheme_data;    debug(29, 9) ("authenticateStart: '%s:%s'\n", basic_auth->username,	basic_auth->passwd);    if (basicConfig->authenticate == NULL) {	handler(data, NULL);	return;    }    /* check to see if the auth_user already has a request outstanding */    if (basic_auth->flags.credentials_ok == 2) {	/* there is a request with the same credentials already being verified */	auth_basic_queue_node *node;	node = xmalloc(sizeof(auth_basic_queue_node));	assert(node);	/* save the details */	node->next = basic_auth->auth_queue;	basic_auth->auth_queue = node;	node->handler = handler;	node->data = data;	cbdataLock(data);	return;    } else {	r = cbdataAlloc(authenticateStateData);	r->handler = handler;	cbdataLock(data);	r->data = data;	r->auth_user_request = auth_user_request;	authenticateAuthUserRequestLock(r->auth_user_request);	/* mark the user as haveing verification in progress */	basic_auth->flags.credentials_ok = 2;	xstrncpy(user, rfc1738_escape(basic_auth->username), sizeof(user));	xstrncpy(pass, rfc1738_escape(basic_auth->passwd), sizeof(pass));	snprintf(buf, sizeof(buf), "%s %s\n", user, pass);	helperSubmit(basicauthenticators, buf, authenticateBasicHandleReply, r);    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久 天天综合| 欧美一区二区三区在线视频| 亚洲免费观看高清完整版在线观看熊| 白白色 亚洲乱淫| 亚洲精品亚洲人成人网在线播放| 欧美色图在线观看| 麻豆国产一区二区| 国产婷婷一区二区| 91丨九色丨蝌蚪富婆spa| 亚洲成人av一区二区三区| 日韩欧美国产综合| 不卡电影免费在线播放一区| 亚洲在线视频一区| 日韩欧美第一区| jlzzjlzz欧美大全| 亚洲成人免费在线观看| 精品国产露脸精彩对白 | 高清国产一区二区三区| 国产精品国产a级| 欧美日韩免费电影| 国产综合成人久久大片91| 国产精品家庭影院| 欧美电影在哪看比较好| 国产精品亚洲专一区二区三区 | 精品制服美女久久| 欧美国产激情一区二区三区蜜月| 91福利资源站| 久久国内精品视频| 综合色中文字幕| 日韩精品一区二区三区中文精品| 成人午夜免费视频| 天堂av在线一区| 国产精品亲子伦对白| 欧美三级视频在线| 国产精品1区2区| 亚洲福利一区二区| 久久精品一区二区| 欧美色男人天堂| 国产福利一区二区三区| 亚洲影院理伦片| 国产日韩欧美高清在线| 欧美日韩美少妇| www.欧美日韩| 久久99久久久久久久久久久| 亚洲精品视频在线| 久久久久国产一区二区三区四区 | 蜜桃在线一区二区三区| 日韩伦理电影网| 精品成人在线观看| 欧美在线不卡一区| 成人一区二区三区在线观看| 日日夜夜精品视频免费| 国产精品麻豆视频| 精品国产91乱码一区二区三区| 一本色道久久综合亚洲aⅴ蜜桃 | 精品奇米国产一区二区三区| 色噜噜狠狠一区二区三区果冻| 狠狠色综合日日| 亚洲一级片在线观看| 中文字幕不卡在线观看| 日韩欧美在线观看一区二区三区| 色综合av在线| 国产成人在线影院| 麻豆精品久久精品色综合| 亚洲自拍偷拍九九九| 国产精品成人在线观看| 2021久久国产精品不只是精品| 717成人午夜免费福利电影| 色综合久久综合网欧美综合网| 国产黄色精品网站| 蜜臀av在线播放一区二区三区| 夜夜揉揉日日人人青青一国产精品| 久久久国产一区二区三区四区小说 | 久久免费偷拍视频| 欧美一区二区三区啪啪| 欧美色视频一区| 日本高清不卡aⅴ免费网站| 国产成人精品免费在线| 九一九一国产精品| 日韩成人伦理电影在线观看| 亚洲一区二区三区四区中文字幕| 国产精品国产三级国产普通话99| 久久人人97超碰com| 日韩欧美成人一区二区| 91精品婷婷国产综合久久竹菊| 欧美亚男人的天堂| 色八戒一区二区三区| 99re这里只有精品视频首页| 国产成人精品免费看| 国产美女av一区二区三区| 久久精品国产网站| 看电视剧不卡顿的网站| 日本在线播放一区二区三区| 亚洲成人资源在线| 亚洲第一在线综合网站| 一区二区三区在线影院| 亚洲另类在线视频| 一区二区三区四区激情| 亚洲精品成人精品456| 亚洲人亚洲人成电影网站色| 亚洲视频狠狠干| 亚洲精品成人天堂一二三| 亚洲黄色性网站| 亚洲一区二区三区影院| 亚洲一区二区3| 午夜在线成人av| 日本伊人精品一区二区三区观看方式| 亚洲.国产.中文慕字在线| 婷婷开心激情综合| 麻豆视频一区二区| 国产在线不卡一区| 国产九色sp调教91| 粉嫩一区二区三区在线看| 成a人片亚洲日本久久| 91在线观看成人| 在线免费精品视频| 欧美日韩精品欧美日韩精品一综合| 欧美伦理视频网站| 欧美成人女星排行榜| 久久久五月婷婷| 国产精品国产三级国产a| 亚洲码国产岛国毛片在线| 一卡二卡欧美日韩| 天天综合日日夜夜精品| 老汉av免费一区二区三区| 国产一区二区三区精品欧美日韩一区二区三区 | 99久久99精品久久久久久 | 精品成人一区二区三区四区| 久久一区二区视频| 久久久久久9999| 中文字幕在线免费不卡| 亚洲精品国产一区二区三区四区在线| 亚洲一区二区三区激情| 日日摸夜夜添夜夜添国产精品| 玖玖九九国产精品| 高清beeg欧美| 色综合久久综合网欧美综合网 | 欧美va天堂va视频va在线| 国产清纯白嫩初高生在线观看91| 国产精品久久免费看| 亚洲国产精品视频| 麻豆国产欧美日韩综合精品二区 | 欧美亚洲综合在线| 欧美一级欧美三级在线观看| 久久久电影一区二区三区| 国产精品成人免费| 亚洲一区在线观看免费观看电影高清| 日本大胆欧美人术艺术动态| 国产露脸91国语对白| 99精品欧美一区二区蜜桃免费| 欧美日韩成人高清| 久久香蕉国产线看观看99| 亚洲女子a中天字幕| 免费看日韩a级影片| 成人黄色小视频| 欧美精选一区二区| 久久精品在线观看| 亚洲高清免费视频| 国产一区二区三区综合| 色婷婷狠狠综合| 精品第一国产综合精品aⅴ| 亚洲乱码国产乱码精品精小说 | 欧美精品电影在线播放| 午夜精品aaa| 国产91丝袜在线观看| 欧美色图12p| 欧美国产视频在线| 日本伊人午夜精品| 97精品国产露脸对白| 欧美一区二区久久| 亚洲天堂成人在线观看| 美女网站色91| 色8久久人人97超碰香蕉987| 精品国产污网站| 亚洲资源中文字幕| 风间由美一区二区三区在线观看 | 日韩综合在线视频| av一区二区久久| 精品久久久久av影院| 亚洲一区二区三区爽爽爽爽爽| 国产又黄又大久久| 欧美日韩免费电影| 最新中文字幕一区二区三区| 久久国产视频网| 欧美日韩激情一区| 国产精品电影院| 极品瑜伽女神91| 欧美日韩国产bt| 亚洲女人****多毛耸耸8| 国产精品一区二区无线| 51精品久久久久久久蜜臀| 亚洲精品国产一区二区三区四区在线 | 成人综合婷婷国产精品久久| 欧美一区二区三区视频| 亚洲一卡二卡三卡四卡无卡久久 | 色综合久久中文字幕| 国产日韩欧美一区二区三区乱码| 日韩电影免费在线看| 在线观看精品一区| 日韩毛片精品高清免费|