]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Complain if error isn't ENOENT. Fixes #1398
authorAlan T. DeKok <aland@freeradius.org>
Wed, 25 Nov 2015 16:46:52 +0000 (11:46 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 25 Nov 2015 16:46:52 +0000 (11:46 -0500)
src/main/detail.c

index da522358df84ba52da6c3cd6454eaf61d60973e1..6788838542d6250825e7067670078e25222c1e09 100644 (file)
@@ -203,6 +203,20 @@ static int detail_open(rad_listen_t *this)
         */
        data->fp = NULL;
        data->work_fd = open(data->filename_work, O_RDWR);
+
+       /*
+        *      Couldn't open it for a reason OTHER than "it doesn't
+        *      exist".  Complain and tell the admin.
+        */
+       if ((data->work_fd < 0) && (errno != ENOENT)) {
+               ERROR("Failed opening detail file %s: %s",
+                     data->filename_work, strerror(errno));
+               return 0;
+       }
+
+       /*
+        *      The file doesn't exist.  Poll for it again.
+        */
        if (data->work_fd < 0) {
 #ifndef HAVE_GLOB_H
                return 0;