From owner-freebsd-net@FreeBSD.ORG Fri Jun 30 20:32:18 2006 Return-Path: X-Original-To: net@freebsd.org Delivered-To: freebsd-net@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 02FCE16A412 for ; Fri, 30 Jun 2006 20:32:18 +0000 (UTC) (envelope-from mi+mx@aldan.algebra.com) Received: from zig.murex.com (mail.murex.com [194.98.239.11]) by mx1.FreeBSD.org (Postfix) with ESMTP id 55B8544314; Fri, 30 Jun 2006 20:32:17 +0000 (GMT) (envelope-from mi+mx@aldan.algebra.com) Received: from interscan.fr.murex.com (interscan.fr.murex.com [172.21.17.207] (may be forged)) by zig.murex.com with ESMTP id k5UKZNGw015671; Fri, 30 Jun 2006 22:35:23 +0200 (CEST) Received: from mxmail.murex.com (interscan.murex.fr [127.0.0.1]) by interscan.fr.murex.com (8.11.6/8.11.6) with ESMTP id k5UKel920685; Fri, 30 Jun 2006 22:40:47 +0200 Received: from [172.21.130.86] ([172.21.130.86]) by mxmail.murex.com with Microsoft SMTPSVC(6.0.3790.0); Fri, 30 Jun 2006 22:30:58 +0200 From: Mikhail Teterin Organization: Virtual Estates, Inc. To: net@freebsd.org Date: Fri, 30 Jun 2006 16:31:43 -0400 User-Agent: KMail/1.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200606301631.44061.mi+mx@aldan.algebra.com> X-OriginalArrivalTime: 30 Jun 2006 20:30:58.0379 (UTC) FILETIME=[184A81B0:01C69C84] Cc: question@freebsd.org Subject: Struggling with rcmd X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jun 2006 20:32:18 -0000 Why does not the following work? rem = rcmd(&host, sp->s_port, pwd->pw_name, user, copyargs(argv), &remerr); if (rem < 0) exit(EX_UNAVAILABLE); if (remerr < 0) warn("Can't establish stderr channel (%d)", remerr); It only works, the specified remote commands is entirely self-contained (like "touch /tmp/tag" -- the /tmp/tag appears on the remote system). However, the remerr is never filled with the file descriptor -- whatever value it has before the rcmd call, stays in it: rcmd: Can't establish stderr channel (-3): Unknown error: 0 Thanks! -mi