diff --git a/usr.sbin/perfused/msg.c b/usr.sbin/perfused/msg.c index 77d2f1aa0098..a3bf0267efd5 100644 --- a/usr.sbin/perfused/msg.c +++ b/usr.sbin/perfused/msg.c @@ -1,4 +1,4 @@ -/* $NetBSD: msg.c,v 1.6 2010/09/15 01:51:44 manu Exp $ */ +/* $NetBSD: msg.c,v 1.7 2010/09/20 06:45:38 manu Exp $ */ /*- * Copyright (c) 2010 Emmanuel Dreyfus. All rights reserved. @@ -483,7 +483,6 @@ perfuse_readframe(pu, pufbuf, fd, done) #if (PERFUSE_SOCKTYPE == SOCK_DGRAM) peek = MSG_PEEK; #endif - offset = puffs_framebuf_telloff(pufbuf); /* @@ -509,6 +508,11 @@ perfuse_readframe(pu, pufbuf, fd, done) /* NOTREACHED */ break; default: +#if defined(PERFUSE_DEBUG) && (PERFUSE_SOCKTYPE == SOCK_DGRAM) + if (readen != remain) + DERRX(EX_SOFTWARE, "%s: short recv %zd/%zd", + __func__, readen, remain); +#endif break; } @@ -566,6 +570,11 @@ perfuse_readframe(pu, pufbuf, fd, done) /* NOTREACHED */ break; default: +#if defined(PERFUSE_DEBUG) && (PERFUSE_SOCKTYPE == SOCK_DGRAM) + if (readen != remain) + DERRX(EX_SOFTWARE, "%s: short recv %zd/%zd", + __func__, readen, remain); +#endif break; } @@ -615,6 +624,11 @@ perfuse_writeframe(pu, pufbuf, fd, done) /* NOTREACHED */ break; default: +#if defined(PERFUSE_DEBUG) && (PERFUSE_SOCKTYPE == SOCK_DGRAM) + if (written != remain) + DERRX(EX_SOFTWARE, "%s: short send %zd/%zd", + __func__, written, remain); +#endif break; } diff --git a/usr.sbin/perfused/perfused.c b/usr.sbin/perfused/perfused.c index 768b87a925c1..9c6b7692c5c0 100644 --- a/usr.sbin/perfused/perfused.c +++ b/usr.sbin/perfused/perfused.c @@ -1,4 +1,4 @@ -/* $NetBSD: perfused.c,v 1.8 2010/09/15 01:51:44 manu Exp $ */ +/* $NetBSD: perfused.c,v 1.9 2010/09/20 06:45:38 manu Exp $ */ /*- * Copyright (c) 2010 Emmanuel Dreyfus. All rights reserved. @@ -100,6 +100,7 @@ get_mount_info(fd, pmi) { struct perfuse_mount_out *pmo; struct sockcred cred; + int opt; char *cp; char *source = NULL; char *target = NULL; @@ -117,6 +118,13 @@ get_mount_info(fd, pmi) exit(EX_PROTOCOL); } + /* + * We do not need peer creds beyond this point + */ + opt = 0; + if (setsockopt(fd, 0, LOCAL_CREDS, &opt, sizeof(opt)) != 0) + DWARN("%s: setsockopt LOCAL_CREDS failed", __func__); + #ifdef PERFUSE_DEBUG if (perfuse_diagflags & PDF_MISC) DPRINTF("perfuse lengths: source = %"PRId32", "