summaryrefslogtreecommitdiffstats
path: root/cmd/zpool
diff options
context:
space:
mode:
authorTom Caputi <[email protected]>2017-09-12 16:15:11 -0400
committerTom Caputi <[email protected]>2017-10-11 16:54:48 -0400
commit4807c0badb130ae70cf6f0887b4be1648f217f1a (patch)
treecfc0312e79f82eceda66d142726a122191cea099 /cmd/zpool
parent94d49e8f9bd2e58a783066327c84b7d3b605ac0f (diff)
Encryption patch follow-up
* PBKDF2 implementation changed to OpenSSL implementation. * HKDF implementation moved to its own file and tests added to ensure correctness. * Removed libzfs's now unnecessary dependency on libzpool and libicp. * Ztest can now create and test encrypted datasets. This is currently disabled until issue #6526 is resolved, but otherwise functions as advertised. * Several small bug fixes discovered after enabling ztest to run on encrypted datasets. * Fixed coverity defects added by the encryption patch. * Updated man pages for encrypted send / receive behavior. * Fixed a bug where encrypted datasets could receive DRR_WRITE_EMBEDDED records. * Minor code cleanups / consolidation. Signed-off-by: Tom Caputi <[email protected]>
Diffstat (limited to 'cmd/zpool')
-rw-r--r--cmd/zpool/zpool_main.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c
index 3ffd13c8e..c61639cc2 100644
--- a/cmd/zpool/zpool_main.c
+++ b/cmd/zpool/zpool_main.c
@@ -8049,10 +8049,17 @@ main(int argc, char **argv)
* 'freeze' is a vile debugging abomination, so we treat
* it as such.
*/
- char buf[16384];
- int fd = open(ZFS_DEV, O_RDWR);
- (void) strlcpy((void *)buf, argv[2], sizeof (buf));
- return (!!ioctl(fd, ZFS_IOC_POOL_FREEZE, buf));
+ zfs_cmd_t zc = {"\0"};
+
+ (void) strlcpy(zc.zc_name, argv[2], sizeof (zc.zc_name));
+ ret = zfs_ioctl(g_zfs, ZFS_IOC_POOL_FREEZE, &zc);
+ if (ret != 0) {
+ (void) fprintf(stderr,
+ gettext("failed to freeze pool: %d\n"), errno);
+ ret = 1;
+ }
+
+ log_history = 0;
} else {
(void) fprintf(stderr, gettext("unrecognized "
"command '%s'\n"), cmdname);