|
|
@ -131,6 +131,7 @@ FILE *mosquitto__fopen(const char *path, const char *mode, bool restrict_read)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
FILE *fptr;
|
|
|
|
FILE *fptr;
|
|
|
|
|
|
|
|
struct stat statbuf;
|
|
|
|
|
|
|
|
|
|
|
|
if(restrict_read){
|
|
|
|
if(restrict_read){
|
|
|
|
mode_t old_mask;
|
|
|
|
mode_t old_mask;
|
|
|
@ -141,8 +142,8 @@ FILE *mosquitto__fopen(const char *path, const char *mode, bool restrict_read)
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
fptr = fopen(path, mode);
|
|
|
|
fptr = fopen(path, mode);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!fptr) return NULL;
|
|
|
|
|
|
|
|
|
|
|
|
struct stat statbuf;
|
|
|
|
|
|
|
|
if(fstat(fileno(fptr), &statbuf) < 0){
|
|
|
|
if(fstat(fileno(fptr), &statbuf) < 0){
|
|
|
|
fclose(fptr);
|
|
|
|
fclose(fptr);
|
|
|
|
return NULL;
|
|
|
|
return NULL;
|
|
|
|