From a926aab902ac5c680f4766568d19674b80fb58bb Mon Sep 17 00:00:00 2001 From: наб Date: Tue, 19 Apr 2022 20:38:30 +0200 Subject: Enable -Wwrite-strings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also, fix leak from ztest_global_vars_to_zdb_args() Reviewed-by: Brian Behlendorf Signed-off-by: Ahelenia Ziemiańska Closes #13348 --- lib/libzfs/libzfs_crypto.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/libzfs/libzfs_crypto.c') diff --git a/lib/libzfs/libzfs_crypto.c b/lib/libzfs/libzfs_crypto.c index 737b3f4dc..c241aeaa4 100644 --- a/lib/libzfs/libzfs_crypto.c +++ b/lib/libzfs/libzfs_crypto.c @@ -849,7 +849,8 @@ encryption_feature_is_enabled(zpool_handle_t *zph) static int populate_create_encryption_params_nvlists(libzfs_handle_t *hdl, zfs_handle_t *zhp, boolean_t newkey, zfs_keyformat_t keyformat, - char *keylocation, nvlist_t *props, uint8_t **wkeydata, uint_t *wkeylen) + const char *keylocation, nvlist_t *props, uint8_t **wkeydata, + uint_t *wkeylen) { int ret; uint64_t iters = 0, salt = 0; @@ -1121,7 +1122,7 @@ zfs_crypto_create(libzfs_handle_t *hdl, char *parent_name, nvlist_t *props, /* default to prompt if no keylocation is specified */ if (keyformat != ZFS_KEYFORMAT_NONE && keylocation == NULL) { - keylocation = "prompt"; + keylocation = (char *)"prompt"; ret = nvlist_add_string(props, zfs_prop_to_name(ZFS_PROP_KEYLOCATION), keylocation); if (ret != 0) @@ -1699,7 +1700,7 @@ zfs_crypto_rewrap(zfs_handle_t *zhp, nvlist_t *raw_props, boolean_t inheritkey) /* default to prompt if no keylocation is specified */ if (keylocation == NULL) { - keylocation = "prompt"; + keylocation = (char *)"prompt"; ret = nvlist_add_string(props, zfs_prop_to_name(ZFS_PROP_KEYLOCATION), keylocation); -- cgit v1.2.3