File tree 1 file changed +9
-2
lines changed
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -210,7 +210,7 @@ static void
210
210
parseconfdir (const char * dirpath , int checkperms )
211
211
{
212
212
struct dirent * * dirent_table ;
213
- int i , dirent_count ;
213
+ int i , m , dirent_count ;
214
214
char pathbuf [PATH_MAX ];
215
215
216
216
if (!isconfdir (dirpath ))
@@ -222,7 +222,7 @@ parseconfdir(const char *dirpath, int checkperms)
222
222
err (1 , checkperms ? "doas is not enabled, %s" :
223
223
"could not open config directory %s" , dirpath );
224
224
225
- for (i = 0 ; i < dirent_count ; i ++ )
225
+ for (i = 0 , m = 0 ; i < dirent_count ; i ++ )
226
226
{
227
227
struct stat sb ;
228
228
size_t pathlen ;
@@ -244,9 +244,16 @@ parseconfdir(const char *dirpath, int checkperms)
244
244
continue ;
245
245
246
246
parseconfig (pathbuf , checkperms );
247
+ m ++ ;
247
248
}
248
249
249
250
free (dirent_table );
251
+
252
+ if (!m ) {
253
+ fprintf (stderr , "doas is not enabled, %s: no matching configuration files found\n" ,
254
+ dirpath );
255
+ exit (1 );
256
+ }
250
257
}
251
258
#endif
252
259
You can’t perform that action at this time.
0 commit comments