Allow for \H -> "address ..." substitution in PIPE ports. Useful

e.g. for generic UUCP over SSH or SSL... Idea and part of the patch
by Joerg Durchain, has apparently been integrated in Debian for a
while.
This commit is contained in:
is 2005-09-07 12:38:16 +00:00
parent 3d40ace0a6
commit 8750386a4d
2 changed files with 14 additions and 5 deletions

View File

@ -4241,7 +4241,8 @@ using the @code{speed} command to select ports from the port file.
@findex address
Give a phone number to call (when using a modem port) or a remote host
to contact (when using a TCP or TLI port). The commands @code{phone}
to contact (when using a TCP or TLI port) or insert as parameter to a
command string (when using a PIPE port). The commands @code{phone}
and @code{address} are equivalent; the duplication is intended to
provide a mnemonic choice depending on the type of port in use.
@ -5246,7 +5247,8 @@ When a port of this type is used, the command is executed and
only be reached through some unusual means. A sample use might be
@samp{command /bin/rlogin -E -8 -l @var{login} @var{system}}. The
command is run with the full privileges of UUCP; it is responsible for
maintaining security.
maintaining security. The string @kbd{\H} is replaced with the remote
host name given by the @code{address} command.
@end table
@ -5649,8 +5651,8 @@ Keywords: UUCP, protocol, FAQ
Approved: news-answers-request@@MIT.Edu
Archive-name: uucp-internals
Version: $Revision: 1.5 $
Last-modified: $Date: 2003/01/06 20:30:43 $
Version: $Revision: 1.6 $
Last-modified: $Date: 2005/09/07 12:38:16 $
@end format
@end ifset

View File

@ -27,7 +27,7 @@
#include "uucp.h"
#if USE_RCS_ID
const char pipe_rcsid[] = "$Id: pipe.c,v 1.2 1995/08/24 05:20:05 jtc Exp $";
const char pipe_rcsid[] = "$Id: pipe.c,v 1.3 2005/09/07 12:38:16 is Exp $";
#endif
#include "uudefs.h"
@ -199,6 +199,7 @@ fspipe_dial (qconn, puuconf, qsys, zphone, qdialer, ptdialer)
struct ssysdep_conn *q;
int aidescs[3];
const char **pzprog;
const char **p;
q = (struct ssysdep_conn *) qconn->psysdep;
@ -212,6 +213,12 @@ fspipe_dial (qconn, puuconf, qsys, zphone, qdialer, ptdialer)
return FALSE;
}
/* Look for a string \H and substitute the address given for this system */
for (p=pzprog; *p; p++)
if (!strcmp(*p, "\\H"))
*p = zphone;
aidescs[0] = SPAWN_WRITE_PIPE;
aidescs[1] = SPAWN_READ_PIPE;
aidescs[2] = SPAWN_NULL;