From: Todd C. Miller Date: Thu, 10 Jun 2010 20:37:52 +0000 (-0400) Subject: Do not override value of keepopen global, instead restore it to the X-Git-Tag: SUDO_1_7_3~89 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=946e17b87e0b612b95abe3deb6bc126b0992b165;p=sudo Do not override value of keepopen global, instead restore it to the value we pushed onto the stack when popping. --HG-- branch : 1.7 --- diff --git a/toke.c b/toke.c index 337c42c90..4875fb098 100644 --- a/toke.c +++ b/toke.c @@ -3539,7 +3539,6 @@ pop_include() if (!keepopen) fclose(YY_CURRENT_BUFFER->yy_input_file); yy_delete_buffer(YY_CURRENT_BUFFER); - keepopen = FALSE; /* If we are in an include dir, move to the next file. */ while ((pl = istack[idepth - 1].more) != NULL) { fp = open_sudoers(pl->path, FALSE, &keepopen); @@ -3564,6 +3563,7 @@ pop_include() efree(sudoers); sudoers = istack[idepth].path; sudolineno = istack[idepth].lineno; + keepopen = istack[idepth].keepopen; } return(TRUE); } diff --git a/toke.l b/toke.l index 4437d7d76..f589f2bd8 100644 --- a/toke.l +++ b/toke.l @@ -918,7 +918,6 @@ pop_include() if (!keepopen) fclose(YY_CURRENT_BUFFER->yy_input_file); yy_delete_buffer(YY_CURRENT_BUFFER); - keepopen = FALSE; /* If we are in an include dir, move to the next file. */ while ((pl = istack[idepth - 1].more) != NULL) { fp = open_sudoers(pl->path, FALSE, &keepopen); @@ -943,6 +942,7 @@ pop_include() efree(sudoers); sudoers = istack[idepth].path; sudolineno = istack[idepth].lineno; + keepopen = istack[idepth].keepopen; } return(TRUE); }