From: Chas Williams (CONTRACTOR) Date: Fri, 10 Oct 2014 13:12:31 +0000 (-0400) Subject: uss: Make the uss parser private X-Git-Tag: openafs-stable-1_8_0pre1~417 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=24f0fdcce4cdc493edcf35c8578a151b8bbb32fd uss: Make the uss parser private Attempt to make the parser in uss private so that it doesn't conflict with other libraries that might leak their parser symbols. Change-Id: I15b52f55b419b3bbc788ced9660bc41163e2be36 Reviewed-on: http://gerrit.openafs.org/11533 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot --- diff --git a/src/uss/Makefile.in b/src/uss/Makefile.in index 018a098..8338c63 100644 --- a/src/uss/Makefile.in +++ b/src/uss/Makefile.in @@ -53,6 +53,7 @@ lex.yy.o : lex.yy.c y.tab.c lex.yy.c : lex.l ${LEX} ${srcdir}/lex.l + sed -f ${srcdir}/yy-lsed -i.orig lex.yy.c y.tab.o : y.tab.c @@ -74,6 +75,7 @@ uss_fs.c: uss_fs.h y.tab.c : grammar.y ${YACC} -d ${srcdir}/grammar.y + sed -f ${srcdir}/yy-lsed -i.orig y.tab.h y.tab.c # # Installation targets @@ -90,6 +92,6 @@ dest: # Misc. targets # clean: - $(RM) -f *.o uss y.tab.c y.tab.h lex.yy.c core AFS_component_version_number.c + $(RM) -f *.o uss y.tab.c y.tab.h lex.yy.c core AFS_component_version_number.c *.orig include ../config/Makefile.version diff --git a/src/uss/uss.c b/src/uss/uss.c index 4f51c23..c1fb669 100644 --- a/src/uss/uss.c +++ b/src/uss/uss.c @@ -96,7 +96,7 @@ extern int uss_perr; static char Template[300] = "uss.template"; /*Default name */ -extern FILE *yyin, *yyout; /*YACC input & output files */ +extern FILE *uss_yyin, *uss_yyout; /*YACC input & output files */ extern int doUnlog; int uss_BulkExpires = 0; int local_Cell = 1; @@ -1652,15 +1652,15 @@ DoAdd(void) * Open up the template file before doing any real processing, * so we can quit early should it not be found. */ - if (yyin == NULL) { - if ((yyin = uss_procs_FindAndOpen(Template)) == NULL) { + if (uss_yyin == NULL) { + if ((uss_yyin = uss_procs_FindAndOpen(Template)) == NULL) { fprintf(stderr, "%s: ** Can't open template file '%s'\n", uss_whoami, Template); return (-1); } - yyout = fopen("/dev/null", "w"); + uss_yyout = fopen("/dev/null", "w"); } else - rewind(yyin); + rewind(uss_yyin); /* * Add the new user to the Protection DB. @@ -1803,7 +1803,7 @@ main(int argc, char *argv[]) sigaction(SIGSEGV, &nsa, NULL); #endif strcpy(uss_whoami, argv[0]); - yyin = NULL; + uss_yyin = NULL; uss_fs_InBuff = malloc(USS_FS_MAX_SIZE); /*Cache Manager input buff */ uss_fs_OutBuff = malloc(USS_FS_MAX_SIZE); /*Cache Manager output buff */ diff --git a/src/uss/yy-lsed b/src/uss/yy-lsed new file mode 100644 index 0000000..65a98cf --- /dev/null +++ b/src/uss/yy-lsed @@ -0,0 +1,36 @@ +s/yyback/uss_yyback/g +s/yybgin/uss_yybgin/g +s/yycrank/uss_yycrank/g +s/yyerror/uss_yyerror/g +s/yyestate/uss_yyestate/g +s/yyextra/uss_yyextra/g +s/yyfnd/uss_yyfnd/g +s/yyin/uss_yyin/g +s/yyinput/uss_yyinput/g +s/yyleng/uss_yyleng/g +s/yylex/uss_yylex/g +s/yylineno/uss_yylineno/g +s/yylook/uss_yylook/g +s/yylsp/uss_yylsp/g +s/yylstate/uss_yylstate/g +s/yytext/uss_yytext/g +s/yylval/uss_yylval/g +s/yymatch/uss_yymatch/g +s/yymorfg/uss_yymorfg/g +s/yyolsp/uss_yyolsp/g +s/yyout/uss_yyout/g +s/yyoutput/uss_yyoutput/g +s/yyprevious/uss_yyprevious/g +s/yysbuf/uss_yysbuf/g +s/yysptr/uss_yysptr/g +s/yysvec/uss_yysvec/g +s/yytchar/uss_yytchar/g +s/yytop/uss_yytop/g +s/yyunput/uss_yyunput/g +s/yyvstop/uss_yyvstop/g +s/yywrap/uss_yywrap/g +s/yyracc/uss_yyracc/g +s/yyreject/uss_yyreject/g +s/yywoutput/uss_yywoutput/g +s/yywinput/uss_yywinput/g +s/yyless/uss_yyless/g