]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
hoist error earlier
authorAlan T. DeKok <aland@freeradius.org>
Tue, 5 Mar 2024 12:54:23 +0000 (07:54 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 5 Mar 2024 12:54:58 +0000 (07:54 -0500)
src/lib/bio/fd_open.c

index 4c7bb11b4e1791b4669f9b53c4bf85f1fadbdeeb..30cd9bfb43865cae1cbfbd52312a925c3e76349f 100644 (file)
@@ -744,6 +744,11 @@ int fr_bio_fd_open(fr_bio_t *bio, fr_bio_fd_config_t const *cfg)
                }
 
        } else {
+               if (cfg->type != FR_BIO_FD_CONNECTED) {
+                       fr_strerror_printf("Can only use connected sockets for file IO");
+                       return -1;
+               }
+
                /*
                 *      Filenames overload the #fr_socket_t for now.
                 */