Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src When using the top secret PUFFS_COMFD model, write out size ...
details: https://anonhg.NetBSD.org/src/rev/92f10bae8441
branches: trunk
changeset: 756079:92f10bae8441
user: pooka <pooka%NetBSD.org@localhost>
date: Tue Jul 06 13:27:16 2010 +0000
description:
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.
diffstat:
lib/libpuffs/puffs.c | 10 +++++-----
usr.sbin/puffs/rump_syspuffs/rump_syspuffs.c | 4 +++-
2 files changed, 8 insertions(+), 6 deletions(-)
diffs (65 lines):
diff -r 796afeb02a86 -r 92f10bae8441 lib/libpuffs/puffs.c
--- a/lib/libpuffs/puffs.c Tue Jul 06 12:28:40 2010 +0000
+++ b/lib/libpuffs/puffs.c Tue Jul 06 13:27:16 2010 +0000
@@ -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
diff -r 796afeb02a86 -r 92f10bae8441 usr.sbin/puffs/rump_syspuffs/rump_syspuffs.c
--- a/usr.sbin/puffs/rump_syspuffs/rump_syspuffs.c Tue Jul 06 12:28:40 2010 +0000
+++ b/usr.sbin/puffs/rump_syspuffs/rump_syspuffs.c Tue Jul 06 13:27:16 2010 +0000
@@ -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))
Home |
Main Index |
Thread Index |
Old Index