From ee34459918e9cf13e4840cef3ebcc8df7fa218bf Mon Sep 17 00:00:00 2001 From: pjd Date: Mon, 18 Mar 2013 21:11:31 +0000 Subject: Reduce stack usage. --- sbin/geom/class/eli/geom_eli.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sbin') diff --git a/sbin/geom/class/eli/geom_eli.c b/sbin/geom/class/eli/geom_eli.c index 1ed72b11..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) { @@ -344,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; @@ -431,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), @@ -460,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; -- cgit v1.1