]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
might as well read from stdin
authorAlan T. DeKok <aland@freeradius.org>
Fri, 6 Dec 2024 15:40:13 +0000 (10:40 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 7 Dec 2024 14:36:48 +0000 (09:36 -0500)
src/lib/bio/fd_open.c

index 149a96cf6044de3aaa57ec7ba88560ed91637bfb..86cfd726a5f126ea50ba337bfc078b40df77870d 100644 (file)
@@ -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