Skip to content

Commit 4cba261

Browse files
committed
trivial: Skip sysconfpkdir files that get EPERM
Fixes half of #26
1 parent be31a61 commit 4cba261

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

‎src/passim-server.c‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,17 @@ passim_server_sysconfpkgdir_scan_path(PassimServer *self, const gchar *path, GEr
303303
return FALSE;
304304
while ((fn = g_dir_read_name(dir)) != NULL) {
305305
g_autofree gchar *fn_tmp = g_build_filename(path, fn, NULL);
306-
if (!passim_server_sysconfpkgdir_add(self, fn_tmp, error))
306+
g_autoptr(GError) error_local = NULL;
307+
if (!passim_server_sysconfpkgdir_add(self, fn_tmp, &error_local)) {
308+
if (g_error_matches(error_local,
309+
G_IO_ERROR,
310+
G_IO_ERROR_PERMISSION_DENIED)) {
311+
g_info("skipping %s as EPERM", fn_tmp);
312+
continue;
313+
}
314+
g_propagate_error(error, g_steal_pointer(&error_local));
307315
return FALSE;
316+
}
308317
}
309318
return TRUE;
310319
}

0 commit comments

Comments
 (0)