about summary refs log tree commit diff
path: root/src/usr.bin
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2015-01-28 14:31:09 +0100
committerChristian Neukirchen <chneukirchen@gmail.com>2015-01-28 14:31:09 +0100
commitc9c371ec3ea85f25cfa5d31144689940d1f769a7 (patch)
tree2aaf464de6ec0b7125af26271ba8b25d6e13fa5d /src/usr.bin
parentcaa03bd0b43a89dcc93397182dc969417f09ba7c (diff)
downloadoutils-c9c371ec3ea85f25cfa5d31144689940d1f769a7.tar.gz
outils-c9c371ec3ea85f25cfa5d31144689940d1f769a7.tar.xz
outils-c9c371ec3ea85f25cfa5d31144689940d1f769a7.zip
cvs update
Diffstat (limited to 'src/usr.bin')
-rw-r--r--src/usr.bin/lam/lam.c4
-rw-r--r--src/usr.bin/lndir/lndir.c8
-rw-r--r--src/usr.bin/signify/signify.16
-rw-r--r--src/usr.bin/signify/signify.c17
4 files changed, 20 insertions, 15 deletions
diff --git a/src/usr.bin/lam/lam.c b/src/usr.bin/lam/lam.c
index ebdec7a..268998e 100644
--- a/src/usr.bin/lam/lam.c
+++ b/src/usr.bin/lam/lam.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: lam.c,v 1.16 2013/11/20 21:22:17 deraadt Exp $	*/
+/*	$OpenBSD: lam.c,v 1.17 2015/01/16 06:40:09 deraadt Exp $	*/
 /*	$NetBSD: lam.c,v 1.2 1994/11/14 20:27:42 jtc Exp $	*/
 
 /*-
@@ -35,7 +35,7 @@
  *	Author:  John Kunze, UCB
  */
 
-#include <sys/param.h>
+#include <sys/param.h>	/* NOFILE_MAX */
 
 #include <ctype.h>
 #include <err.h>
diff --git a/src/usr.bin/lndir/lndir.c b/src/usr.bin/lndir/lndir.c
index bdc5e78..42ed8e0 100644
--- a/src/usr.bin/lndir/lndir.c
+++ b/src/usr.bin/lndir/lndir.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: lndir.c,v 1.20 2014/05/20 01:25:23 guenther Exp $	*/
+/*	$OpenBSD: lndir.c,v 1.21 2015/01/16 06:40:09 deraadt Exp $	*/
 /* $XConsortium: lndir.c /main/15 1995/08/30 10:56:18 gildea $ */
 
 /*
@@ -47,7 +47,6 @@ in this Software without prior written authorization from the X Consortium.
 	%  lndir ../X
 */
 
-#include <sys/param.h>
 #include <sys/stat.h>
 
 #include <dirent.h>
@@ -58,6 +57,7 @@ in this Software without prior written authorization from the X Consortium.
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#include <limits.h>
 
 extern char *__progname;
 
@@ -179,8 +179,8 @@ addexcept(char *name)
 int
 dodir(char *fn, struct stat *fs, struct stat *ts, int rel)
 {
-	char buf[MAXPATHLEN + 1], symbuf[MAXPATHLEN + 1];
-	char basesym[MAXPATHLEN + 1];
+	char buf[PATH_MAX + 1], symbuf[PATH_MAX + 1];
+	char basesym[PATH_MAX + 1];
 	int n_dirs, symlen, basesymlen = -1;
 	struct stat sb, sc;
 	struct except *cur;
diff --git a/src/usr.bin/signify/signify.1 b/src/usr.bin/signify/signify.1
index 5ffe509..b2ac679 100644
--- a/src/usr.bin/signify/signify.1
+++ b/src/usr.bin/signify/signify.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: signify.1,v 1.29 2015/01/07 10:29:22 florian Exp $
+.\" $OpenBSD: signify.1,v 1.30 2015/01/20 20:50:36 tedu Exp $
 .\"
 .\"Copyright (c) 2013 Marc Espie <espie@openbsd.org>
 .\"Copyright (c) 2013 Ted Unangst <tedu@openbsd.org>
@@ -14,7 +14,7 @@
 .\"WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 .\"ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 .\"OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-.Dd $Mdocdate: January 7 2015 $
+.Dd $Mdocdate: January 20 2015 $
 .Dt SIGNIFY 1
 .Os
 .Sh NAME
@@ -164,3 +164,5 @@ The
 .Nm
 command first appeared in
 .Ox 5.5 .
+.Sh AUTHORS
+.An Ted Unangst Aq Mt tedu@openbsd.org
diff --git a/src/usr.bin/signify/signify.c b/src/usr.bin/signify/signify.c
index 7f13eca..06d28da 100644
--- a/src/usr.bin/signify/signify.c
+++ b/src/usr.bin/signify/signify.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: signify.c,v 1.96 2015/01/07 19:53:34 tedu Exp $ */
+/* $OpenBSD: signify.c,v 1.100 2015/01/16 06:16:12 tedu Exp $ */
 /*
  * Copyright (c) 2013 Ted Unangst <tedu@openbsd.org>
  *
@@ -19,6 +19,7 @@
 #include <netinet/in.h>
 #include <resolv.h>
 
+#include <limits.h>
 #include <stdint.h>
 #include <fcntl.h>
 #include <string.h>
@@ -179,7 +180,7 @@ readmsg(const char *filename, unsigned long long *msglenp)
 			errx(1, "msg too large in %s", filename);
 		space = sb.st_size + 1;
 	} else {
-		space = 64 * 1024;
+		space = 64 * 1024 - 1;
 	}
 
 	msg = xmalloc(space + 1);
@@ -507,7 +508,7 @@ verify(const char *pubkeyfile, const char *msgfile, const char *sigfile,
 #ifndef VERIFYONLY
 #define HASHBUFSIZE 224
 struct checksum {
-	char file[1024];
+	char file[PATH_MAX];
 	char hash[HASHBUFSIZE];
 	char algo[32];
 };
@@ -591,11 +592,13 @@ verifychecksums(char *msg, int argc, char **argv, int quiet)
 	while (line && *line) {
 		if ((endline = strchr(line, '\n')))
 			*endline++ = '\0';
-		rv = sscanf(line, "%31s (%1023s = %223s",
+#if PATH_MAX < 1024 || HASHBUFSIZE < 224
+#error sizes are wrong
+#endif
+		rv = sscanf(line, "%31s (%1023[^)]) = %223s",
 		    c.algo, c.file, c.hash);
-		if (rv != 3 || c.file[0] == 0 || c.file[strlen(c.file)-1] != ')')
+		if (rv != 3)
 			errx(1, "unable to parse checksum line %s", line);
-		c.file[strlen(c.file) - 1] = '\0';
 		line = endline;
 		if (argc) {
 			slot = ohash_qlookup(&myh, c.file);
@@ -647,7 +650,7 @@ main(int argc, char **argv)
 {
 	const char *pubkeyfile = NULL, *seckeyfile = NULL, *msgfile = NULL,
 	    *sigfile = NULL;
-	char sigfilebuf[1024];
+	char sigfilebuf[PATH_MAX];
 	const char *comment = "signify";
 	int ch, rounds;
 	int embedded = 0;