Fri Oct 29 16:13:51 2010 UTC ()
Make error message more userfriendly in cases where server does
not support sftp.
(pooka)
diff -r1.22 -r1.23 src/usr.sbin/puffs/mount_psshfs/fs.c
diff -r1.61 -r1.62 src/usr.sbin/puffs/mount_psshfs/node.c
diff -r1.61 -r1.62 src/usr.sbin/puffs/mount_psshfs/psshfs.c
--- src/usr.sbin/puffs/mount_psshfs/fs.c 2010/04/01 02:34:09 1.22
+++ src/usr.sbin/puffs/mount_psshfs/fs.c 2010/10/29 16:13:51 1.23
@@ -1,4 +1,4 @@
-/* $NetBSD: fs.c,v 1.22 2010/04/01 02:34:09 pooka Exp $ */
+/* $NetBSD: fs.c,v 1.23 2010/10/29 16:13:51 pooka Exp $ */
/*
* Copyright (c) 2006-2009 Antti Kantee. All Rights Reserved.
@@ -27,7 +27,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: fs.c,v 1.22 2010/04/01 02:34:09 pooka Exp $");
+__RCSID("$NetBSD: fs.c,v 1.23 2010/10/29 16:13:51 pooka Exp $");
#endif /* !lint */
#include <err.h>
@@ -47,8 +47,6 @@
*(a4) = 0; \
rv = fname(a1, a2, a3, a4); \
if (rv || a4 == 0) { \
- fprintf(stderr, "psshfs_handshake failed %d (%s) %d\n", \
- rv, strerror(rv), *a4); \
return rv ? rv : EPROTO; \
} \
} while (/*CONSTCOND*/0)
@@ -82,7 +80,7 @@
NULL,
0
}};
-
+
int
psshfs_handshake(struct puffs_usermount *pu, int fd)
{
--- src/usr.sbin/puffs/mount_psshfs/node.c 2010/04/01 02:34:09 1.61
+++ src/usr.sbin/puffs/mount_psshfs/node.c 2010/10/29 16:13:51 1.62
@@ -1,4 +1,4 @@
-/* $NetBSD: node.c,v 1.61 2010/04/01 02:34:09 pooka Exp $ */
+/* $NetBSD: node.c,v 1.62 2010/10/29 16:13:51 pooka Exp $ */
/*
* Copyright (c) 2006-2009 Antti Kantee. All Rights Reserved.
@@ -27,7 +27,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: node.c,v 1.61 2010/04/01 02:34:09 pooka Exp $");
+__RCSID("$NetBSD: node.c,v 1.62 2010/10/29 16:13:51 pooka Exp $");
#endif /* !lint */
#include <assert.h>
@@ -362,8 +362,9 @@
*ncookies = 0;
rv = sftp_readdir(pu, pctx, pn);
- if (rv)
+ if (rv) {
goto out;
+ }
/* find next dirent */
for (i = *readoff;;i++) {
--- src/usr.sbin/puffs/mount_psshfs/psshfs.c 2010/02/17 15:54:10 1.61
+++ src/usr.sbin/puffs/mount_psshfs/psshfs.c 2010/10/29 16:13:51 1.62
@@ -1,4 +1,4 @@
-/* $NetBSD: psshfs.c,v 1.61 2010/02/17 15:54:10 pooka Exp $ */
+/* $NetBSD: psshfs.c,v 1.62 2010/10/29 16:13:51 pooka Exp $ */
/*
* Copyright (c) 2006-2009 Antti Kantee. All Rights Reserved.
@@ -41,7 +41,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: psshfs.c,v 1.61 2010/02/17 15:54:10 pooka Exp $");
+__RCSID("$NetBSD: psshfs.c,v 1.62 2010/10/29 16:13:51 pooka Exp $");
#endif /* !lint */
#include <sys/types.h>
@@ -415,7 +415,7 @@
}
if (psshfs_handshake(pu, *sshfd) != 0)
- errx(1, "psshfs_handshake %d", which);
+ errx(1, "handshake failed, server does not support sftp?");
x = 1;
if (ioctl(*sshfd, FIONBIO, &x) == -1)
err(1, "nonblocking descriptor %d", which);