MCPcopy Create free account
hub / github.com/F-Stack/f-stack / dumper_config_match

Function dumper_config_match

freebsd/kern/kern_shutdown.c:1287–1323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1285#endif
1286
1287static bool
1288dumper_config_match(const struct dumperinfo *di, const char *devname,
1289 const struct diocskerneldump_arg *kda)
1290{
1291 if (kda->kda_index == KDA_REMOVE_ALL)
1292 return (true);
1293
1294 if (strcmp(di->di_devname, devname) != 0)
1295 return (false);
1296
1297 /*
1298 * Allow wildcard removal of configs matching a device on g_dev_orphan.
1299 */
1300 if (kda->kda_index == KDA_REMOVE_DEV)
1301 return (true);
1302
1303 if (di->kdcomp != NULL) {
1304 if (di->kdcomp->kdc_format != kda->kda_compression)
1305 return (false);
1306 } else if (kda->kda_compression != KERNELDUMP_COMP_NONE)
1307 return (false);
1308#ifdef EKCD
1309 if (di->kdcrypto != NULL) {
1310 if (di->kdcrypto->kdc_encryption != kda->kda_encryption)
1311 return (false);
1312 /*
1313 * Do we care to verify keys match to delete? It seems weird
1314 * to expect multiple fallback dump configurations on the same
1315 * device that only differ in crypto key.
1316 */
1317 } else
1318#endif
1319 if (kda->kda_encryption != KERNELDUMP_ENC_NONE)
1320 return (false);
1321
1322 return (true);
1323}
1324
1325int
1326dumper_remove(const char *devname, const struct diocskerneldump_arg *kda)

Callers 1

dumper_removeFunction · 0.85

Calls 1

strcmpFunction · 0.85

Tested by

no test coverage detected