Module Name: src Committed By: pooka Date: Tue Jul 6 13:27:17 UTC 2010
Modified Files: src/lib/libpuffs: puffs.c src/usr.sbin/puffs/rump_syspuffs: rump_syspuffs.c Log Message: When using the top secret PUFFS_COMFD model, write out size of the puffs kernel args before the contents. This allows parties which have no clue about the contents to proxy the protocol easily. To generate a diff of this commit: cvs rdiff -u -r1.110 -r1.111 src/lib/libpuffs/puffs.c cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/puffs/rump_syspuffs/rump_syspuffs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libpuffs/puffs.c diff -u src/lib/libpuffs/puffs.c:1.110 src/lib/libpuffs/puffs.c:1.111 --- src/lib/libpuffs/puffs.c:1.110 Mon Jun 7 11:22:36 2010 +++ src/lib/libpuffs/puffs.c Tue Jul 6 13:27:16 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: puffs.c,v 1.110 2010/06/07 11:22:36 pooka Exp $ */ +/* $NetBSD: puffs.c,v 1.111 2010/07/06 13:27:16 pooka Exp $ */ /* * Copyright (c) 2005, 2006, 2007 Antti Kantee. All Rights Reserved. @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #if !defined(lint) -__RCSID("$NetBSD: puffs.c,v 1.110 2010/06/07 11:22:36 pooka Exp $"); +__RCSID("$NetBSD: puffs.c,v 1.111 2010/07/06 13:27:16 pooka Exp $"); #endif /* !lint */ #include <sys/param.h> @@ -556,8 +556,6 @@ rv = -1; goto out; } - - len = strlen(dir)+1; #define allwrite(buf, len) \ do { \ @@ -567,16 +565,18 @@ if (al_rv != -1) \ errno = EIO; \ rv = -1; \ - abort();\ goto out; \ } \ } while (/*CONSTCOND*/0) + len = strlen(dir)+1; allwrite(&len, sizeof(len)); allwrite(dir, len); len = strlen(pu->pu_kargp->pa_mntfromname)+1; allwrite(&len, sizeof(len)); allwrite(pu->pu_kargp->pa_mntfromname, len); allwrite(&mntflags, sizeof(mntflags)); + len = sizeof(*pu->pu_kargp); + allwrite(&len, sizeof(len)); allwrite(pu->pu_kargp, sizeof(*pu->pu_kargp)); allwrite(&pu->pu_flags, sizeof(pu->pu_flags)); #undef allwrite Index: src/usr.sbin/puffs/rump_syspuffs/rump_syspuffs.c diff -u src/usr.sbin/puffs/rump_syspuffs/rump_syspuffs.c:1.10 src/usr.sbin/puffs/rump_syspuffs/rump_syspuffs.c:1.11 --- src/usr.sbin/puffs/rump_syspuffs/rump_syspuffs.c:1.10 Tue Oct 20 02:14:54 2009 +++ src/usr.sbin/puffs/rump_syspuffs/rump_syspuffs.c Tue Jul 6 13:27:16 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: rump_syspuffs.c,v 1.10 2009/10/20 02:14:54 pooka Exp $ */ +/* $NetBSD: rump_syspuffs.c,v 1.11 2010/07/06 13:27:16 pooka Exp $ */ /* * Copyright (c) 2008 Antti Kantee. All Rights Reserved. @@ -139,6 +139,8 @@ err(1, "fn 2"); if (read(sv[1], mntflags, sizeof(*mntflags)) != sizeof(*mntflags)) err(1, "mntflags"); + if (read(sv[1], kargs, sizeof(len)) != sizeof(len)) /* unused now */ + err(1, "unused len"); if (read(sv[1], kargs, sizeof(*kargs)) != sizeof(*kargs)) err(1, "puffs_args"); if (read(sv[1], pflags, sizeof(*pflags)) != sizeof(*pflags))