diff options
author | наб <[email protected]> | 2022-04-19 20:38:30 +0200 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2022-06-29 14:08:54 -0700 |
commit | a926aab902ac5c680f4766568d19674b80fb58bb (patch) | |
tree | 2f505528a4dea156b50c5602dbcefe48b9e902d7 /lib/libzfs/libzfs_crypto.c | |
parent | e7d90362e5d5f873e1272519da96780cf00a0e28 (diff) |
Enable -Wwrite-strings
Also, fix leak from ztest_global_vars_to_zdb_args()
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Closes #13348
Diffstat (limited to 'lib/libzfs/libzfs_crypto.c')
-rw-r--r-- | lib/libzfs/libzfs_crypto.c | 7 |
1 files changed, 4 insertions, 3 deletions
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); |