* Add a call to stat() to check for the existance of the cached
authorhartwick <hartwick>
Sun, 29 Oct 2000 18:53:28 +0000 (18:53 +0000)
committerhartwick <hartwick>
Sun, 29 Oct 2000 18:53:28 +0000 (18:53 +0000)
  directory name.

src/modules/rlm_detail/rlm_detail.c

index 882d87f..77bdfe2 100644 (file)
@@ -112,6 +112,7 @@ static int detail_accounting(void *instance, REQUEST *request)
        uint32_t        nas;
        NAS             *cl;
        int             ret = RLM_MODULE_OK;
+       struct stat     st;
 
        struct detail_instance *inst = instance;
 
@@ -186,9 +187,13 @@ static int detail_accounting(void *instance, REQUEST *request)
                 *
                 *      OR the new directory name is different than the old,
                 *      so we've got to create a new one.
+                *
+                *      OR the cached directory has somehow gotten removed,
+                *      so we've got to create a new one.
                 */
                if ((inst->last_made_directory == NULL) ||
-                   (strcmp(inst->last_made_directory, buffer) != 0)) {
+                   (strcmp(inst->last_made_directory, buffer) != 0) ||
+                   (stat(buffer, &st) == -1)) {
                        
                        /*
                         *      Free any previously cached name.