| 230 | } |
| 231 | |
| 232 | static bool canonical_cache_path(const char *cache, char out[SETTINGS_PATH_CAP], bool create) { |
| 233 | if (!cache || !cache[0]) |
| 234 | return false; |
| 235 | bool ready = cbm_canonical_path(cache, out, SETTINGS_PATH_CAP); |
| 236 | if (!ready && create && cbm_mkdir_p(cache, 0700)) |
| 237 | ready = cbm_canonical_path(cache, out, SETTINGS_PATH_CAP); |
| 238 | if (!ready || !cbm_is_dir(out)) |
| 239 | return false; |
| 240 | cbm_normalize_path_sep(out); |
| 241 | return cbm_daemon_ipc_private_directory_secure(out); |
| 242 | } |
| 243 | |
| 244 | static sqlite3 *settings_open(const char *cache) { |
| 245 | if (!cache || !cache[0] || strlen(cache) + 12 >= SETTINGS_PATH_CAP) |
no test coverage detected