diff options
author | sjg <sjg@FreeBSD.org> | 2013-04-12 20:48:55 +0000 |
---|---|---|
committer | sjg <sjg@FreeBSD.org> | 2013-04-12 20:48:55 +0000 |
commit | 97d8b9495668afa398ab17c8c5f7e223b5fd2e89 (patch) | |
tree | 54038c9ac32a45f8741dcc23fb9a8ffc0e15ff89 /sbin/geom/class | |
parent | 5ee3bfdb338e7c80af29a67f4425c4be24c7b866 (diff) | |
parent | 086d73aef6d0ab7d21daa2076fdc8d25961f9b05 (diff) | |
download | FreeBSD-src-97d8b9495668afa398ab17c8c5f7e223b5fd2e89.zip FreeBSD-src-97d8b9495668afa398ab17c8c5f7e223b5fd2e89.tar.gz |
sync from head
Diffstat (limited to 'sbin/geom/class')
-rw-r--r-- | sbin/geom/class/concat/gconcat.8 | 4 | ||||
-rw-r--r-- | sbin/geom/class/eli/geli.8 | 2 | ||||
-rw-r--r-- | sbin/geom/class/eli/geom_eli.c | 37 | ||||
-rw-r--r-- | sbin/geom/class/mirror/gmirror.8 | 4 | ||||
-rw-r--r-- | sbin/geom/class/part/gpart.8 | 29 | ||||
-rw-r--r-- | sbin/geom/class/raid/graid.8 | 10 | ||||
-rw-r--r-- | sbin/geom/class/stripe/gstripe.8 | 7 |
7 files changed, 27 insertions, 66 deletions
diff --git a/sbin/geom/class/concat/gconcat.8 b/sbin/geom/class/concat/gconcat.8 index 2e1b79d..b797a1c 100644 --- a/sbin/geom/class/concat/gconcat.8 +++ b/sbin/geom/class/concat/gconcat.8 @@ -183,11 +183,11 @@ growfs /dev/concat/data .Xr loader.conf 5 , .Xr geom 8 , .Xr growfs 8 , +.Xr gvinum 8 , .Xr mount 8 , .Xr newfs 8 , .Xr sysctl 8 , -.Xr umount 8 , -.Xr vinum 8 +.Xr umount 8 .Sh HISTORY The .Nm diff --git a/sbin/geom/class/eli/geli.8 b/sbin/geom/class/eli/geli.8 index 3cb1f21..263b8b2 100644 --- a/sbin/geom/class/eli/geli.8 +++ b/sbin/geom/class/eli/geli.8 @@ -970,7 +970,7 @@ Enter passphrase: supports two encryption modes: .Nm XTS , which was standardized as -.Nm IEE P1619 +.Nm IEEE P1619 and .Nm CBC with unpredictable IV. diff --git a/sbin/geom/class/eli/geom_eli.c b/sbin/geom/class/eli/geom_eli.c index f209800..3eee6f2 100644 --- a/sbin/geom/class/eli/geom_eli.c +++ b/sbin/geom/class/eli/geom_eli.c @@ -259,6 +259,8 @@ struct g_command class_commands[] = { static int verbose = 0; +#define BUFSIZE 1024 + static int eli_protect(struct gctl_req *req) { @@ -326,22 +328,6 @@ eli_main(struct gctl_req *req, unsigned int flags) gctl_error(req, "Unknown command: %s.", name); } -static void -arc4rand(unsigned char *buf, size_t size) -{ - uint32_t *buf4; - size_t size4; - unsigned int i; - - buf4 = (uint32_t *)buf; - size4 = size / 4; - - for (i = 0; i < size4; i++) - buf4[i] = arc4random(); - for (i *= 4; i < size; i++) - buf[i] = arc4random() % 0xff; -} - static bool eli_is_attached(const char *prov) { @@ -360,7 +346,7 @@ static int eli_genkey_files(struct gctl_req *req, bool new, const char *type, struct hmac_ctx *ctxp, char *passbuf, size_t passbufsize) { - char *p, buf[MAXPHYS], argname[16]; + char *p, buf[BUFSIZE], argname[16]; const char *file; int error, fd, i; ssize_t done; @@ -396,6 +382,8 @@ eli_genkey_files(struct gctl_req *req, bool new, const char *type, while ((done = read(fd, buf, sizeof(buf))) > 0) g_eli_crypto_hmac_update(ctxp, buf, done); } else /* if (strcmp(type, "passfile") == 0) */ { + assert(strcmp(type, "passfile") == 0); + while ((done = read(fd, buf, sizeof(buf) - 1)) > 0) { buf[done] = '\0'; p = strchr(buf, '\n'); @@ -445,7 +433,7 @@ eli_genkey_passphrase_prompt(struct gctl_req *req, bool new, char *passbuf, } if (new) { - char tmpbuf[BUFSIZ]; + char tmpbuf[BUFSIZE]; p = readpassphrase("Reenter new passphrase: ", tmpbuf, sizeof(tmpbuf), @@ -474,7 +462,7 @@ static int eli_genkey_passphrase(struct gctl_req *req, struct g_eli_metadata *md, bool new, struct hmac_ctx *ctxp) { - char passbuf[MAXPHYS]; + char passbuf[BUFSIZE]; bool nopassphrase; int nfiles; @@ -813,8 +801,8 @@ eli_init(struct gctl_req *req) } md.md_keys = 0x01; - arc4rand(md.md_salt, sizeof(md.md_salt)); - arc4rand(md.md_mkeys, sizeof(md.md_mkeys)); + arc4random_buf(md.md_salt, sizeof(md.md_salt)); + arc4random_buf(md.md_mkeys, sizeof(md.md_mkeys)); /* Generate user key. */ if (eli_genkey(req, &md, key, true) == NULL) { @@ -1146,7 +1134,7 @@ eli_delkey_detached(struct gctl_req *req, const char *prov) all = gctl_get_int(req, "all"); if (all) - arc4rand(md.md_mkeys, sizeof(md.md_mkeys)); + arc4random_buf(md.md_mkeys, sizeof(md.md_mkeys)); else { force = gctl_get_int(req, "force"); val = gctl_get_intmax(req, "keyno"); @@ -1170,7 +1158,7 @@ eli_delkey_detached(struct gctl_req *req, const char *prov) return; } mkeydst = md.md_mkeys + nkey * G_ELI_MKEYLEN; - arc4rand(mkeydst, G_ELI_MKEYLEN); + arc4random_buf(mkeydst, G_ELI_MKEYLEN); } eli_metadata_store(req, prov, &md); @@ -1262,13 +1250,14 @@ eli_trash_metadata(struct gctl_req *req, const char *prov, int fd, off_t offset) error = 0; do { - arc4rand(sector, size); + arc4random_buf(sector, size); if (pwrite(fd, sector, size, offset) != size) { if (error == 0) error = errno; } (void)g_flush(fd); } while (--overwrites > 0); + free(sector); if (error != 0) { gctl_error(req, "Cannot trash metadata on provider %s: %s.", prov, strerror(error)); diff --git a/sbin/geom/class/mirror/gmirror.8 b/sbin/geom/class/mirror/gmirror.8 index baaa827..58ff8af 100644 --- a/sbin/geom/class/mirror/gmirror.8 +++ b/sbin/geom/class/mirror/gmirror.8 @@ -340,11 +340,11 @@ there. .Xr geom 4 , .Xr dumpon 8 , .Xr geom 8 , +.Xr gvinum 8 , .Xr mount 8 , .Xr newfs 8 , .Xr savecore 8 , -.Xr umount 8 , -.Xr vinum 8 +.Xr umount 8 .Sh HISTORY The .Nm diff --git a/sbin/geom/class/part/gpart.8 b/sbin/geom/class/part/gpart.8 index 8843e53..7386900 100644 --- a/sbin/geom/class/part/gpart.8 +++ b/sbin/geom/class/part/gpart.8 @@ -31,33 +31,6 @@ .Nm gpart .Nd "control utility for the disk partitioning GEOM class" .Sh SYNOPSIS -To add support for the disk partitioning GEOM class, -place one or more of the following -lines in the kernel configuration file: -.Bd -ragged -offset indent -.Cd "options GEOM_PART_APM" -.Cd "options GEOM_PART_BSD" -.Cd "options GEOM_PART_GPT" -.Cd "options GEOM_PART_LDM" -.Cd "options GEOM_PART_MBR" -.Cd "options GEOM_PART_EBR" -.Cd "options GEOM_PART_EBR_COMPAT" -.Cd "options GEOM_PART_PC98" -.Cd "options GEOM_PART_VTOC8" -.Ed -.Pp -These options provide support for the various types of partitioning -schemes supported by the -.Ns Nm -utility. -See -.Sx "PARTITIONING SCHEMES" -below for more details. -.Pp -Usage of the -.Ns Nm -utility: -.Pp .\" ==== ADD ==== .Nm .Cm add @@ -583,7 +556,7 @@ The system partition for computers that use the Extensible Firmware Interface (EFI). In such cases, the GPT partitioning scheme is used and the actual partition type for the system partition can also be specified as -.Qq Li "!c12a7328-f81f-11d2-ba4b-00a0c93ec93ab" . +.Qq Li "!c12a7328-f81f-11d2-ba4b-00a0c93ec93b" . .It Cm freebsd A .Fx diff --git a/sbin/geom/class/raid/graid.8 b/sbin/geom/class/raid/graid.8 index ed33e00..47d7fa2 100644 --- a/sbin/geom/class/raid/graid.8 +++ b/sbin/geom/class/raid/graid.8 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 16, 2013 +.Dd April 4, 2013 .Dt GRAID 8 .Os .Sh NAME @@ -242,8 +242,7 @@ RAID5 (3+ disks), RAID10 (4+ disks), SINGLE (1 disk), CONCAT (2+ disks). Configurations not supported by NVIDIA MediaShield RAID BIOS, but enforceable on your own risk: RAID1 (3+ disks). .It Promise -The format used by Promise and AMD/ATI RAID BIOSes and FreeBSD ataraid(4) -driver. +The format used by Promise and AMD/ATI RAID BIOSes. Supports multiple volumes per array. Each disk can be split to be used by up to two arbitrary volumes. Supports configurations: RAID0 (2+ disks), RAID1 (2 disks), @@ -305,13 +304,16 @@ Write errors are always considered as disk failures. Time to wait for missing array components on startup. .It Va kern.geom.raid. Ns Ar X Ns Va .enable : No 1 Enable taste for specific metadata or transformation module. +.It Va kern.geom.raid.legacy_aliases : No 0 +Enable geom raid emulation of legacy /dev/ar%d devices. +This should aid the upgrade of systems from legacy to modern releases. .El .Sh EXIT STATUS Exit status is 0 on success, and non-zero if the command fails. .Sh SEE ALSO .Xr geom 4 , .Xr geom 8 , -.Xr vinum 8 +.Xr gvinum 8 .Sh HISTORY The .Nm diff --git a/sbin/geom/class/stripe/gstripe.8 b/sbin/geom/class/stripe/gstripe.8 index ee70184..33ef30b 100644 --- a/sbin/geom/class/stripe/gstripe.8 +++ b/sbin/geom/class/stripe/gstripe.8 @@ -213,8 +213,6 @@ The interleave is in number of bytes, unlike .Xr ccdconfig 8 -and -.Xr atacontrol 8 which use the number of sectors. A .Xr ccdconfig 8 @@ -229,14 +227,13 @@ for .Sh SEE ALSO .Xr geom 4 , .Xr loader.conf 5 , -.Xr atacontrol 8 , .Xr ccdconfig 8 , .Xr geom 8 , +.Xr gvinum 8 , .Xr mount 8 , .Xr newfs 8 , .Xr sysctl 8 , -.Xr umount 8 , -.Xr vinum 8 +.Xr umount 8 .Sh HISTORY The .Nm |