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

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

?? parse.c

?? A* sudo sudo/* B* adduser script adduser C* rmuser script rmuser E* tout tout/*
?? C
字號:
/* *  sudo version 1.1 allows users to execute commands as root *  Copyright (C) 1991  The Root Group, Inc. * *  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 1, 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., 675 Mass Ave, Cambridge, MA 02139, USA. * *  If you make modifications to the source, we would be happy to have *  them to include in future releases.  Feel free to send them to: *      Jeff Nieusma                       nieusma@rootgroup.com *      3959 Arbol CT                      (303) 447-8093 *      Boulder, CO 80301-1752              ********************************************************************************** parse.c, sudo project* David R. Hieb* March 18, 1991** routines to implement and maintain the parsing and list management.*******************************************************************************/#include <stdio.h>#include <strings.h>#include <ctype.h>#include "sudo.h"/* there are 3 main lists (User, Host_Alias, Cmnd_Alias) and 1 extra list */#define NUM_LISTS 3+1extern char *user, *host, *cmnd;extern FILE *yyin, *yyout;int user_list_found = FALSE;int list_num, new_list[NUM_LISTS];int parse_error = FALSE, found_user = FALSE;int next_type, num_host_alias = 0, num_cmnd_alias = 0;LINK tmp_ptr, reset_ptr, save_ptr, list_ptr[NUM_LISTS];/******************************************************************************** inserts a node into list 'list_num' and updates list_ptr[list_num]*******************************************************************************/void insert_member(list_num, token_type, op_type, data_string)int token_type, list_num;char op_type;char *data_string;{    tmp_ptr = (LINK)malloc(sizeof(LIST));    tmp_ptr->type = token_type;    tmp_ptr->op = op_type;    tmp_ptr->data = (char *)malloc(strlen(data_string)+1);    strcpy(tmp_ptr->data, data_string);    tmp_ptr->next = (new_list[list_num] == TRUE) ? NULL : list_ptr[list_num];    list_ptr[list_num] = list_ptr[EXTRA_LIST] = tmp_ptr;}/******************************************************************************** diagnostic list printing utility that prints list 'list_num'*******************************************************************************/void print_list(list_num)int list_num;{LINK tmptmp_ptr;tmptmp_ptr = list_ptr[list_num];while (list_ptr[list_num] != NULL) {    printf("type = %d, op = %c, data = %s\n", list_ptr[list_num]->type,        list_ptr[list_num]->op, list_ptr[list_num]->data);    tmp_ptr = list_ptr[list_num];    list_ptr[list_num] = tmp_ptr->next;    }list_ptr[list_num] = tmptmp_ptr;}/******************************************************************************** delete list utility that deletes list 'list_num'*******************************************************************************/void delete_list(list_num)int list_num;{while (list_ptr[list_num] != NULL) {    tmp_ptr = list_ptr[list_num];    list_ptr[list_num] = tmp_ptr->next;/*  free(tmp_ptr);   */    }}/******************************************************************************** this routine is what the lex/yacc code calls to build the different lists.* once the lists are all built, control eventually returns to validate().*******************************************************************************/int call_back(token_type, op_type, data_string)int token_type;char op_type;char *data_string;{/* all nodes start out in the extra list since the node name is received last */list_num = EXTRA_LIST;/* * if the last received node is TYPE1, then we can classify the list * and effectively transfer the extra list to the correct list type. */if (token_type == TYPE1) {    /* we have just build a "Host_Alias" list */    if (strcmp(data_string, "Host_Alias") == 0) {        list_num = HOST_LIST;        if (num_host_alias > 0) {            reset_ptr->next = list_ptr[HOST_LIST];            }        num_host_alias++;        }    /* we have just build a "Cmnd_Alias" list */    else if (strcmp(data_string, "Cmnd_Alias") == 0) {        list_num = CMND_LIST;        if (num_cmnd_alias > 0) {            reset_ptr->next = list_ptr[CMND_LIST];            }        num_cmnd_alias++;        }    /* we have just build a "User" list */    else {        list_num = USER_LIST;        user_list_found = TRUE;        }    new_list[EXTRA_LIST] = TRUE;    new_list[list_num] = FALSE;    list_ptr[list_num] = list_ptr[EXTRA_LIST];    }/* actually link the new node into list 'list_num' */insert_member(list_num, token_type, op_type, data_string);if (new_list[list_num] == TRUE) {    reset_ptr = list_ptr[list_num];    new_list[list_num] = FALSE;    }/* * we process one user record at a time from the sudoers file. if we * find the user were looking for, we return to lex/yacc declaring  * that we have done so. otherwise, we reset the user list, delete the  * nodes and start over again looking for the user. */if (user_list_found == TRUE) {    if (list_ptr[list_num]->type == TYPE1 &&        strcmp(list_ptr[list_num]->data, user) == 0) {            return(FOUND_USER);            }        else {            new_list[list_num] = TRUE;            user_list_found = FALSE;            delete_list(list_num);            }    }return(NOT_FOUND_USER);}/******************************************************************************** this routine is called from cmnd_check() to resolve whether or not* a user is permitted to perform a to-yet-be-determined command for* a certain host name.*******************************************************************************/int host_type_ok(){/* check for the reserved keyword 'ALL'. if so, don't check the host name */if (strcmp(list_ptr[USER_LIST]->data, "ALL") == 0) {    return(TRUE);    }/* this case is the normal lowercase hostname */else if (isupper(list_ptr[USER_LIST]->data[0]) == FALSE) {    return(strcmp(list_ptr[USER_LIST]->data, host) == 0);    }/* by now we have a Host_Alias that will have to be expanded */else {    save_ptr = list_ptr[HOST_LIST];    while (list_ptr[HOST_LIST] != NULL) {        if ((list_ptr[HOST_LIST]->type == TYPE2) &&            (strcmp(list_ptr[HOST_LIST]->data,                     list_ptr[USER_LIST]->data) == 0)) {            next_type = list_ptr[HOST_LIST]->next->type;            tmp_ptr = list_ptr[HOST_LIST];             list_ptr[HOST_LIST] = tmp_ptr->next;            while (next_type == TYPE3) {                if (strcmp(list_ptr[HOST_LIST]->data, host) == 0) {                    list_ptr[HOST_LIST] = save_ptr;                    return(TRUE);                    }                if (list_ptr[HOST_LIST]->next != NULL) {                    next_type = list_ptr[HOST_LIST]->next->type;                    tmp_ptr = list_ptr[HOST_LIST];                    list_ptr[HOST_LIST] = tmp_ptr->next;                    }                else {                    next_type = ~TYPE3;                    }                }            }        else {            tmp_ptr = list_ptr[HOST_LIST];            list_ptr[HOST_LIST] = tmp_ptr->next;            }        }    list_ptr[HOST_LIST] = save_ptr;    return(FALSE);    }}/******************************************************************************** this routine is called from cmnd_check() to resolve whether or not* a user is permitted to perform a certain command on the already* established host.*******************************************************************************/int cmnd_type_ok(){/* check for the reserved keyword 'ALL'. */if (strcmp(list_ptr[USER_LIST]->data, "ALL") == 0) {    /* if the command has an absolute path, let them do it */    if (cmnd[0] == '/') {        return(MATCH);        }    /* if the command does not have an absolute path, forget it */    else {        return(NO_MATCH);        }    }/* if the command has an absolute path, check it out */else if (list_ptr[USER_LIST]->data[0] == '/') {    /* op  |   data   | return value     *---------------------------------     * ' ' | No Match | return(NO_MATCH)      * '!' | No Match | return(NO_MATCH)      * ' ' |  A Match | return(MATCH)      * '!' |  A Match | return(QUIT_NOW)     *     * these special cases are important in subtracting from the     * Universe of commands in something like:     *   user machine=ALL,!/bin/rm,!/etc/named ...     */    if (strcmp(list_ptr[USER_LIST]->data, cmnd) == 0) {        if (list_ptr[USER_LIST]->op == '!') {            return(QUIT_NOW);            }        else {            return(MATCH);            }        }    else {        return(NO_MATCH);        }    }/* by now we have a Cmnd_Alias that will have to be expanded */else {    save_ptr = list_ptr[CMND_LIST];    while (list_ptr[CMND_LIST] != NULL) {        if ((list_ptr[CMND_LIST]->type == TYPE2) &&            (strcmp(list_ptr[CMND_LIST]->data,                     list_ptr[USER_LIST]->data) == 0)) {            next_type = list_ptr[CMND_LIST]->next->type;            tmp_ptr = list_ptr[CMND_LIST];             list_ptr[CMND_LIST] = tmp_ptr->next;            while (next_type == TYPE3) {                if (strcmp(list_ptr[CMND_LIST]->data, cmnd) == 0) {                    if (list_ptr[USER_LIST]->op == '!') {                        list_ptr[CMND_LIST] = save_ptr;                        return(QUIT_NOW);                        }                    else {                        list_ptr[CMND_LIST] = save_ptr;                        return(MATCH);                        }                    }                if (list_ptr[CMND_LIST]->next != NULL) {                    next_type = list_ptr[CMND_LIST]->next->type;                    tmp_ptr = list_ptr[CMND_LIST];                    list_ptr[CMND_LIST] = tmp_ptr->next;                    }                else {                    next_type = ~TYPE3;                    }                }            }        else {            tmp_ptr = list_ptr[CMND_LIST];            list_ptr[CMND_LIST] = tmp_ptr->next;            }        }    list_ptr[CMND_LIST] = save_ptr;    return(NO_MATCH);    }}/******************************************************************************** this routine is called from validate() after the call_back() routine* has built all the possible lists. this routine steps thru the user list* calling on host_type_ok() and cmnd_type_ok() trying to resolve whether* or not the user will be able to execute the command on the host.*******************************************************************************/int cmnd_check(){int return_code;while (list_ptr[USER_LIST] != NULL) {    if ((list_ptr[USER_LIST]->type == TYPE2) && host_type_ok()) {        next_type = list_ptr[USER_LIST]->next->type;        tmp_ptr = list_ptr[USER_LIST];         list_ptr[USER_LIST] = tmp_ptr->next;        while (next_type == TYPE3) {            return_code = cmnd_type_ok();            if (return_code == MATCH) {                return(VALIDATE_OK);                }            else if (return_code == QUIT_NOW) {                return(VALIDATE_NOT_OK);                }            if (list_ptr[USER_LIST]->next != NULL) {                next_type = list_ptr[USER_LIST]->next->type;                tmp_ptr = list_ptr[USER_LIST];                list_ptr[USER_LIST] = tmp_ptr->next;                }            else {                next_type = ~TYPE3;                }            }        }    else {        tmp_ptr = list_ptr[USER_LIST];        list_ptr[USER_LIST] = tmp_ptr->next;        }    }return(VALIDATE_NOT_OK);}/******************************************************************************** this routine is called from the sudo.c module and tries to validate* the user, host and command triplet.*******************************************************************************/int validate(){FILE *sudoers_fp;int i, return_code;if ((sudoers_fp = fopen(SUDOERS, "r")) == NULL ) {    perror(SUDOERS);    log_error( NO_SUDOERS_FILE );    exit(1);    }yyin = sudoers_fp;yyout = stdout;for (i = 0; i < NUM_LISTS; i++)    new_list[i] = TRUE;/* * yyparse() returns with one of 3 values: 0) yyparse() worked fine;  * 1) yyparse() failed; FOUND_USER) the user was found and yyparse() * was returned from prematurely. */return_code = yyparse();/* don't need to keep this open... */(void) fclose (sudoers_fp);/* if a parsing error occurred, set return_code accordingly */if (parse_error == TRUE) {    return_code = PARSE_ERROR;    }/* if the user was not found, set the return_code accordingly */if (found_user == FALSE) {    return_code = NOT_FOUND_USER;    }/* handle the 3 cases individually &*/switch(return_code) {    case FOUND_USER:        return_code = cmnd_check();        delete_list(USER_LIST);        delete_list(HOST_LIST);        delete_list(CMND_LIST);        return(return_code);        break;    case NOT_FOUND_USER:            return(VALIDATE_NO_USER);        break;    case PARSE_ERROR:         return(VALIDATE_ERROR);        break;    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产福利视频一区二区三区| 不卡的av网站| 亚洲精品少妇30p| 丁香六月综合激情| 成人免费在线视频观看| 99视频精品全部免费在线| 国产精品免费视频观看| 黑人巨大精品欧美一区| 亚洲国产成人自拍| 在线播放欧美女士性生活| www.日韩精品| 亚洲午夜精品17c| 国产精品―色哟哟| 欧美精品一区二区三区一线天视频| av午夜一区麻豆| 国产成人亚洲综合a∨猫咪 | 一区二区三区四区中文字幕| 91亚洲精品久久久蜜桃网站| 一区二区三区成人| 91麻豆精品国产无毒不卡在线观看 | 波多野结衣欧美| 国产欧美日韩综合| 91香蕉视频污| 亚洲午夜免费福利视频| 欧美日本不卡视频| 亚洲国产视频在线| 欧美精品tushy高清| 久久99精品国产麻豆婷婷洗澡| 国产精品美女久久久久久 | 国产亚洲女人久久久久毛片| 成人午夜激情视频| 国产在线视频一区二区| 亚洲国产人成综合网站| 亚洲同性同志一二三专区| 欧美一区永久视频免费观看| 国产精品久久久久婷婷| 91亚洲国产成人精品一区二区三 | 欧美日韩在线三区| 国产福利视频一区二区三区| 国产剧情一区二区| 大美女一区二区三区| 国产精品资源在线看| 国产精品456露脸| 九色|91porny| 国产成人免费高清| 成人三级在线视频| 99精品国产视频| 91尤物视频在线观看| 91久久免费观看| 91精品欧美久久久久久动漫| 风流少妇一区二区| 久久久久久影视| 日韩专区在线视频| 欧洲一区在线电影| 欧美高清一级片在线观看| 精品一区免费av| 欧美欧美欧美欧美| 亚洲同性同志一二三专区| 国产精品99精品久久免费| 在线观看一区不卡| 综合久久久久久久| 国产在线精品一区二区三区不卡 | 国产精品资源站在线| 成人免费视频视频| 欧美日韩亚洲综合在线 | 日本韩国精品在线| 91精品国产福利在线观看| 精品国精品自拍自在线| 亚洲日本在线天堂| 国产精品18久久久久久vr| 欧美人狂配大交3d怪物一区| 欧美不卡在线视频| 国产午夜精品一区二区三区四区| 国产精品久久综合| 国产精品一区二区三区乱码| 精品三级在线看| 麻豆高清免费国产一区| 欧美一卡二卡三卡| 亚洲欧洲另类国产综合| 国产麻豆精品theporn| 亚洲精品在线网站| 国产精品一区二区三区四区| 91精品国产欧美一区二区| 欧美精品一区二区精品网| 亚洲成人自拍网| 成人av网站在线| 日韩免费一区二区三区在线播放| 亚洲图片你懂的| 成人黄色777网| 久久午夜羞羞影院免费观看| 香蕉成人伊视频在线观看| 99综合电影在线视频| 精品捆绑美女sm三区| 亚洲综合色区另类av| 国产iv一区二区三区| 亚洲精品在线观看网站| 九色porny丨国产精品| 日韩三级精品电影久久久| 亚洲国产视频网站| 欧美男人的天堂一二区| 一区二区三区中文字幕电影| 92国产精品观看| 1区2区3区国产精品| 国产成人精品午夜视频免费| 精品成a人在线观看| 精品午夜一区二区三区在线观看| 91麻豆精品久久久久蜜臀| 麻豆精品新av中文字幕| 日韩西西人体444www| 国内外精品视频| 国产精品视频yy9299一区| 成人激情开心网| 亚洲成av人影院在线观看网| 日韩欧美中文字幕精品| 国产在线一区二区| 国产精品白丝在线| 欧美日韩国产美| 国产精品一区在线| 亚洲视频图片小说| 日韩一卡二卡三卡国产欧美| 粉嫩蜜臀av国产精品网站| 亚洲精品国产第一综合99久久| 3atv一区二区三区| 国产91精品免费| 天天综合天天做天天综合| 国产91综合网| 国产欧美日本一区视频| 色婷婷精品久久二区二区蜜臂av| 26uuu久久天堂性欧美| 岛国av在线一区| 久久国产精品免费| 亚洲国产精品久久艾草纯爱| 亚洲国产高清不卡| 精品va天堂亚洲国产| 欧美精品在线观看播放| voyeur盗摄精品| 春色校园综合激情亚洲| 日本在线观看不卡视频| 亚洲综合色自拍一区| 国产精品家庭影院| 51精品秘密在线观看| 91在线精品秘密一区二区| 久久se精品一区精品二区| 午夜天堂影视香蕉久久| 国产亚洲精品精华液| 日韩欧美一级二级| 777午夜精品免费视频| 欧美日韩黄色影视| 欧美日韩一区不卡| 欧美日韩高清一区二区不卡| 欧美日韩视频一区二区| 欧美日韩精品系列| 欧美嫩在线观看| 欧美一级日韩一级| 精品国精品国产| 国产午夜亚洲精品理论片色戒| 久久久蜜桃精品| 国产精品无遮挡| 亚洲精品自拍动漫在线| 一区二区理论电影在线观看| 最新成人av在线| 一区二区三区小说| 蜜桃av噜噜一区| 国产suv精品一区二区6| 色婷婷国产精品久久包臀 | 国产九色精品成人porny| 成人午夜又粗又硬又大| 色婷婷综合久久久| 日韩女优av电影在线观看| 国产精品女主播在线观看| 亚洲综合在线免费观看| 亚洲精品老司机| 一区二区理论电影在线观看| 日韩av在线免费观看不卡| 从欧美一区二区三区| 欧美高清视频在线高清观看mv色露露十八| 欧美日韩国产一级片| 国产欧美精品一区二区三区四区 | 天使萌一区二区三区免费观看| 九九精品一区二区| 欧美天天综合网| 国产欧美精品日韩区二区麻豆天美| 亚洲自拍偷拍欧美| 高清不卡在线观看av| 精品久久五月天| 蜜臀久久久久久久| 色偷偷久久一区二区三区| 国产亚洲女人久久久久毛片| 亚洲第一av色| 91福利在线看| 欧美经典一区二区三区| 老司机精品视频一区二区三区| 欧美手机在线视频| 亚洲欧美日本韩国| 99视频一区二区三区| 亚洲欧美一区二区在线观看| 成人蜜臀av电影| 日韩美女精品在线| 99国产欧美另类久久久精品| 国产精品成人免费精品自在线观看 |