diff options
Diffstat (limited to 'gnu/libexec/uucp/common_sources')
| -rw-r--r-- | gnu/libexec/uucp/common_sources/chat.c | 16 | ||||
| -rw-r--r-- | gnu/libexec/uucp/common_sources/config.h | 15 | ||||
| -rw-r--r-- | gnu/libexec/uucp/common_sources/conn.c | 8 | ||||
| -rw-r--r-- | gnu/libexec/uucp/common_sources/conn.h | 4 | ||||
| -rw-r--r-- | gnu/libexec/uucp/common_sources/copy.c | 54 | ||||
| -rw-r--r-- | gnu/libexec/uucp/common_sources/cu.h | 4 | ||||
| -rw-r--r-- | gnu/libexec/uucp/common_sources/getopt.h | 21 | ||||
| -rw-r--r-- | gnu/libexec/uucp/common_sources/log.c | 40 | ||||
| -rw-r--r-- | gnu/libexec/uucp/common_sources/policy.h | 27 | ||||
| -rw-r--r-- | gnu/libexec/uucp/common_sources/prot.c | 6 | ||||
| -rw-r--r-- | gnu/libexec/uucp/common_sources/prot.h | 23 | ||||
| -rw-r--r-- | gnu/libexec/uucp/common_sources/sysdep.h | 17 | ||||
| -rw-r--r-- | gnu/libexec/uucp/common_sources/system.h | 41 | ||||
| -rw-r--r-- | gnu/libexec/uucp/common_sources/trans.h | 4 | ||||
| -rw-r--r-- | gnu/libexec/uucp/common_sources/util.c | 6 | ||||
| -rw-r--r-- | gnu/libexec/uucp/common_sources/uuconf.h | 21 | ||||
| -rw-r--r-- | gnu/libexec/uucp/common_sources/uucp.h | 42 | ||||
| -rw-r--r-- | gnu/libexec/uucp/common_sources/uudefs.h | 17 |
18 files changed, 260 insertions, 106 deletions
diff --git a/gnu/libexec/uucp/common_sources/chat.c b/gnu/libexec/uucp/common_sources/chat.c index f35e2e0fbedb..4692fe76390a 100644 --- a/gnu/libexec/uucp/common_sources/chat.c +++ b/gnu/libexec/uucp/common_sources/chat.c @@ -1,7 +1,7 @@ /* chat.c Chat routine for the UUCP package. - Copyright (C) 1991, 1992, 1993 Ian Lance Taylor + Copyright (C) 1991, 1992, 1993, 1995 Ian Lance Taylor This file is part of the Taylor UUCP package. @@ -17,16 +17,16 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. The author of the program may be contacted at ian@airs.com or - c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139. + c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144. */ #include "uucp.h" #if USE_RCS_ID -const char chat_rcsid[] = "$Id: chat.c,v 1.2 1994/05/07 18:08:33 ache Exp $"; +const char chat_rcsid[] = "$Id: chat.c,v 1.46 1995/06/21 19:14:29 ian Rel $"; #endif #include <ctype.h> @@ -728,9 +728,9 @@ fcsend (qconn, puuconf, z, qsys, qdial, zphone, ftranslate, fstrip) if (isdigit (BUCHAR (z[1]))) bsend = (char) (16 * bsend + *++z - '0'); else if (isupper (BUCHAR (z[1]))) - bsend = (char) (16 * bsend + *++z - 'A'); + bsend = (char) (16 * bsend + *++z - 'A' + 10); else - bsend = (char) (16 * bsend + *++z - 'a'); + bsend = (char) (16 * bsend + *++z - 'a' + 10); } break; case 'L': @@ -926,7 +926,7 @@ fcsend (qconn, puuconf, z, qsys, qdial, zphone, ftranslate, fstrip) break; #endif } - + if (fsend) { fquote = fcsend_debug (fquote, (size_t) 1, &bsend); @@ -1190,7 +1190,7 @@ fcprogram (qconn, puuconf, pzprogram, qsys, qdial, zphone, zport, ibaud) *pzarg = zbufcpy (*pz); continue; } - + *pzarg = NULL; zto = NULL; calc = 0; diff --git a/gnu/libexec/uucp/common_sources/config.h b/gnu/libexec/uucp/common_sources/config.h index c9fe3368931f..f17b97c7ee97 100644 --- a/gnu/libexec/uucp/common_sources/config.h +++ b/gnu/libexec/uucp/common_sources/config.h @@ -28,6 +28,7 @@ #define HAVE_SYS_IOCTL_H 1 /* <sys/ioctl.h> */ #define HAVE_DIRENT_H 1 /* <dirent.h> */ #define HAVE_MEMORY_H 1 /* <memory.h> */ +#define HAVE_TERMIOS_H 1 /* <termios.h> */ #define HAVE_SYS_PARAM_H 1 /* <sys/param.h> */ #define HAVE_UTIME_H 1 /* <utime.h> */ #define HAVE_FCNTL_H 1 /* <fcntl.h> */ @@ -45,6 +46,14 @@ #define HAVE_GLOB_H 1 /* <glob.h> */ #define HAVE_SYS_SELECT_H 0 /* <sys/select.h> */ #define HAVE_SYS_TYPES_TCP_H 0 /* <sys/types.tcp.h> */ +#define HAVE_SYS_MOUNT_H 1 /* <sys/mount.h> */ +#define HAVE_SYS_VFS_H 0 /* <sys/vfs.h> */ +#define HAVE_SYS_FILSYS_H 0 /* <sys/filsys.h> */ +#define HAVE_SYS_STATFS_H 0 /* <sys/statfs.h> */ +#define HAVE_SYS_DUSTAT_H 0 /* <sys/dustat.h> */ +#define HAVE_SYS_FS_TYPES_H 0 /* <sys/fs_types.h> */ +#define HAVE_USTAT_H 0 /* <ustat.h> */ +#define HAVE_SYS_STATVFS_H 0 /* <sys/statvfs.h> */ /* If major and minor are not defined in <sys/types.h>, but are in <sys/mkdev.h>, set MAJOR_IN_MKDEV to 1. If they are in @@ -177,19 +186,19 @@ another instance of Taylor UUCP. STAT_STATVFS statvfs function + STAT_STATFS3_OSF1 three argument statfs function (OSF/1) STAT_STATFS2_BSIZE two argument statfs function with f_bsize field STAT_STATFS2_FSIZE two argument statfs function with f_fsize field STAT_STATFS2_FS_DATA two argument statfs function with fd_req field STAT_STATFS4 four argument statfs function - STAT_DUSTAT dustat function (AIX PS/2) STAT_DISK_SPACE disk_space function (QNX) STAT_USTAT the ustat function with 512 byte blocks. */ #define STAT_STATVFS 0 +#define STAT_STATFS3_OSF1 0 #define STAT_STATFS2_BSIZE 1 #define STAT_STATFS2_FSIZE 0 #define STAT_STATFS2_FS_DATA 0 #define STAT_STATFS4 0 -#define STAT_DUSTAT 0 #define STAT_DISK_SPACE 0 #define STAT_USTAT 0 @@ -358,7 +367,7 @@ Otherwise, the code will use OPEN_MAX if defined, then NOFILE if defined, then 20. */ #define HAVE_GETDTABLESIZE 1 -#define HAVE_SYSCONF 0 +#define HAVE_SYSCONF 1 /* The code will use one of the following functions when detaching from a terminal. One of these must exist. */ diff --git a/gnu/libexec/uucp/common_sources/conn.c b/gnu/libexec/uucp/common_sources/conn.c index f3ae8e4fdede..de91b117b651 100644 --- a/gnu/libexec/uucp/common_sources/conn.c +++ b/gnu/libexec/uucp/common_sources/conn.c @@ -17,16 +17,16 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. The author of the program may be contacted at ian@airs.com or - c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139. + c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144. */ #include "uucp.h" #if USE_RCS_ID -const char conn_rcsid[] = "$Id: conn.c,v 1.2 1994/05/07 18:08:38 ache Exp $"; +const char conn_rcsid[] = "$Id: conn.c,v 1.15 1995/06/21 19:14:35 ian Rel $"; #endif #include <ctype.h> @@ -234,7 +234,7 @@ fconn_dial (qconn, puuconf, qsys, zphone, qdialer, ptdialerfound) qdialer = &sdialer; if (ptdialerfound == NULL) ptdialerfound = &tfound; - + qdialer->uuconf_zname = NULL; *ptdialerfound = DIALERFOUND_FALSE; diff --git a/gnu/libexec/uucp/common_sources/conn.h b/gnu/libexec/uucp/common_sources/conn.h index 368f7e658949..09235ea2ca20 100644 --- a/gnu/libexec/uucp/common_sources/conn.h +++ b/gnu/libexec/uucp/common_sources/conn.h @@ -17,10 +17,10 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. The author of the program may be contacted at ian@airs.com or - c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139. + c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144. */ #ifndef CONN_H diff --git a/gnu/libexec/uucp/common_sources/copy.c b/gnu/libexec/uucp/common_sources/copy.c index e1b974d159e4..b1787f9561c8 100644 --- a/gnu/libexec/uucp/common_sources/copy.c +++ b/gnu/libexec/uucp/common_sources/copy.c @@ -1,7 +1,7 @@ /* copy.c Copy one file to another for the UUCP package. - Copyright (C) 1991, 1992 Ian Lance Taylor + Copyright (C) 1991, 1992, 1995 Ian Lance Taylor This file is part of the Taylor UUCP package. @@ -17,16 +17,16 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. The author of the program may be contacted at ian@airs.com or - c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139. + c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144. */ #include "uucp.h" #if USE_RCS_ID -const char copy_rcsid[] = "$Id: copy.c,v 1.13 1994/01/30 21:01:46 ian Rel $"; +const char copy_rcsid[] = "$Id: copy.c,v 1.18 1995/08/02 01:17:31 ian Rel $"; #endif #include "uudefs.h" @@ -41,11 +41,12 @@ const char copy_rcsid[] = "$Id: copy.c,v 1.13 1994/01/30 21:01:46 ian Rel $"; #if USE_STDIO boolean -fcopy_file (zfrom, zto, fpublic, fmkdirs) +fcopy_file (zfrom, zto, fpublic, fmkdirs, fsignals) const char *zfrom; const char *zto; boolean fpublic; boolean fmkdirs; + boolean fsignals; { FILE *efrom; boolean fret; @@ -57,17 +58,18 @@ fcopy_file (zfrom, zto, fpublic, fmkdirs) return FALSE; } - fret = fcopy_open_file (efrom, zto, fpublic, fmkdirs); + fret = fcopy_open_file (efrom, zto, fpublic, fmkdirs, fsignals); (void) fclose (efrom); return fret; } boolean -fcopy_open_file (efrom, zto, fpublic, fmkdirs) +fcopy_open_file (efrom, zto, fpublic, fmkdirs, fsignals) FILE *efrom; const char *zto; boolean fpublic; boolean fmkdirs; + boolean fsignals; { FILE *eto; char ab[8192]; @@ -86,6 +88,21 @@ fcopy_open_file (efrom, zto, fpublic, fmkdirs) (void) remove (zto); return FALSE; } + if (fsignals && FGOT_SIGNAL ()) + { + /* Log the signal. */ + ulog (LOG_ERROR, (const char *) NULL); + (void) fclose (eto); + (void) remove (zto); + return FALSE; + } + } + + if (! fsysdep_sync (eto, zto)) + { + (void) fclose (eto); + (void) remove (zto); + return FALSE; } if (fclose (eto) != 0) @@ -119,11 +136,12 @@ fcopy_open_file (efrom, zto, fpublic, fmkdirs) #endif boolean -fcopy_file (zfrom, zto, fpublic, fmkdirs) +fcopy_file (zfrom, zto, fpublic, fmkdirs, fsignals) const char *zfrom; const char *zto; boolean fpublic; boolean fmkdirs; + boolean fsignals; { int ofrom; boolean fret; @@ -135,17 +153,18 @@ fcopy_file (zfrom, zto, fpublic, fmkdirs) return FALSE; } - fret = fcopy_open_file (ofrom, zto, fpublic, fmkdirs); + fret = fcopy_open_file (ofrom, zto, fpublic, fmkdirs, fsignals); (void) close (ofrom); return fret; } boolean -fcopy_open_file (ofrom, zto, fpublic, fmkdirs) +fcopy_open_file (ofrom, zto, fpublic, fmkdirs, fsignals) int ofrom; const char *zto; boolean fpublic; boolean fmkdirs; + boolean fsignals; { int oto; char ab[8192]; @@ -180,6 +199,21 @@ fcopy_open_file (ofrom, zto, fpublic, fmkdirs) (void) remove (zto); return FALSE; } + if (fsignals && FGOT_SIGNAL ()) + { + /* Log the signal. */ + ulog (LOG_ERROR, (const char *) NULL); + (void) fclose (eto); + (void) remove (zto); + return FALSE; + } + } + + if (! fsysdep_sync (oto, zto)) + { + (void) close (oto); + (void) remove (zto); + return FALSE; } if (close (oto) < 0) diff --git a/gnu/libexec/uucp/common_sources/cu.h b/gnu/libexec/uucp/common_sources/cu.h index 748e2d32c199..8c2267031cb7 100644 --- a/gnu/libexec/uucp/common_sources/cu.h +++ b/gnu/libexec/uucp/common_sources/cu.h @@ -17,10 +17,10 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. The author of the program may be contacted at ian@airs.com or - c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139. + c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144. */ /* The user settable variables supported by cu. */ diff --git a/gnu/libexec/uucp/common_sources/getopt.h b/gnu/libexec/uucp/common_sources/getopt.h index d9f87a5c5189..61e295409f41 100644 --- a/gnu/libexec/uucp/common_sources/getopt.h +++ b/gnu/libexec/uucp/common_sources/getopt.h @@ -5,18 +5,18 @@ under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. This file was modified slightly by Ian Lance Taylor, November 1992, - for Taylor UUCP. */ + for Taylor UUCP, and again in June, 1995. */ #ifndef _GETOPT_H #define _GETOPT_H 1 @@ -100,6 +100,14 @@ enum _argtype optional_argument }; +#ifndef P +/* On some systems, <stdio.h> includes getopt.h before P is defined by + uucp.h, and the -I arguments cause this version of getopt.h to be + included. Work around that here. */ +#define P(x) () +#define UNDEFINE_P +#endif + extern int getopt P((int argc, char *const *argv, const char *shortopts)); extern int getopt_long P((int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind)); @@ -113,6 +121,11 @@ extern int _getopt_internal P((int argc, char *const *argv, const struct option *longopts, int *longind, int long_only)); +#ifdef UNDEFINE_P +#undef P +#undef UNDEFINE_P +#endif + #ifdef __cplusplus } #endif diff --git a/gnu/libexec/uucp/common_sources/log.c b/gnu/libexec/uucp/common_sources/log.c index 261163a2559b..1c35b876d519 100644 --- a/gnu/libexec/uucp/common_sources/log.c +++ b/gnu/libexec/uucp/common_sources/log.c @@ -1,7 +1,7 @@ /* log.c Routines to add entries to the log files. - Copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor + Copyright (C) 1991, 1992, 1993, 1994, 1995 Ian Lance Taylor This file is part of the Taylor UUCP package. @@ -17,16 +17,16 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. The author of the program may be contacted at ian@airs.com or - c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139. + c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144. */ #include "uucp.h" #if USE_RCS_ID -const char log_rcsid[] = "$Id: log.c,v 1.2 1994/05/07 18:08:47 ache Exp $"; +const char log_rcsid[] = "$Id: log.c,v 1.61 1995/06/21 19:14:58 ian Rel $"; #endif #include <ctype.h> @@ -199,7 +199,7 @@ ulog_system (zsystem) { ubuffree (zLsystem); zLsystem = zbufcpy (zsystem); -#if HAVE_HDB_LOGGING +#if HAVE_HDB_LOGGING /* Under HDB logging we now must write to a different log file. */ ulog_close (); #endif /* HAVE_HDB_LOGGING */ @@ -287,9 +287,6 @@ ulog (ttype, zmsg, a, b, c, d, f, g, h, i, j) } } - if (zmsg == NULL) - return; - #if DEBUG > 1 /* If we've had a debugging file open in the past, then we want to write all log file entries to the debugging file even if it's @@ -321,9 +318,12 @@ ulog (ttype, zmsg, a, b, c, d, f, g, h, i, j) { if (eLlog == NULL && ! fLlog_tried) { + const char *zprint = NULL; + fLlog_tried = TRUE; #if ! HAVE_HDB_LOGGING eLlog = esysdep_fopen (zLogfile, TRUE, TRUE, TRUE); + zprint = zLogfile; #else /* HAVE_HDB_LOGGING */ { const char *zsys; @@ -331,7 +331,7 @@ ulog (ttype, zmsg, a, b, c, d, f, g, h, i, j) char *zlower; char *zfile; - /* We want to write to .Log/program/system, e.g. + /* We want to write to .Log/program/system, e.g. .Log/uucico/uunet. The system name may not be set. */ if (zLsystem == NULL) zsys = "ANY"; @@ -356,7 +356,10 @@ ulog (ttype, zmsg, a, b, c, d, f, g, h, i, j) sprintf (zfile, zLogfile, zbase, zsys); ubuffree (zbase); eLlog = esysdep_fopen (zfile, TRUE, TRUE, TRUE); - ubuffree (zfile); + if (eLlog != NULL) + ubuffree (zfile); + else + zprint = zfile; } #endif /* HAVE_HDB_LOGGING */ @@ -367,8 +370,8 @@ ulog (ttype, zmsg, a, b, c, d, f, g, h, i, j) running on an inbound call stderr is actually connected to a remote system, but is better than doing nothing. */ - fprintf (stderr, "%s: %s: can not open log file\n", - zProgram, zLogfile); + fprintf (stderr, "%s: %s: can not open log file: %s\n", + zProgram, zprint, strerror (errno)); if (pfLfatal != NULL) (*pfLfatal) (); usysdep_exit (FALSE); @@ -383,6 +386,9 @@ ulog (ttype, zmsg, a, b, c, d, f, g, h, i, j) return; } + if (zmsg == NULL) + return; + if (pfLstart != NULL) (*pfLstart) (); @@ -610,7 +616,7 @@ ulog_close () /*ARGSUSED*/ void -ustats (fsucceeded, zuser, zsystem, fsent, cbytes, csecs, cmicros, fmaster) +ustats (fsucceeded, zuser, zsystem, fsent, cbytes, csecs, cmicros, fcaller) boolean fsucceeded; const char *zuser; const char *zsystem; @@ -618,7 +624,7 @@ ustats (fsucceeded, zuser, zsystem, fsent, cbytes, csecs, cmicros, fmaster) long cbytes; long csecs; long cmicros; - boolean fmaster; + boolean fcaller; { long cbps; @@ -633,7 +639,7 @@ ustats (fsucceeded, zuser, zsystem, fsent, cbytes, csecs, cmicros, fmaster) { csecs += cmicros / 10000000L; cmicros = cmicros % 1000000L; - } + } /* On a system which can determine microseconds we might very well have both csecs == 0 and cmicros == 0. */ @@ -701,7 +707,7 @@ ustats (fsucceeded, zuser, zsystem, fsent, cbytes, csecs, cmicros, fmaster) ++iseq; fprintf (eLstats, "%s!%s %c (%s) (C,%d,%d) [%s] %s %ld / %ld.%03ld secs, %ld%s%s\n", - zsystem, zuser, fmaster ? 'M' : 'S', zldate_and_time (), + zsystem, zuser, fcaller ? 'M' : 'S', zldate_and_time (), iLid, iseq, zLdevice == NULL ? "unknown" : zLdevice, fsent ? "->" : "<-", cbytes, csecs, cmicros / 1000, cbps, @@ -761,7 +767,7 @@ zldate_and_time () s.tm_hour, s.tm_min); #endif #if HAVE_HDB_LOGGING - sprintf (ab, "%d/%d-%02d:%02d:%02d", s.tm_mon + 1, s.tm_mday, + sprintf (ab, "%d/%d-%d:%02d:%02d", s.tm_mon + 1, s.tm_mday, s.tm_hour, s.tm_min, s.tm_sec); #endif diff --git a/gnu/libexec/uucp/common_sources/policy.h b/gnu/libexec/uucp/common_sources/policy.h index 75b8d21a2189..171197ee28c8 100644 --- a/gnu/libexec/uucp/common_sources/policy.h +++ b/gnu/libexec/uucp/common_sources/policy.h @@ -1,7 +1,7 @@ /* policy.h Configuration file for policy decisions. To be edited on site. - Copyright (C) 1991, 1992, 1993 Ian Lance Taylor + Copyright (C) 1991, 1992, 1993, 1994, 1995 Ian Lance Taylor This file is part of the Taylor UUCP package. @@ -17,10 +17,10 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. The author of the program may be contacted at ian@airs.com or - c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139. + c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144. */ /* This header file contains macro definitions which must be set by @@ -72,10 +72,10 @@ figure out what's happening if something goes wrong. */ #if HAVE_BSD_TTY + HAVE_SYSV_TERMIO + HAVE_POSIX_TERMIOS == 0 -#ifdef __QNX__ +#if HAVE_TERMIOS_H #undef HAVE_POSIX_TERMIOS #define HAVE_POSIX_TERMIOS 1 -#else /* ! defined (__QNX__) */ +#else /* ! HAVE_TERMIOS_H */ #if HAVE_CBREAK #undef HAVE_BSD_TTY #define HAVE_BSD_TTY 1 @@ -83,7 +83,7 @@ #undef HAVE_SYSV_TERMIO #define HAVE_SYSV_TERMIO 1 #endif /* ! HAVE_CBREAK */ -#endif /* ! defined (__QNX__) */ +#endif /* ! HAVE_TERMIOS_H */ #endif /* HAVE_BSD_TTY + HAVE_SYSV_TERMIO + HAVE_POSIX_TERMIOS == 0 */ /* On some systems a write to a serial port will block even if the @@ -215,6 +215,12 @@ broken pretty much always have saved setuid. */ #define HAVE_BROKEN_SETREUID 0 +/* On a few systems, such as NextStep 3.3, the POSIX macro F_SETLKW is + defined, but does not work. On such systems, you must set + HAVE_BROKEN_SETLKW to 1. If you do not, uux will hang, or log + peculiar error messages, every time it is run. */ +#define HAVE_BROKEN_SETLKW 0 + /* On the 3B2, and possibly other systems, nap takes an argument in hundredths of a second rather than milliseconds. I don't know of any way to test for this. Set HAVE_HUNDREDTHS_NAP to 1 if this is @@ -623,6 +629,15 @@ permitted. */ #define ALLOW_FILENAME_ARGUMENTS 1 +/* If you set FSYNC_ON_CLOSE to 1, all output files will be forced out + to disk using the fsync system call when they are closed. This can + be useful if you can not afford to lose people's mail if the system + crashes. However, not all systems have the fsync call, and it is + always less efficient to use it. Note that some versions of SCO + Unix, and possibly other systems, make fsync a synonym for sync, + which is extremely inefficient. */ +#define FSYNC_ON_CLOSE 0 + #if HAVE_TAYLOR_LOGGING /* The default log file when using HAVE_TAYLOR_LOGGING. When using diff --git a/gnu/libexec/uucp/common_sources/prot.c b/gnu/libexec/uucp/common_sources/prot.c index 0a6cbc8da1a7..54156a4b18d5 100644 --- a/gnu/libexec/uucp/common_sources/prot.c +++ b/gnu/libexec/uucp/common_sources/prot.c @@ -17,16 +17,16 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. The author of the program may be contacted at ian@airs.com or - c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139. + c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144. */ #include "uucp.h" #if USE_RCS_ID -const char prot_rcsid[] = "$Id: prot.c,v 1.30 1994/04/14 03:07:56 ian Rel $"; +const char prot_rcsid[] = "$Id: prot.c,v 1.32 1995/06/21 19:15:07 ian Rel $"; #endif #include <errno.h> diff --git a/gnu/libexec/uucp/common_sources/prot.h b/gnu/libexec/uucp/common_sources/prot.h index 07dc6203f426..11c3941c5c50 100644 --- a/gnu/libexec/uucp/common_sources/prot.h +++ b/gnu/libexec/uucp/common_sources/prot.h @@ -1,7 +1,7 @@ /* prot.h Protocol header file. - Copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor + Copyright (C) 1991, 1992, 1993, 1994, 1995 Ian Lance Taylor This file is part of the Taylor UUCP package. @@ -17,10 +17,10 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. The author of the program may be contacted at ian@airs.com or - c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139. + c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144. */ /* We need the definition of uuconf_cmdtab to declare the protocol @@ -234,11 +234,13 @@ extern boolean fiwait P((struct sdaemon *qdaemon)); /* Prototypes for 'j' protocol functions. The 'j' protocol mostly uses the 'i' protocol functions, but it has a couple of functions of its own. */ + extern boolean fjstart P((struct sdaemon *qdaemon, char **pzlog)); extern boolean fjshutdown P((struct sdaemon *qdaemon)); /* Prototypes for 'a' protocol functions (these use 'z' as the second character because 'a' is a modified Zmodem protocol). */ + extern struct uuconf_cmdtab asZproto_params[]; extern boolean fzstart P((struct sdaemon *qdaemon, char **pzlog)); extern boolean fzshutdown P((struct sdaemon *qdaemon)); @@ -251,3 +253,18 @@ extern boolean fzwait P((struct sdaemon *qdaemon)); extern boolean fzfile P((struct sdaemon *qdaemon, struct stransfer *qtrans, boolean fstart, boolean fsend, long cbytes, boolean *pfhandled)); + +/* Prototypes for 'y' protocol functions. */ + +extern struct uuconf_cmdtab asYproto_params[]; +extern boolean fystart P((struct sdaemon *qdaemon, char **pzlog)); +extern boolean fyshutdown P((struct sdaemon *qdaemon)); +extern boolean fysendcmd P((struct sdaemon *qdaemon, const char *z, + int ilocal, int iremote)); +extern char *zygetspace P((struct sdaemon *qdaemon, size_t *pcdata)); +extern boolean fysenddata P((struct sdaemon *qdaemon, char *z, size_t c, + int ilocal, int iremote, long ipos)); +extern boolean fywait P((struct sdaemon *qdaemon)); +extern boolean fyfile P((struct sdaemon *qdaemon, struct stransfer *qtrans, + boolean fstart, boolean fsend, long cbytes, + boolean *pfhandled)); diff --git a/gnu/libexec/uucp/common_sources/sysdep.h b/gnu/libexec/uucp/common_sources/sysdep.h index 41dcecdf9277..8b7e279d80dc 100644 --- a/gnu/libexec/uucp/common_sources/sysdep.h +++ b/gnu/libexec/uucp/common_sources/sysdep.h @@ -1,7 +1,7 @@ /* sysh.unx -*- C -*- The header file for the UNIX system dependent routines. - Copyright (C) 1991, 1992, 1993 Ian Lance Taylor + Copyright (C) 1991, 1992, 1993, 1995 Ian Lance Taylor This file is part of the Taylor UUCP package. @@ -17,10 +17,10 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. The author of the program may be contacted at ian@airs.com or - c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139. + c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144. */ #ifndef SYSH_UNX_H @@ -228,6 +228,9 @@ typedef struct termios sterminal; /* The name of the directory to which we move corrupt files. */ #define CORRUPTDIR ".Corrupt" +/* The name of the directory to which we move failed execution files. */ +#define FAILEDDIR ".Failed" + /* The length of the sequence number used in a file name. */ #define CSEQLEN (4) @@ -471,6 +474,14 @@ extern boolean fsdo_unlock P((const char *, boolean fspooldir)); extern boolean fsuser_access P((const struct stat *, int imode, const char *zuser)); +/* Switch to the permissions of the invoking user. This sets the + argument to a value to pass to fsuucp_perms. */ +extern boolean fsuser_perms P((uid_t *)); + +/* Switch back to the permissions of the UUCP user ID. This should be + passed the value returned by fsuser_perms in its argument. */ +extern boolean fsuucp_perms P((long)); + /* Stick two directories and a file name together. */ extern char *zsappend3 P((const char *zdir1, const char *zdir2, const char *zfile)); diff --git a/gnu/libexec/uucp/common_sources/system.h b/gnu/libexec/uucp/common_sources/system.h index 9765edf17a49..5fcc525f9841 100644 --- a/gnu/libexec/uucp/common_sources/system.h +++ b/gnu/libexec/uucp/common_sources/system.h @@ -2,7 +2,7 @@ Header file for system dependent stuff in the Taylor UUCP package. This file is not itself system dependent. - Copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor + Copyright (C) 1991, 1992, 1993, 1994, 1995 Ian Lance Taylor This file is part of the Taylor UUCP package. @@ -18,10 +18,10 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. The author of the program may be contacted at ian@airs.com or - c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139. + c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144. */ #ifndef SYSTEM_H @@ -343,6 +343,12 @@ extern const char *zsysdep_save_temp_file P((pointer pseq)); the move failed (in which the original file should remain). */ extern char *zsysdep_save_corrupt_file P((const char *zfile)); +/* Save a file in a location used to hold failed execution files. + This is called if a uuxqt execution fails. This should return the + new name of the file (allocated by zbufalc), or NULL if the move + failed (in which case the original file should remain). */ +extern char *zsysdep_save_failed_file P((const char *zfile)); + /* Cleanup anything left over by fsysdep_get_work_init and fsysdep_get_work. This may be called even though fsysdep_get_work_init has not been. */ @@ -461,6 +467,11 @@ extern boolean fsysdep_change_mode P((const char *zfile, closing the original file, removing it and reopening it. This should return FALSE on error. */ extern openfile_t esysdep_truncate P((openfile_t e, const char *zname)); + +/* Sync a file to disk. If this fails it should log an error using + the zmsg parameter, and return FALSE. This is controlled by the + FSYNC_ON_CLOSE macro in policy.h. */ +extern boolean fsysdep_sync P((openfile_t e, const char *zmsg)); /* It is possible for the acknowledgement of a received file to be lost. The sending system will then now know that the file was @@ -557,19 +568,25 @@ extern char *zsysdep_xqt_file_name P((void)); /* Beginning getting execute files. To get a list of execute files, first fsysdep_get_xqt_init is called, then zsysdep_get_xqt is called several times until it returns NULL, then finally - usysdep_get_xqt_free is called. */ -extern boolean fsysdep_get_xqt_init P((void)); + usysdep_get_xqt_free is called. If the zsystem argument is not + NULL, it is the name of a system for which execution files are + desired. */ +extern boolean fsysdep_get_xqt_init P((const char *zsystem)); /* Get the next execute file. This should return NULL when finished - (with *pferr set to FALSE). On an error this should return NULL - with *pferr set to TRUE. This should set *pzsystem to the name of - the system for which the execute file was created. Both the return - value and *pzsystem should be freed using ubuffree. */ -extern char *zsysdep_get_xqt P((char **pzsystem, + (with *pferr set to FALSE). The zsystem argument should be the + same string as that passed to fsysdep_get_xqt_init. On an error + this should return NULL with *pferr set to TRUE. This should set + *pzsystem to the name of the system for which the execute file was + created; this is not guaranteed to match the zsystem argument--that + must be double checked by the caller. Both the return value and + *pzsystem should be freed using ubuffree. */ +extern char *zsysdep_get_xqt P((const char *zsystem, char **pzsystem, boolean *pferr)); -/* Clean up after getting execute files. */ -extern void usysdep_get_xqt_free P((void)); +/* Clean up after getting execute files. The zsystem argument should + be the same string as that passed to fsysdep_get_xqt_init. */ +extern void usysdep_get_xqt_free P((const char *zsystem)); /* Get the absolute pathname of a command to execute. This is given the legal list of commands (which may be the special case "ALL") diff --git a/gnu/libexec/uucp/common_sources/trans.h b/gnu/libexec/uucp/common_sources/trans.h index 93aee2e9ac8f..d057ab2c8a40 100644 --- a/gnu/libexec/uucp/common_sources/trans.h +++ b/gnu/libexec/uucp/common_sources/trans.h @@ -17,10 +17,10 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. The author of the program may be contacted at ian@airs.com or - c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139. + c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144. */ /* The maximum possible number of channels. */ diff --git a/gnu/libexec/uucp/common_sources/util.c b/gnu/libexec/uucp/common_sources/util.c index 78a94558cf88..21dbebc3dae7 100644 --- a/gnu/libexec/uucp/common_sources/util.c +++ b/gnu/libexec/uucp/common_sources/util.c @@ -17,16 +17,16 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. The author of the program may be contacted at ian@airs.com or - c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139. + c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144. */ #include "uucp.h" #if USE_RCS_ID -const char util_rcsid[] = "$Id: util.c,v 1.6 1994/01/30 20:59:40 ian Rel $"; +const char util_rcsid[] = "$Id: util.c,v 1.8 1995/06/21 19:16:18 ian Rel $"; #endif #include <ctype.h> diff --git a/gnu/libexec/uucp/common_sources/uuconf.h b/gnu/libexec/uucp/common_sources/uuconf.h index cb6dbb648c3e..48cf9cd44139 100644 --- a/gnu/libexec/uucp/common_sources/uuconf.h +++ b/gnu/libexec/uucp/common_sources/uuconf.h @@ -1,7 +1,7 @@ /* uuconf.h Header file for UUCP configuration routines. - Copyright (C) 1992, 1993, 1994 Ian Lance Taylor + Copyright (C) 1992, 1993, 1994, 1995 Ian Lance Taylor This file is part of the Taylor UUCP uuconf library. @@ -17,7 +17,7 @@ You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. The use of an object file which uses material from this header file, and from no other portion of the uuconf library, is @@ -26,7 +26,7 @@ informative, and does not modify the License in any way). The author of the program may be contacted at ian@airs.com or - c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139. + c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144. */ #ifndef UUCONF_H @@ -206,6 +206,12 @@ struct uuconf_system other system should transfer at that time. May be NULL, in which case there are no grade restrictions. */ struct uuconf_timespan *uuconf_qcalltimegrade; + /* The times at which to allow a particular grade of work to be + transferred to the system, when it calls in. The ival field of + each uuconf_timespan structure is the lowest grade which should + be transferred at that time. May be NULL, in which case there + are no grade restrictions. */ + struct uuconf_timespan *uuconf_qcalledtimegrade; /* The maximum number of times to retry calling this system. If this is 0, there is no limit. */ int uuconf_cmax_retries; @@ -565,6 +571,10 @@ struct uuconf_dialer be b1 - b2. */ #define UUCONF_GRADE_CMP(b1, b2) (uuconf_grade_cmp ((b1), (b2))) +/* Definitions for bits returned by uuconf_strip. */ +#define UUCONF_STRIP_LOGIN (01) +#define UUCONF_STRIP_PROTO (02) + /* uuconf_runuuxqt returns either a positive number (the number of execution files to receive between uuxqt invocations) or one of these constant values. */ @@ -871,6 +881,11 @@ extern int uuconf_debugfile (void *uuconf_pglobal, extern int uuconf_debuglevel (void *uuconf_pglobal, const char **uuconf_pzdebug); +/* Get a combination of UUCONF_STRIP bits indicating what types of + global information should be stripped on input. */ +extern int uuconf_strip (void *uuconf_pglobal, + int *uuconf_pistrip); + /* Get the maximum number of simultaneous uuxqt executions. This will set *pcmaxuuxqt to the number. Zero indicates no maximum. */ extern int uuconf_maxuuxqts (void *uuconf_pglobal, diff --git a/gnu/libexec/uucp/common_sources/uucp.h b/gnu/libexec/uucp/common_sources/uucp.h index 5faa63c120b6..46369108f93a 100644 --- a/gnu/libexec/uucp/common_sources/uucp.h +++ b/gnu/libexec/uucp/common_sources/uucp.h @@ -1,7 +1,7 @@ /* uucp.h Header file for the UUCP package. - Copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor + Copyright (C) 1991, 1992, 1993, 1994, 1995 Ian Lance Taylor This file is part of the Taylor UUCP package. @@ -17,10 +17,10 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. The author of the program may be contacted at ian@airs.com or - c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139. + c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144. */ /* Get the system configuration parameters. */ @@ -78,10 +78,7 @@ typedef SIG_ATOMIC_T sig_atomic_t; #endif /* ! HAVE_SIG_ATOMIC_T_IN_SIGNAL_H && ! HAVE_SIG_ATOMIC_T_IN_TYPES_H */ -/* Make sure we have size_t. We use int as the default because the - main use of this type is to provide an argument to malloc and - realloc. On a system which does not define size_t, int is - certainly the correct type to use. */ +/* Make sure we have size_t. */ #if ! HAVE_SIZE_T_IN_STDDEF_H && ! HAVE_SIZE_T_IN_TYPES_H #ifndef SIZE_T #define SIZE_T unsigned @@ -220,8 +217,8 @@ typedef FILE *openfile_t; #define ffileisopen(e) ((e) != NULL) #define ffileeof(e) feof (e) #define cfileread(e, z, c) fread ((z), 1, (c), (e)) -#define ffilereaderror(e, c) ferror (e) #define cfilewrite(e, z, c) fwrite ((z), 1, (c), (e)) +#define ffileioerror(e, c) ferror (e) #ifdef SEEK_SET #define ffileseek(e, i) (fseek ((e), (long) (i), SEEK_SET) == 0) #define ffilerewind(e) (fseek ((e), (long) 0, SEEK_SET) == 0) @@ -236,33 +233,48 @@ typedef FILE *openfile_t; #endif #define ffileclose(e) (fclose (e) == 0) +#define fstdiosync(e, z) (fsysdep_sync (e, z)) + #else /* ! USE_STDIO */ +#if ! USE_TYPES_H +#undef USE_TYPES_H +#define USE_TYPES_H 1 +#include <sys/types.h> +#endif + #if HAVE_UNISTD_H #include <unistd.h> #endif +#ifdef OFF_T +typedef OFF_T off_t; +#undef OFF_T +#endif + typedef int openfile_t; #define EFILECLOSED (-1) #define ffileisopen(e) ((e) >= 0) #define ffileeof(e) (FALSE) #define cfileread(e, z, c) read ((e), (z), (c)) -#define ffilereaderror(e, c) ((c) < 0) #define cfilewrite(e, z, c) write ((e), (z), (c)) +#define ffileioerror(e, c) ((c) < 0) #ifdef SEEK_SET -#define ffileseek(e, i) (lseek ((e), (long) i, SEEK_SET) >= 0) -#define ffilerewind(e) (lseek ((e), (long) 0, SEEK_SET) >= 0) +#define ffileseek(e, i) (lseek ((e), (off_t) i, SEEK_SET) >= 0) +#define ffilerewind(e) (lseek ((e), (off_t) 0, SEEK_SET) >= 0) #else -#define ffileseek(e, i) (lseek ((e), (long) i, 0) >= 0) -#define ffilerewind(e) (lseek ((e), (long) 0, 0) >= 0) +#define ffileseek(e, i) (lseek ((e), (off_t) i, 0) >= 0) +#define ffilerewind(e) (lseek ((e), (off_t) 0, 0) >= 0) #endif #ifdef SEEK_END -#define ffileseekend(e) (lseek ((e), (long) 0, SEEK_END) >= 0) +#define ffileseekend(e) (lseek ((e), (off_t) 0, SEEK_END) >= 0) #else -#define ffileseekend(e) (lseek ((e), (long) 0, 2) >= 0) +#define ffileseekend(e) (lseek ((e), (off_t) 0, 2) >= 0) #endif #define ffileclose(e) (close (e) >= 0) +#define fstdiosync(e, z) (fsysdep_sync (fileno (e), z)) + #endif /* ! USE_STDIO */ /* A prototype for main to avoid warnings from gcc 2.0 diff --git a/gnu/libexec/uucp/common_sources/uudefs.h b/gnu/libexec/uucp/common_sources/uudefs.h index f957ee636c16..2b45502b6260 100644 --- a/gnu/libexec/uucp/common_sources/uudefs.h +++ b/gnu/libexec/uucp/common_sources/uudefs.h @@ -1,7 +1,7 @@ /* uudefs.h Miscellaneous definitions for the UUCP package. - Copyright (C) 1991, 1992, 1993 Ian Lance Taylor + Copyright (C) 1991, 1992, 1993, 1995 Ian Lance Taylor This file is part of the Taylor UUCP package. @@ -17,10 +17,10 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. The author of the program may be contacted at ian@airs.com or - c/o Cygnus Support, Building 200, 1 Kendall Square, Cambridge, MA 02139. + c/o Cygnus Support, 48 Grove Street, Somerville, MA 02144. */ #if ANSI_C @@ -93,6 +93,9 @@ struct sstatus long ilast; /* Number of seconds until a retry is permitted. */ int cwait; + /* String in status file. Only used when reading status file, not + when writing. May be NULL. Should be freed with ubuffree. */ + char *zstring; }; /* How long we have to wait for the next call, given the number of retries @@ -323,7 +326,7 @@ extern void ulog_close P((void)); extern void ustats P((boolean fsucceeded, const char *zuser, const char *zsystem, boolean fsent, long cbytes, long csecs, long cmicros, - boolean fmaster)); + boolean fcaller)); /* Close the statistics file. */ extern void ustats_close P((void)); @@ -349,11 +352,13 @@ extern int idebug_parse P((const char *)); /* Copy one file to another. */ extern boolean fcopy_file P((const char *zfrom, const char *zto, - boolean fpublic, boolean fmkdirs)); + boolean fpublic, boolean fmkdirs, + boolean fsignals)); /* Copy an open file to another. */ extern boolean fcopy_open_file P((openfile_t efrom, const char *zto, - boolean fpublic, boolean fmkdirs)); + boolean fpublic, boolean fmkdirs, + boolean fsignals)); /* Translate escape sequences in a buffer, leaving the result in the same buffer and returning the length. */ |
