src/daemon/common.[ch]: add check_capability() function