From db084676e5ad7456fe2e313673db3a358925c8d7 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sat, 16 Jun 2007 11:31:56 +0000 Subject: [PATCH] Remove an duplicate lock_file() call and add a comment. --- visudo.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/visudo.c b/visudo.c index b05dc1af4..5d8b6bae0 100644 --- a/visudo.c +++ b/visudo.c @@ -205,8 +205,6 @@ main(argc, argv) */ if ((yyin = open_sudoers(sudoers_path, NULL)) == NULL) error(1, "%s", sudoers_path); - if (!lock_file(fileno(yyin), SUDO_TLOCK)) - errorx(1, "%s busy, try again later", sudoers_path); init_parser(sudoers_path, 0); yyparse(); (void) update_defaults(SKIP_CMND); @@ -700,6 +698,10 @@ check_syntax(sudoers_path, quiet) return(parse_error == TRUE); } +/* + * Used to open (and lock) the initial sudoers file and to also open + * any subsequent files #included via a callback from the parser. + */ FILE * open_sudoers(path, keepopen) const char *path; -- 2.50.1