From: Alan T. DeKok Date: Fri, 6 Dec 2024 15:40:13 +0000 (-0500) Subject: might as well read from stdin X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a82d47a316e0493a77a3b70d98e47e693ab80c8d;p=thirdparty%2Ffreeradius-server.git might as well read from stdin --- diff --git a/src/lib/bio/fd_open.c b/src/lib/bio/fd_open.c index 149a96cf604..86cfd726a5f 100644 --- a/src/lib/bio/fd_open.c +++ b/src/lib/bio/fd_open.c @@ -880,6 +880,14 @@ int fr_bio_fd_open(fr_bio_t *bio, fr_bio_fd_config_t const *cfg) fd = dup(STDERR_FILENO); + } else if (strcmp(cfg->filename, "/dev/stdin") == 0) { + if (cfg->flags != O_RDONLY) { + fr_strerror_printf("Cannot write to %s", cfg->filename); + return -1; + } + + fd = dup(STDIN_FILENO); + } else { /* * Minor hacks so that we have only _one_ source of open / mkdir