Module Name: src Committed By: thorpej Date: Thu Jun 11 02:28:02 UTC 2020
Modified Files: src/sys/kern: kern_drvctl.c kern_pmf.c kern_veriexec.c Log Message: Update for proplib(3) API changes. To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/sys/kern/kern_drvctl.c cvs rdiff -u -r1.43 -r1.44 src/sys/kern/kern_pmf.c cvs rdiff -u -r1.24 -r1.25 src/sys/kern/kern_veriexec.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/kern/kern_drvctl.c diff -u src/sys/kern/kern_drvctl.c:1.44 src/sys/kern/kern_drvctl.c:1.45 --- src/sys/kern/kern_drvctl.c:1.44 Tue Sep 18 01:25:09 2018 +++ src/sys/kern/kern_drvctl.c Thu Jun 11 02:28:01 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_drvctl.c,v 1.44 2018/09/18 01:25:09 mrg Exp $ */ +/* $NetBSD: kern_drvctl.c,v 1.45 2020/06/11 02:28:01 thorpej Exp $ */ /* * Copyright (c) 2004 @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_drvctl.c,v 1.44 2018/09/18 01:25:09 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_drvctl.c,v 1.45 2020/06/11 02:28:01 thorpej Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -144,7 +144,7 @@ devmon_insert(const char *event, prop_di } /* Fill in mandatory member */ - if (!prop_dictionary_set_cstring_nocopy(ev, "event", event)) { + if (!prop_dictionary_set_string_nocopy(ev, "event", event)) { prop_object_release(ev); mutex_exit(&drvctl_lock); return 0; @@ -468,7 +468,7 @@ drvctl_command_get_properties(struct lwp for (dev = deviter_first(&di, 0); dev != NULL; dev = deviter_next(&di)) { - if (prop_string_equals_cstring(devname_string, + if (prop_string_equals_string(devname_string, device_xname(dev))) { prop_dictionary_set(results_dict, "drvctl-result-data", device_properties(dev)); @@ -527,8 +527,8 @@ drvctl_command(struct lwp *l, struct pli } for (dcd = drvctl_command_table; dcd->dcd_name != NULL; dcd++) { - if (prop_string_equals_cstring(command_string, - dcd->dcd_name)) + if (prop_string_equals_string(command_string, + dcd->dcd_name)) break; } Index: src/sys/kern/kern_pmf.c diff -u src/sys/kern/kern_pmf.c:1.43 src/sys/kern/kern_pmf.c:1.44 --- src/sys/kern/kern_pmf.c:1.43 Tue May 12 10:02:56 2020 +++ src/sys/kern/kern_pmf.c Thu Jun 11 02:28:01 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_pmf.c,v 1.43 2020/05/12 10:02:56 jdolecek Exp $ */ +/* $NetBSD: kern_pmf.c,v 1.44 2020/06/11 02:28:01 thorpej Exp $ */ /*- * Copyright (c) 2007 Jared D. McNeill <jmcne...@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_pmf.c,v 1.43 2020/05/12 10:02:56 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_pmf.c,v 1.44 2020/06/11 02:28:01 thorpej Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -393,7 +393,7 @@ pmf_set_platform(const char *key, const if (pmf_platform == NULL) return false; - return prop_dictionary_set_cstring(pmf_platform, key, value); + return prop_dictionary_set_string(pmf_platform, key, value); } const char * Index: src/sys/kern/kern_veriexec.c diff -u src/sys/kern/kern_veriexec.c:1.24 src/sys/kern/kern_veriexec.c:1.25 --- src/sys/kern/kern_veriexec.c:1.24 Mon Jun 8 20:14:24 2020 +++ src/sys/kern/kern_veriexec.c Thu Jun 11 02:28:01 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_veriexec.c,v 1.24 2020/06/08 20:14:24 thorpej Exp $ */ +/* $NetBSD: kern_veriexec.c,v 1.25 2020/06/11 02:28:01 thorpej Exp $ */ /*- * Copyright (c) 2005, 2006 Elad Efrat <e...@netbsd.org> @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_veriexec.c,v 1.24 2020/06/08 20:14:24 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_veriexec.c,v 1.25 2020/06/11 02:28:01 thorpej Exp $"); #include "opt_veriexec.h" @@ -1064,8 +1064,7 @@ veriexec_file_add(struct lwp *l, prop_di rw_init(&vfe->lock); /* Lookup fingerprint hashing algorithm. */ - fp_type = prop_string_cstring_nocopy(prop_dictionary_get(dict, - "fp-type")); + fp_type = prop_string_value(prop_dictionary_get(dict, "fp-type")); if ((vfe->ops = veriexec_fpops_lookup(fp_type)) == NULL) { log(LOG_ERR, "Veriexec: Invalid or unknown fingerprint type " "`%s' for file `%s'.\n", fp_type, file); @@ -1082,7 +1081,7 @@ veriexec_file_add(struct lwp *l, prop_di } vfe->fp = kmem_alloc(vfe->ops->hash_len, KM_SLEEP); - memcpy(vfe->fp, prop_data_data_nocopy(prop_dictionary_get(dict, "fp")), + memcpy(vfe->fp, prop_data_value(prop_dictionary_get(dict, "fp")), vfe->ops->hash_len); rw_enter(&veriexec_op_lock, RW_WRITER); @@ -1219,7 +1218,7 @@ veriexec_file_convert(struct veriexec_fi prop_dictionary_set(rdict, "fp-type", prop_string_create_copy(vfe->ops->type)); prop_dictionary_set(rdict, "fp", - prop_data_create_data(vfe->fp, vfe->ops->hash_len)); + prop_data_create_copy(vfe->fp, vfe->ops->hash_len)); } int