parse_ldif(struct sudoers_parse_tree *parse_tree, const char *input_file,
struct cvtsudoers_config *conf)
{
- FILE *fp;
+ FILE *fp = stdin;
debug_decl(parse_ldif, SUDOERS_DEBUG_UTIL)
/* Open LDIF file and parse it. */
- if (strcmp(input_file, "-") == 0) {
- fp = stdin;
- input_file = "stdin";
- } else if ((fp = fopen(input_file, "r")) == NULL)
- sudo_fatal(U_("unable to open %s"), input_file);
+ if (strcmp(input_file, "-") != 0) {
+ if ((fp = fopen(input_file, "r")) == NULL)
+ sudo_fatal(U_("unable to open %s"), input_file);
+ }
debug_return_bool(sudoers_parse_ldif(parse_tree, fp, conf->sudoers_base,
- conf->store_options));
+ conf->store_options));
}
static bool