svn commit: r248475 - head/sbin/geom/class/eli

Pawel Jakub Dawidek pjd at FreeBSD.org
Mon Mar 18 21:11:32 UTC 2013


Author: pjd
Date: Mon Mar 18 21:11:31 2013
New Revision: 248475
URL: http://svnweb.freebsd.org/changeset/base/248475

Log:
  Reduce stack usage.

Modified:
  head/sbin/geom/class/eli/geom_eli.c

Modified: head/sbin/geom/class/eli/geom_eli.c
==============================================================================
--- head/sbin/geom/class/eli/geom_eli.c	Mon Mar 18 20:36:25 2013	(r248474)
+++ head/sbin/geom/class/eli/geom_eli.c	Mon Mar 18 21:11:31 2013	(r248475)
@@ -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
 		}
 
 		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;
 


More information about the svn-src-all mailing list