1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-13 10:02:38 +00:00

Commit delta: current -> 1.06 + FreeBSD configuration

This commit is contained in:
Andrey A. Chernov 1995-08-19 21:30:30 +00:00
parent ea76f9453e
commit 6ec4b3339b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=10110
227 changed files with 10984 additions and 2541 deletions

View File

@ -1,3 +1,656 @@
Thu Aug 10 22:42:53 1995 Ian Lance Taylor <ian@airs.com>
* Released version 1.06.
* uuconf/tsinfo.c (_uuconf_itaylor_system_internal): Don't set
uuconf_fcall merely because uuconf_qtimegrade is not set. Check
values against _uuconf_unset, not NULL.
* trans.c (fgot_data): Only log when data comes in if fsendfile is
FALSE.
Wed Aug 9 20:52:29 1995 Ian Lance Taylor <ian@airs.com>
* Makefile.in (VERSION): Change to 1.06.
Tue Aug 1 20:13:36 1995 Ian Lance Taylor <ian@airs.com>
* uuconf/tsinfo.c (_uuconf_itaylor_system_internal): Set the fcall
field for the first alternate if it has some way of selecting a
port.
* Ard van Breemen: unix/serial.c (fsserial_hardflow): Add support
for NCR Tower using IRTS.
* policy.h (FSYNC_ON_CLOSE): Define.
* system.h (fsysdep_sync): Declare.
* uucp.h (fstdiosync): Define, twice.
* unix/sync.c: New file.
* copy.c (fcopy_open_file): Call fsysdep_sync.
* cu.c (icutake): Likewise.
* rec.c (frec_file_end): Likewise.
(frec_file_end): Call fstdiosync.
* uucp.c (uccopy): Likewise.
* uux.c (main): Likewise.
(uxadd_send_file): Likewise.
* unix/splcmd.c (zsysdep_spool_commands): Likewise.
* unix/Makefile.in (OBJS): Add sync.o.
(sync.o): New target.
* Peter Wemm: unix/filnam.c (fscmd_seq): Increase the delay each
time an attempt to lock LCK..SEQ fails.
* Peter Wemm: uustat.c (fsnotify): Escape a leading "From " when
including standard input in a mail message.
Mon Jul 31 22:45:23 1995 Ian Lance Taylor <ian@airs.com>
* unix/serial.c (fsserial_lockfile): In the HAVE_SVR4_LOCKFILES
case, increase the space allocated to print the major and minor
numbers.
Sun Jul 30 22:30:51 1995 Ian Lance Taylor <ian@airs.com>
* trans.c (fgot_data): Log a message as soon as anything comes in,
not just for file data.
* prote.c (feprocess_data): Handle a zero length file.
Wed Jul 19 00:14:46 1995 Ian Lance Taylor <ian@airs.com>
* unix/xqtfil.c (fSone_dir): New static variable.
(fsysdep_get_xqt_init): Add zsystem argument.
(zsysdep_get_xqt): Likewise.
(usysdep_get_xqt_free): Likewise.
* system.h (fsysdep_get_xqt_init): Update declaration.
(zsysdep_get_xqt): Likewise.
(usysdep_get_xqt_free): Likewise.
* uuxqt.c (main): Pass zdosys for system to get_xqt routines.
* uustat.c (fsexecutions): Pass NULL for system to get_xqt
routines.
(fsquery): Likewise.
* uux.c (main): If we are not starting uucico, and we queued a
local execution, start uuxqt.
Tue Jul 18 22:33:08 1995 Ian Lance Taylor <ian@airs.com>
* uuxqt.c (REMOVE_QINPUT): Define.
(uqdo_xqt_file): Set REMOVE_QINPUT if zQinput is in the spool
directory.
(isave_files): If REMOVE_QINPUT is set, save the input file.
(uqcleanup): If REMOVE_QINPUT and REMOVE_NEEDED are set, remove
the input file.
Mon Jul 17 20:59:20 1995 Ian Lance Taylor <ian@airs.com>
* uuchk.c (ukshow): Add missing \n.
Sun Jul 16 12:02:03 1995 Ian Lance Taylor <ian@airs.com>
* Makefile.in (TEXI2HTML): Define.
(doc-dist): Depend upon uucp.html; put HTML files in documentation
distribution.
(html, uucp.html): New targets.
Mon Jul 10 20:24:48 1995 Ian Lance Taylor <ian@airs.com>
* unix/lcksys.c: Rewrite to not truncate the system name in the
lock file name, unless HAVE_LONG_FILE_NAMES is 0.
Sat Jul 8 13:41:26 1995 Ian Lance Taylor <ian@airs.com>
* Andrey A. Chernov: cu.c (ucuhelp): Mention -E.
(fcudo_cmd): Use BUCHAR rather than casting to unsigned int.
(icuunrecogvar): Likewise.
(uculist_vars): Likewise.
(icuunrecogfn): Likewise.
* lib/getopt.c (_getopt_internal): Likewise.
* Andrey A. Chernov: Makefile.in (infodir): Changed commented out
setting from share/doc to share/info.
* Godfrey van der Linden: unix/serial.c (fsysdep_conn_io): Base
select or alarm timeout on connection speed.
* configure.in: Move AC_PREFIX_PROGRAM before AC_PROG_CC.
* configure: Rebuild.
* policy.h (HAVE_BROKEN_SETLKW): Add new define.
* unix/filnam.c (USE_POSIX_LOCKS): Don't set if HAVE_BROKEN_SETLKW
is set.
(fscmd_seq): If the F_SETLKW call returns EINVAL, revert to using
lock files.
* unix/spawn.c (ixsspawn): If setreuid is available, use it,
rather than setuid, to set the real user ID to the effective user
ID.
* Thomas Mechtersheimer: uuchk.c (main): Correct typo (iret for
iint).
* Bob Thrush: unix/serial.c (fsserial_hardflow): Correct typo
(c_cflags for c_cflag).
* configure.in: Check for sys/statvfs.h. Check for memset,
memcmp, and memcpy with the correct argument types (apparently
some systems require this).
* config.h.in (HAVE_SYS_STATVFS_H): Define.
* configure: Rebuild.
Mon Jul 3 00:26:50 1995 Ian Lance Taylor <ian@airs.com>
* Released version beta 1.06.
Sun Jul 2 10:39:40 1995 Ian Lance Taylor <ian@airs.com>
* configure.in: Add AC_OUTPUT code to touch stamp-h when
rebuilding config.h.
* Makefile.in (stamp-h): Remove ``echo > stamp-h''.
* Makefile.in (dist): Fix for srcdir != objdir.
* unix/Makefile.in (dist): Likewise.
* uuconf/Makefile.in (dist): Likewise.
* lib/Makefile.in (dist): Likewise.
Sat Jul 1 13:42:35 1995 Ian Lance Taylor <ian@airs.com>
* configure.in: Check for termios.h.
* config.h.in (HAVE_TERMIOS_H): Mention.
* policy.h: Set HAVE_POSIX_TERMIOS if HAVE_TERMIOS_H.
Fri Jun 30 09:24:13 1995 Ian Lance Taylor <ian@airs.com>
* uux.c (zXxqt_name): Remove.
(fXxqtlocal): New static variable; replaces local fxqtlocal.
(sXxqtsys): New static variable; replaces local sxqtsys.
(zXxqtloc): New static variable; replaces local zxqtloc.
(bXgrade): New static variable; replaces local bgrade.
(abXxqt_tname): New static variable; replaces local abxqt_tname.
(abXxqt_xname): New static variable; replaces local abxqt_xname.
(main): Use new static variables instead of locals. Don't set
zXxqt_name.
(uxadd_xqt_line): Get file name here before opening file.
(uxadd_send_file): Remove parameters qxqtsys, zxqtloc, and bgrade.
Change all callers.
* unix/filnam.c (usput62): New static function.
(zscmd_file): When SPOOLDIR_TAYLOR, use a different algorithm
which does not read the sequence file.
* unix/splcmd.c (zsysdep_spool_commands): Return value of
zscmd_file might already exist; handle that case.
* unix/jobid.c (zsfile_to_jobid): Change jobid format when
SPOOLDIR_TAYLOR, since sequence number is now much longer.
(zsjobid_to_file): Corresponding change.
* unix/work.c (fswork_file): When SPOOLDIR_TAYLOR, don't require
the the file name to be 7 characters long.
(bsgrade): Change algorithm used when SPOOLDIR_TAYLOR.
* uustat.c (fsworkfile_show): Correct kill prompt to put program
name at start of line. Add trailing space after question mark.
(fsexecutions): Likewise.
* unix/work.c (fsysdep_get_work): Don't call fsysdep_get_work_init
if no more jobs are found.
Thu Jun 29 15:27:31 1995 Ian Lance Taylor <ian@airs.com>
* fsusg.c: Update with changes from fileutils 3.12.
* configure.in: Update filesystem space tests to fileutils 3.12.
* config.h.in: Corresponding changes.
* unix/filnam.c (fscmd_seq): If F_SETLKW fails with ENOMEM,
ENOSPC, or ENOLCK, sleep and try again.
* Makefile.in (MORECFLAGS): Remove unused SBINDIR definition.
* unix/Makefile.in (run.o): Add dependency on Makefile and
../Makefile, so that it is rebuilt if sbindir changes.
* uuconf/Makefile.in (callin.o): Add dependency on Makefile and
../Makefile, so that it is rebuilt if NEWCONFIGLIB or OLDCONFIGLIB
change.
(hinit.o, hrmunk.o, maxuxq.o, rdperm.o, tinit.o): Likewise.
(vinit.o): Likewise.
* cu.c (main, ucuhelp): Update copyright.
* tstuu.c (main): Likewise.
* uuchk.c (main, ukhelp): Likewise.
* uucico.c (main, uhelp): Likewise.
* uuconv.c (main, uvhelp): Likewise.
* uucp.c (main, uchelp): Likewise.
* uulog.c (main, ulhelp): Likewise.
* uuname.c (main, unhelp): Likewise.
* uupick.c (main, uphelp): Likewise.
* uustat.c (main, ushelp): Likewise.
* uux.c (main, uxhelp): Likewise.
* uuxqt.c (main, uqhelp): Likewise.
* Makefile.in (VERSION): Update to beta1.06.
Wed Jun 28 10:36:35 1995 Ian Lance Taylor <ian@airs.com>
* trans.c (struct scharge, sTsend, sTreceive): Remove.
(qTtiming_rec, iTrecsecs, iTrecmicros): New static variables.
(fqueue_receive): If adding something to an empty receive queue,
update iTrecsecs and iTrecmicros.
(utransfree): Remove references to sTsend and sTreceive. If
freeing qTtiming_rec, clear it.
(ftcharge): Remove. Remove all calls to it.
(fttime): New static function.
(uclear_queue): Clear qTtiming_rec.
(floop): Add timing code to replace ftcharge.
(fgot_data): Likewise.
(ftadd_cmd): Set s.bcmd to 'H' for a hangup request, for better
debugging information.
(ufailed): Remove setting of iTchecktime and calls to ftcharge.
* uuconf.h (UUCONF_STRIP_LOGIN): Define.
(UUCONF_STRIP_PROTO): Define.
(uuconf_strip): Declare.
* uuconf/strip.c: New file, definining uuconf_strip.
* uuconf/Makefile.in (OBJS): Add strip.o.
* uuconf/uucnfi.h (struct sprocess): Add new fields fstrip_login
and fstrip_proto.
* uuconf/iniglb.c (_uuconf_iinit_global): Initialize new fields.
* uuconf/tinit.c (asCmds): Add "strip-login" and "strip-proto".
* uucico.c (fdo_call): Check whether protocol commands should be
stripped, and pass information to zget_uucp_cmd.
(faccept_call): Likewise.
(flogin_prompt): Check whether login commands should be stripped,
and pass information to zget_typed_line.
(zget_uucp_cmd): Add fstrip argument, and use it to control
whether incoming characters are stripped.
(zget_typed_line): Likewise.
* uuchk.c (main): Report uuconf_strip information.
Mon Jun 26 17:57:14 1995 Ian Lance Taylor <ian@airs.com>
* uuchk.c (main): Report global configuration information.
* uux.c (main): If an attempt is made to execute an empty command,
just create a poll file instead.
* uupick.c (main): Mention 'd' as a possible command.
Wed Jun 21 16:16:13 1995 Ian Lance Taylor <ian@airs.com>
* unix/filnam.c (fscmd_seq): If available, use POSIX style locking
for the sequence file. Use IPRIVATE_FILE_MODE when creating the
sequene file.
* copy.c (fcopy_file): Add fsignals argument, and pass it to
fcopy_open_file. Update all callers.
(fcopy_open_file): Add fsignals argument; if TRUE, check for
signals while copying the file. Update all callers.
* uudefs.h (fcopy_file, fcopy_open_file): Update prototypes.
Thu Jun 15 20:34:00 1995 Ian Lance Taylor <ian@airs.com>
* Rob Janssen: getopt.h: Don't fail if P is not defined because
this file got included by something other than uucp.h.
Tue Jun 6 13:17:14 1995 Ian Lance Taylor <ian@airs.com>
* log.c (ulog): Always open the log file even if zmsg is NULL.
* unix/detach.c (usysdep_detach): Call ulog with NULL before
closing stderr.
* log.c (ulog): Print file name correctly under HDB_LOGGING if an
error occurs.
* Andrey A. Chernov: uucp.h: Use off_t rather than long when
casting arguments to lseek.
* proti.c (IMAXPACKSIZE): Subtract one.
(fijstart): Correct iIforced_remote_packsize check.
* unix/filnam.c (zsfile_name): Only use remote system name in
local filename for SPOOLDIR_SVR4, not for SPOOLDIR_HDB.
* Peter da Silva: cu.c (asCulongopts): Add "escape".
(main): Handle -E/--escape.
* cu.1: Document -E/--escape.
* unix/cusub.c (fsysdep_cu): Don't treat \0 as an escape
character.
* Takatoshi Ikeda: log.c (ustats): Base 'M' vs. 'S' in HDB_LOGGING
on fcaller, not on fmaster.
(zldate_and_time): In HDB_LOGGING, don't zero fill the hour.
* uudefs.h (ustats): Change argument name in prototype.
* send.c (fsend_await_confirm): Pass fcaller rather than fmaster
to ustats.
* rec.c (frec_file_end): Likewise.
* trans.c (ufailed): Likewise.
* unix/tcp.c: Include <arpa/inet.h>.
(ftcp_dial): If gethostbyname fails, try inet_addr.
* Jim Brownfield: unix/detach.c (usysdep_detach): Call TIOCNOTTY
on /dev/tty, not on file descriptor 0.
* uuchk.c (ukshow): If the system will never be called, say so
explicitly.
* unix/pause.c (usysdep_pause): When using poll, clear the sdummy
structure before passing it down.
* unix/bytfre.c (csysdep_bytes_free): Check for overflow.
* C.A. Lademann: cu.c (asCulongopts): Add "nostop".
(main): Handle --nostop.
(ucuhelp): Mention --nostop.
* cu.1: Document --nostop.
* Dean Edmonds: cu.c (fcuset_var): Copy string before calling
uuconf_cmd_args, and handle UUCONF_CMDTABRET_KEEP correctly.
* Jorge Cwik: Add support for 'y' protocol.
* proty.c: New file, written by Jorge Cwik.
* prot.h: Declare 'y' protocol functions.
* uucico.c (asProtocols): Add entry for 'y' protocol.
* Makefile.in (UUOBJS): Add proty.o.
(ALLOBJS): Add proty.o.
(proty.o): New target.
Mon Jun 5 12:05:22 1995 Ian Lance Taylor <ian@airs.com>
* cu.c (main): Don't clobber user specified ibaud when a specific
system is being called.
* unix/serial.c (fsysdep_stdin_init): chmod /dev/tty to 0600 to
prevent other users from writing to it.
* uux.c (main): If the argument is quoted by parentheses, don't
break it at shell separator characters.
* protg.c (fgprocess_data): Don't treat a duplicate RR as an RJ if
we are retransmitting packets. Corrects change of May 15, 1993.
* unix/lock.c (fsdo_lock): Log an error message if the LOCKFILES
define appears to not match the contents of the lock file.
Sun Jun 4 14:25:43 1995 Ian Lance Taylor <ian@airs.com>
* Makefile.in (uucp.info): Use explicit $(srcdir) rather than $<.
(uucp.dvi): Likewise.
(uucp.ps): Use uucp.dvi rather than $<.
* Scott Guthridge: cu.c (icutake): Skip \r characters unless
fCuvar_binary is set.
* unix/status.c (fsysdep_get_status): Ignore double quotes around
description string in status file.
(fsysdep_set_status): If SPOOLDIR_SVR4, put double quotes around
description string.
* uustat.c (fsxqt_file_read): Change second argument from file
name to open file.
(fsworkfile_show): Make sure execution file can be opened before
displaying information in execution file format.
(fsexecutions): Open file before passing it to fsxqt_file_read.
* uucp.h (ffileioerror): Rename from ffilereaderror.
* cu.c (icuput): Corresponding change.
* trans.c (floop): Likewise.
(fgot_data): Use ffileioerror to decide whether to print message
using errno.
* uuconv.c (uvwrite_taylor_port): Fix handling of dialer-sequence
for a modem port to actually print ``dialer-sequence''.
* uuconf/hsinfo.c (_uuconf_ihdb_system_internal): Treat a syntax
error in the time field as equivalent to ``never''.
* uuconf/vsinfo.c (_uuconf_iv2_system_internal): Likewise.
* uuchk.c (ukshow): Print max-retries information.
* Don Phillips: Add support for new called-timegrade command.
* uuconf.h (struct uuconf_system): Add uuconf_qcalledtimegrade
field.
* uuconf/tsinfo.c (asIcmds): Add "called-timegrade".
* uuconf/syssub.c (SYSTEM_TIMESPANS): Add uuconf_qcalledtimegrade.
* trans.c (fqueue): Check uuconf_qcalledtimegrade.
* uuchk.c (ukshow): Print called-timegrade and success-wait
information.
* uuconv.c (uvwrite_taylor_system): Handled called-timegrade.
* unix/xqtsub.c (fsysdep_lock_uuxqt_dir): Accept EISDIR.
* Damon: unix/mkdirs.c (fsysdep_make_dirs): Accept EROFS.
Sat May 27 09:55:38 1995 Ian Lance Taylor <ian@airs.com>
* unix/detach.c (usysdep_detach): Mention routine name in
debugging message.
* tstuu.c (main): Exit with an error message if not compiled with
HAVE_TAYLOR_CONFIG.
* Jim Avera: Makefile.in (install-info): Get the info files from
the source directory if they aren't in the object directory.
* uuchk.c (main): Accept -s to only print information for a
specific system.
(asKlongopts): Add --system as a synonym for -s.
(ukusage): Mention -s.
(ukhelp): Likewise.
* Makefile.in (uuconf/libuuconf.a): Depend upon config.h.
(unix/libunix.a, lib/libuucp.a): Likewise.
* Matthias Urlichs and Olaf Kirch: If an execution fails, save the
files.
* sysh.unx (FAILEDDIR): Define.
* system.h (zsysdep_save_failed_file): Declare.
* uuxqt.c (uqdo_xqt_file): Call isave_files if an execution fails.
Move the execution files out of the execution directory on any
failure, not just a temporary one.
(isave_files): New function; pass all the execution files to
zsysdep_save_failed_file, and send mail to OWNER.
* unix/failed.c: New file.
* unix/Makefile.in (OBJS): Add failed.o.
(failed.o): New target.
* Johannes Stille: Remove various race conditions, as follows:
* rec.c (flocal_rec_send_request): Don't free qtrans if pfsendcmd
fails.
(fremote_send_reply): Likewise.
(fremote_send_fail_send): Move pfsendcmd call to the end of the
routine, after everything else has been done.
(frec_file_send_confirm): Likewise.
* send.c (struct ssendinfo): Add new fields fnever and zconfirm.
(flocal_send_fail): Remove first argument; change all callers.
(usfree_send): Free new zconfirm field.
(flocal_send_file_init): Initialize new zconfirm field.
(fremote_rec_file_init): Likewise.
(flocal_send_request): Free qtrans explicitly, rather than
expecting flocal_send_fail to do it.
(flocal_send_request): Don't free qtrans if pfsendcmd fails.
(flocal_send_await_reply): Use new fnever field rather than
overloading fsent.
(flocal_send_cancelled): Likewise.
(flocal_send_await_reply): Set fcmd field to TRUE.
(fremote_rec_reply): Set fcmd field to TRUE. Set qtrans->zlog
before calling pfsendcmd. Don't free qtrans if pfsendcmd fails.
(fremote_rec_fail_send): Move pfsendcmd call to the end of the
routine, after everything else has been done.
(fsend_file_end): If zconfirm is set, call fsend_await_confirm.
Don't bother to set fcmd here.
(fsend_await_confirm): If fsent is not set, just save command in
zconfirm and return.
(fsend_exec_file_init): Free and clear new zconfirm field.
* xcmd.c (flocal_xcmd_request): Don't free qtrans if pfsendcmd
fails.
* unix/pause.c: Prefer any of the other choices to nap, since the
meaning of nap argument varies from system to system, and the user
may not set HAVE_HUNDREDTHS_NAP correctly.
* unix/cusub.c (fsysdep_shell): When starting up an interactive
shell, use the environment variable SHELL rather than /bin/sh.
Fri May 26 00:03:46 1995 Ian Lance Taylor <ian@airs.com>
* Chip Salzenberg: uulog.c (main): Set cluser, not clsys, when
using HAVE_HDB_LOGGING.
* Robert Joop: uuconf/callin.c (uuconf_callin): Improve handling
of Unix style passwd files.
* uupick.c (main): Don't fail if we can't get system information,
since uupick is not setuid.
* Stephen Harris: uudefs.h (struct sstatus): Add new field
zstring.
* unix/status.c (fsysdep_get_status): Set zstring field.
* uustat.c (fsquery_show): Print and free zstring field, if set,
rather than indexing off type.
(fsmachines): Likewise.
* uucico.c (fcall): Free sstat.zstring.
* proti.c (cIwindow_timeout): New static variable.
(fijstart): Initialize cIwindow_timeout based on the window size
and connection speed. Increment both timeouts in callee.
(fishutdown): Initialize cIwindow_timeout.
(fiwindow_wait): Use cIwindow_timeout rather than cItimeout.
* unix/serial.c (fsysdep_conn_io): Try using select before doing a
blocking write, and use an alarm if we fall back to the blocking
write, to try to avoid deadlock when both systems fill the pipe.
* Trever Miller: unix/lock.c (fsdo_lock): Fix use of inid where
inme was intended, in HAVE_QNX_LOCKFILES code.
* unix/lock.c (fsdo_lock): Treat an empty lock file as stale.
Thu May 25 11:46:32 1995 Ian Lance Taylor <ian@airs.com>
* Kenji Rikitake: unix/serial.c (fsserial_hardflow): Handle
CRTS_IFLOW as used on BSDI.
* Gerriet M. Denkmann: uuconf/vsnams.c (uuconf_v2_system_names):
Accept continuation lines in L.sys.
* uuconf/vsinfo.c (_uuconf_iv2_system_internal): Skip comment
lines in L.cmds. Ignore everything after comma in L.cmds lines.
* Gerriet M. Denkmann: unix/ftw.c (ftw_dir): Initialize newlev to
avoid warning.
* Paul Pryor: unix/tli.c (ftli_open): Swap real and effective user
ID's when running as a server, so that root can bind privileged
ports.
* unix/tcp.c (ftcp_open): Call fsuser_perms and fsuucp_perms
rather than having the same code inline.
* sysh.unx (fsuser_perms, fsuucp_perms): Declare.
* unix/ufopen.c (fsuser_perms, fsuucp_perms): Move into uid.c.
* unix/uid.c: New file.
* unix/Makefile.in (OBJS): Add uid.o.
(uid.o): New target.
* unix/tcp.c: Move tcp.c into unix subdirectory.
* unix/tli.c: Likewise for tli.c.
* Makefile.in (UUOBJS, CUOBJS, ALLOBJS): Remove tcp.o and tli.o.
(tcp.o, tli.o): Remove.
* unix/Makefile.in (OBJS): Add tcp.o and tli.o.
(tcp.o, tli.o): New targets.
* Paul Pryor: configure.in: Check for -lnsl_s before -lnsl.
* Makefile.in (prefix): Use @prefix@, not /usr/local.
(exec_prefix): New variable, set to @exec_prefix@.
(sbindir, bindir): Use $(exec_prefix) rather than $(prefix).
(CPPFLAGS): New variable, set to @CPPFLAGS@.
(@SET_MAKE@): New macro used by autoconf 2.
(MORECFLAGS): Put -I. before -I$(srcdir).
(MDEFINES): Pass down CPPFLAGS.
(.c.o): Use CPPFLAGS.
(uuconv.o): Likewise.
(distclean): Remove stamp-h, config.log and config.cache.
(maintainer-clean): New synonym for realclean.
(configure, config.h, stamp-h, Makefile, config.status): Rewrite
as suggested by autoconf 2.3.
(.PHONY): Add maintainer-clean.
* lib/Makefile.in (CPPFLAGS): New variable, set to @CPPFLAGS@.
(MORECFLAGS): Put `-I..' before `-I$(srcdir)/..'.
(maintainer-clean): New synonym for realclean.
(.c.o): Use CPPFLAGS.
(Makefile): Just rebuild this Makefile, not the others.
(.PHONY): Add maintainer-clean.
* unix/Makefile.in (CPPFLAGS): New variable, set to @CPPFLAGS@.
(prefix): Removed.
(sbindir): Use @exec_prefix@ rather than $(prefix).
(MORECFLAGS): Put `-I..' before `-I$(srcdir)/..'.
(maintainer-clean): New synonym for realclean.
(.c.o): Use CPPFLAGS.
(Makefile): Just rebuild this Makefile, not the others.
(.PHONY): Add maintainer-clean.
* uuconf/Makefile.in (prefix): Set to @prefix@, not /usr/local.
(CPPFLAGS): New variable, set to @CPPFLAGS@.
(MORECFLAGS): Put `-I.' before `-I$(srcdir)' and `-I..' before
`-I$(srcdir)/..'.
(maintainer-clean): New synonym for realclean.
(.c.o): Use CPPFLAGS.
(Makefile): Just rebuild this Makefile, not the others.
(.PHONY): Add maintainer-clean.
* configure.in: Extensive changes for autoconf 2.3.
* configure: Regenerate using autoconf 2.3.
* install-sh: New file.
Mon May 22 22:18:59 1995 Ian Lance Taylor <ian@airs.com>
* Mister Flash: chat.c (fcsend): Don't get forget to add 10 in \x.
Tue Jan 17 22:49:05 1995 Ian Lance Taylor <ian@airs.com>
* unix/mkdirs.c (fsysdep_make_dirs): Don't get confused by a
double slash.
Wed Aug 10 09:25:10 1994 Ian Lance Taylor (ian@airs.com)
* uuconf/hport.c (uuconf_hdb_find_port): Set iret to
UUCONF_SUCCESS when a port is found.
Tue Aug 2 08:57:05 1994 Ian Lance Taylor (ian@airs.com)
* trans.c (ftadd_cmd): Report a 'P' (poll) command as garbled.
Wed Jul 20 21:53:03 1994 Ian Lance Taylor (ian@airs.com)
* rec.c (flocal_rec_file_init): Set name of local system after
calling uuconf_system_local.
* uustat.c (fsexecutions): Likewise.
Sat Jul 16 16:54:12 1994 Ian Lance Taylor (ian@airs.com)
* log.c (ulog): Use strerror in message about being unable to open
the log file.
Wed Jul 13 00:44:33 1994 Ian Lance Taylor (ian@airs.com)
* rec.c (fremote_send_reply): Set qinfo->freplied before sending
the command.
Sun Jul 10 23:25:23 1994 Ian Lance Taylor (ian@airs.com)
* Tin Le: lib/debug.c (udebug_buffer): Only compile if DEBUG > 1.
Mon Jun 27 21:06:29 1994 Ian Lance Taylor (ian@airs.com)
* uuconf.h (UUCONF_CMDTABFLAG_NOCOMMENTS): Define.
* uuconf/cmdlin.c (uuconf_cmd_line): Handle NOCOMMENTS.
* uuxqt.c (uqdo_xqt_file): Pass NOCOMMENTS to uuconf_cmd_file.
Thu May 19 22:50:37 1994 Ian Lance Taylor (ian@airs.com)
* Ollivier Robert: unix/mkdirs.c: Permit EISDIR.
Wed May 18 23:15:36 1994 Ian Lance Taylor (ian@airs.com)
* uucico.c (fcall): Reset sDaemon fields each time through the
loop, not just once.
Thu May 5 23:15:11 1994 Ian Lance Taylor (ian@airs.com)
* Released version 1.05.

View File

@ -16,7 +16,7 @@ LIBUUCP= $(.CURDIR)/../libuucp/obj/libuucp.a
LIBUUCP= $(.CURDIR)/../libuucp/libuucp.a
.endif
VERSION= 1.05
VERSION= 1.06
owner= uucp
group= uucp
bindir= /usr/bin

View File

@ -1,3 +1,38 @@
Changes in version 1.06:
As usual, many bugs were fixed.
Support was added for the 'y' protocol, contributed by Jorge Cwik,
the designer of the protocol.
The name of command files was changed when using SPOOLDIR_TAYLOR;
they now use a much longer sequence number. This affects the
jobid strings reported by uustat. The change makes uux and uucp
more efficient.
Added ``called-timegrade'' command to sys file.
Added --nostop and -E/--escape options to cu.
Added -s option to uuchk.
Added ``strip-login'' and ``strip-proto'' commands to config file.
uux will now create a poll file if invoked as ``uux SYSTEM!''.
If an execution fails, the data file is saved, if there is enough
free disk space.
uux now uses POSIX file locking, if available, when locking the
sequence file.
The man pages were incorporated into the Texinfo manual.
The UUCP Internals FAQ was incorporated into the Texinfo manual.
The spool directory layout is now documented in the Texinfo
manual.
Changes in version 1.05:
As usual, many bugs were fixed.

View File

@ -1,25 +1,27 @@
This is the README file for version 1.05 of the Taylor UUCP package.
This is the README file for version 1.06 of the Taylor UUCP package.
It was written by Ian Lance Taylor. I can be reached at ian@airs.com,
or, equivalently, uunet!cygint!airs!ian, or c/o Cygnus Support,
Building 200, 1 Kendall Square, Cambridge MA, 02139, USA.
48 Grove Street, Somerville, MA 02144, USA.
There is a mailing list for discussion of the package. To join (or
get off) the list, send mail to taylor-uucp-request@gnu.ai.mit.edu.
Mail to this address is answered by a person, not a program. When
joining the list, make sure you include the address at which you want
to receive mail in the body of your message. To send a message to the
list, send it to taylor-uucp@gnu.ai.mit.edu.
Jeff Ross has volunteered to maintain patches for UUCP releases. They
may be obtained via anonymous FTP from ftp.fdu.edu, in the directory
pub/taylor-uucp.
There is a mailing list for discussion of the package. The list is
hosted by Eric Schnoebelen at cirr.com. To join (or get off) the
list, send mail to taylor-uucp-request@cirr.com. Mail to this address
is answered by the majordomo program. To join the list, send the
message ``subscribe ADDRESS'' where ADDRESS is your e-mail address.
To send a message to the list, send it to taylor-uucp@cirr.com. The
old list address, taylor-uucp@gnu.ai.mit.edu, will also work. There
is an archive of all messages sent to the mailing list at ftp.cirr.com.
This package is covered by the Gnu Public License. See the file
COPYING for details. If you would like to do something with this
package that you feel is reasonable but you feel is prohibited by the
license, contact me to see if we can work it out.
The most recent version may be obtained from any Gnu archive site.
The canonical site is prep.ai.mit.edu. There are many mirror sites,
including ftp.uu.net and wuarchive.wustl.edu.
WHAT IT IS
This is the complete source code for a Unix UUCP package. It provides
@ -32,11 +34,11 @@ file to another) and tstuu (a test harness for the package).
This is the standard UUCP package of the Free Software Foundation.
The package currently supports the 'f', 'g' (in all window and packet
sizes), 'G', 't' and 'e' protocols, as well a Zmodem protocol and two
new bidirectional protocols. If you have a Berkeley sockets library,
it can make TCP connections. If you have TLI libraries, it can make
TLI connections. It supports a new configuration file mechanism which
I like (but other people dislike).
sizes), 'G', 't' and 'e' protocols, as well a Zmodem protocol, the FX
UUCICO 'y' protocol, and two new bidirectional protocols. If you have
a Berkeley sockets library, it can make TCP connections. If you have
TLI libraries, it can make TLI connections. It supports a new
configuration file mechanism which I like (but other people dislike).
The package has a few advantages over regular UUCP:
@ -86,7 +88,7 @@ The documentation is in the file uucp.texi, which is a Texinfo file.
Texinfo is a format used by the Free Software Foundation. You can
print the documentation using TeX in combination with the file
texinfo.tex. DVI, PostScript and info versions of the documentation
are available in a separate package, uucp-doc-1.05.tar.gz.
are available in a separate package, uucp-doc-1.06.tar.gz.
See the TODO file for things which should be done. Please feel free
to do them, although you may want to check with me first. Send me
@ -105,7 +107,6 @@ The compilation instructions are in uucp.texi. Here is a summary.
LDFLAGS: Flags to pass to $CC when only linking; default none
LIBS: Library arguments to pass to $CC; default none
INSTALL: Install program; default install -c or cp
INSTALLDATA: Install data; default install -c -m 0644 or cp
The configure script will compile a number of test programs to see
what is available on your system, so if your system is at all
unusual you will need to pass in $CC and $LIBS correctly.
@ -135,7 +136,8 @@ The compilation instructions are in uucp.texi. Here is a summary.
the default value for CFLAGS to be set incorrectly. If ``echo
${CFLAGS--g}'' echoes ``g'' rather than ``-g'', then you must set
CFLAGS in the environment before running configure. There is a
patch available from BSDI for this bug. (From David Vrona).
patch available from BSDI for this bug. (Reported by David
Vrona).
On AIX 3.2.5, and possibly other versions, cc -E does not work,
reporting ``Option NOROCONST is not valid.'' Test this before
@ -145,7 +147,7 @@ The compilation instructions are in uucp.texi. Here is a summary.
This may give a warning about the file being empty, but it should
not give the ``Option NOROCONST'' warning. The workaround is to
remove the ",noroconst" entry from the "options" clause in the
"cc" stanza in /etc/xlc.cfg. (From Chris Lewis).
"cc" stanza in /etc/xlc.cfg. (Reported by Chris Lewis).
Examine config.h and Makefile to make sure they're right.
@ -160,3 +162,12 @@ The compilation instructions are in uucp.texi. Here is a summary.
programs are compiled with debugging information, and they are not
stripped when they are installed. Read the man page for strip for
more information.
On older System V based systems which do not have the setreuid
system call, problems may arise if ordinary users can start an
execution of uuxqt, perhaps indirectly via uucp or uux. UUCP jobs
may wind up executing with a real user ID of the user who invoked
uuxqt, which can cause problems if the UUCP job checks the real
user ID for security purposes. On such systems, it is safest to
put ``run-uuxqt never'' in the `config' file, so that uucico never
starts uuxqt, and invoke uuxqt directly from cron.

View File

@ -387,11 +387,6 @@ fancy.
Nickolay Saukh: use a default port for cu, you can just do ``cu
number''.
178.
Don Phillips: should there be some way to restrict of grade of
transfers even when the other system places the call?
180.
Nickolay Saukh: if we have received a partial file, request the remote
@ -740,3 +735,43 @@ parameters, but it would be nice if this were dealt with somehow.
Andrew A. Chernov: Perhaps uuxqt should log when it terminates.
237.
dialer-sequence doesn't really do the right thing. There is no way to
specify both the TCP address and a phone number.
238.
cu -t doesn't work at all. It does nothing.
239.
Paul Pryor: Perhaps a service command should be added to the sys and
port files. This command would be used as ``service cu'' to indicate
that the system or port was only available to cu, not to UUCP.
240.
Tim Iverson: The 'g' and 'i' protocol code tends to parse data packet
headers twice. It processes them once to find out how large the
packet is, waits for that data to arrive, and then processes the
header again the second time around. It would be possible to avoid
this by changing the code to be a simple state machine which
remembered where it was in the process of parsing the packet.
241.
Klaus Dahlenburg: Log a more precise reason for failure in the .Status
file: e.g., all ports in use, no matching ports, etc.
242.
Steven S. Dick: It would be helpful if there was a way to get uuchk to
dump the data from ports/dialers/etc that was NOT picked up from the
sys file. In other words, add some option to scan the port file and
the dial file, presumably using uuconf_find_port for the former and
uuconf_dialer_names for the latter.
243.
Kai Michael Kretschmann: Add a configure option to drop the connection
if jobs are coming in too slowly, indicating a bad connection.

View File

@ -1,4 +1,4 @@
Version 1.05
Version 1.06
a complete, unmodified version of this program is available from
prep.ai.mit.edu.

View File

@ -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;

View File

@ -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. */

View File

@ -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;

View File

@ -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

View File

@ -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)

View File

@ -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. */

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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>

View File

@ -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));

View File

@ -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));

View File

@ -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")

View File

@ -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. */

View File

@ -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>

View File

@ -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,

View File

@ -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

View File

@ -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. */

View File

@ -1,10 +1,10 @@
/* Wrapper code for Taylor UUCP on Amiga Unix (SVR4) for cron invoked UUCP */
/* processes. */
/* The problem: Cron is not a "licensed" process. any process that grabs a
/* The problem: Cron is not a "licensed" process. any process that grabs a
controlling terminal needs to be licensed. Taylor UUCP needs controlling
terminals. Taylor UUCP does relinquish the controlling terminal before
fork(), so the "UUCP" license is appropriate.
terminals. Taylor UUCP does relinquish the controlling terminal before
fork(), so the "UUCP" license is appropriate.
This simple program does the "right" thing, but *MUST* be SETUID ROOT */
/* Written by: Lawrence E. Rosenman <ler@lerami.lerctr.org> */
@ -36,7 +36,7 @@ int main(int argc,char *argv[],char *envp)
exit(1);
}
setgid(pw->pw_gid); /* set gid to uucp */
setuid(pw->pw_uid); /* set uid to uucp */
setuid(pw->pw_uid); /* set uid to uucp */
argv[0]=name; /* have PS not lie... */
execv("/usr/local/lib/uucp/uucico",argv); /* go to the real program */
exit(errno);

View File

@ -86,7 +86,7 @@ main(int argc,char *argv[])
int child; /* pid of child process */
int stat; /* exit status of child process */
char *temp; /* used to get basename of dialer */
if(argc!=5)
{
fprintf(stderr,kUsage,argv[0],argv[0]);
@ -95,9 +95,9 @@ main(int argc,char *argv[])
dialerPath=argv[1];
dialerName= (temp=strrchr(argv[1],'/'))!=NULL ? temp+1 : argv[1];
parent=getpid();
signal(SIGUSR1,badExec); /* set up for possible failed exec */
if((child=fork())<0)
@ -111,7 +111,7 @@ main(int argc,char *argv[])
signal(SIGHUP,SIG_IGN);
signal(SIGINT,SIG_IGN);
signal(SIGTERM,SIG_IGN);
wait(&stat); /* wait for child to exit */
exit(figureStat(stat)); /* figure out our exit code and die */
}
@ -125,7 +125,7 @@ main(int argc,char *argv[])
kill(parent,SIGUSR1);
exit(0);
}
}
}
exit(0);
}
@ -136,7 +136,7 @@ int figureStat(int stat)
int exit;
int errFlag;
int error;
if(WIFSIGNALED(stat)) /* determine if exit was from signal or what */
{
fprintf(stderr,"Error: Dialer %s recieved signal %d.\n",dialerName,

View File

@ -21,3 +21,5 @@ find $(spooldir) -ctime +8 -name '[CDX].*' -print -exec rm -f \{\} \;
find $(spooldir) -atime +1 -ctime +1 -name 'TM.*' -print -exec rm -f \{\} \;
# Delete any old preserved files
find $(spooldir)/.Preserve -atime +14 -ctime +14 -print -exec rm -f \{\} \;
# Delete any old failed execution files
find $(spooldir)/.Failed -atime +14 -ctime +14 -print -exec rm -f \{\} \;

View File

@ -44,7 +44,7 @@
* - redesigned the printed layout (sticked to those 80 column tubes).
* - 'Retry time not ...' and ' ERROR: All matching ports ...' will now be
* counted as calls and will raise the failed-call counter.
* - times now shown as hh:mm:ss; the fields may hold up to 999 hrs
* - times now shown as hh:mm:ss; the fields may hold up to 999 hrs
* (a month equals 744 hrs at max). Printing will be as follows:
*
* hrs > 0 hh:mm:ss
@ -52,7 +52,7 @@
* sec > 0 ss
* leading zeroes are suppressed.
*
* - the bytes xfered will be given in thousands only (we're counting
* - the bytes xfered will be given in thousands only (we're counting
* so 1K is 1000 bytes!). Sums up to 9,999,999.9 thousand can be shown.
* - dropped the fractions of a byte in columns: bytes/second (avg cps).
* - File statistic changed to display in/out in one row instead of 2
@ -60,7 +60,7 @@
* - eliminated the goto in command report and tightened the code; also
* the 'goto usage' has been replaced by a call to void usage() with no
* return (exit 1).
* - a totaling is done for all reports now; the total values are held
* - a totaling is done for all reports now; the total values are held
* within the structure; after finishing read there will be an alloc
* for a site named 'Total' so that the totals line will be printed
* more or less automatically.
@ -84,9 +84,6 @@
* get knowledge of
*/
/* $Log: uurate.c,v $
* Revision 1.2 1994/05/07 18:09:35 ache
* Upgrade to version 1.05
*
* Revision 1.15 1994/04/07 21:47:11 kdburg
* printed 'no data avail' while there was data; layout chnaged
* (cosmetic only)
@ -142,12 +139,15 @@
* */
char version[] = "@(#) Taylor UUCP Log File Summary Filter, Version 1.2.2";
static char rcsid[] = "$Id: uurate.c,v 1.2 1994/05/07 18:09:35 ache Exp $";
static char rcsid[] = "$Id: uurate.c,v 1.15 1994/04/07 21:47:11 kdburg Rel $";
#include <ctype.h> /* Character Classification */
#include <math.h>
#include "uucp.h"
/* uucp.h includes string.h or strings.h, no include here. */
#if HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#define _DEBUG_ 0
@ -291,7 +291,7 @@ int main(argc, argv)
char *argv[];
{
FILE *Log = NULL;
int c;
int c;
char *p, *s, *stt, *flq = NULL;
char Hostname[MAXHOSTNAMELEN]; /* def taken from <sys/param.h> */
char Filename[15]; /* filename to be printed */
@ -321,7 +321,7 @@ int main(argc, argv)
else
strcpy(Pgm_name,argv[0]);
def_logs[0] = Pgm_name;
/*
* I wish the compiler had the #error directive!
*/
@ -348,7 +348,7 @@ int main(argc, argv)
Tstat = (char *)getmem(sizeof(STATFILE));
Tlog = LOGFILE;
Tstat = STATFILE;
/*
* Process the command line arguments
*/
@ -426,8 +426,8 @@ int main(argc, argv)
/*
* If further args present, Assume rest are logfiles for us to process
* which should be given in pairs (log plus stat) otherwise the results may
* not come out as expected! If no further args are present take input from
* Log and Stat files provided in the compilation environment of Taylor UUCP.
* not come out as expected! If no further args are present take input from
* Log and Stat files provided in the compilation environment of Taylor UUCP.
* If -i was given, Log already points to stdin and no file args are accepted.
*/
@ -457,7 +457,7 @@ int main(argc, argv)
else /* Read from current logs */
{
def_logs[1] = Tlog; /* prime the */
def_logs[2] = Tstat; /* file names */
def_logs[2] = Tstat; /* file names */
if (! be_quiet)
printf(" Config for this run: ");
@ -483,7 +483,7 @@ int main(argc, argv)
printf("%s\n",noConf);
}
def_logs[1] = Tlog; /* final setting of */
def_logs[2] = Tstat; /* file names */
def_logs[2] = Tstat; /* file names */
argv = def_logs; /* Bash argvec to log/stat files */
argc = sizeof(def_logs) / sizeof(def_logs[0]);
}
@ -517,7 +517,7 @@ int main(argc, argv)
strncpy(Filename,argv[1],sizeof(Filename)-1);
else
strncpy(Filename,++flq,sizeof(Filename)-1);
strcpy(in_date," n/a");
strcpy(in_time," n/a");
p_done = FALSE; /* no info printed yet */
@ -546,7 +546,7 @@ int main(argc, argv)
if (NULL != (stt = strchr(p, '(')))
{
if (! p_done && ! use_stdin && ! be_quiet)
{
{
#if HAVE_TAYLOR_LOGGING
sscanf(++stt,"%s%*c%[^.]",in_date,in_time);
@ -589,7 +589,7 @@ int main(argc, argv)
* transfer record, determine the direction. If not then
* skip the line if it is not interesting.
*/
if ((s = strchr(++s, ')')) == NULL)
continue;
@ -599,7 +599,7 @@ int main(argc, argv)
if ((s = strchr(++s, ')')) == NULL)
continue; /* yes but strange layout */
#endif /* HAVE_V2_LOGGING */
#endif /* ! HAVE_TAYLOR_LOGGING */
#endif /* ! HAVE_TAYLOR_LOGGING */
logmsg = s + 2; /* Message is 2 characters after ')' */
if ((0 != strncmp(logmsg, "Call complete", 13)) &&
@ -654,8 +654,8 @@ int main(argc, argv)
last->next = cur;
break;
}
} /* while (e != NULL) */
} /* hosts == NULL */
} /* while (e != NULL) */
} /* hosts == NULL */
} /* cur == NULL */
}
@ -771,7 +771,7 @@ int main(argc, argv)
/*
* Handle end of call. Pick up the connect time.
* position is on the closing paren of date/time info
* i.e: ) text....
* i.e: ) text....
*/
if (0 == strncmp(logmsg, "Call complete", 13))
@ -798,7 +798,7 @@ int main(argc, argv)
if (0 == strncmp(logmsg, "failed after ",13))
logmsg += 13; /* the transmission failed for any reason */
/* so advance pointer */
if (0 == strncmp(logmsg, "sent", 4))
if (0 == strncmp(logmsg, "sent", 4))
sent = OUT;
else if (0 == strncmp(logmsg, "received", 8))
sent = IN;
@ -824,7 +824,7 @@ int main(argc, argv)
} /* end of while (fgets(logline...)) */
if (stt != NULL && ! use_stdin && ! be_quiet && ! no_records)
{
{
#if HAVE_TAYLOR_LOGGING
sscanf(dt_info,"%s%*c%[^.]",in_date,in_time);
@ -851,7 +851,7 @@ int main(argc, argv)
{
if (! be_quiet && no_records)
printf(" %-14s %10s\n",Filename, " is empty ");
}
}
}
fclose(Log);
@ -898,11 +898,11 @@ int main(argc, argv)
tot->call[OUT].flow[IN].files += cur->call[OUT].flow[IN].files;
tot->call[IN].flow[OUT].files += cur->call[IN].flow[OUT].files;
tot->call[OUT].flow[OUT].files += cur->call[OUT].flow[OUT].files;
tot->call[OUT].succs += cur->call[OUT].succs;
tot->call[OUT].calls += cur->call[OUT].calls;
tot->call[OUT].succs += cur->call[OUT].succs;
tot->call[OUT].calls += cur->call[OUT].calls;
tot->call[OUT].connect_time += cur->call[OUT].connect_time;
tot->call[IN].succs += cur->call[IN].succs;
tot->call[IN].calls += cur->call[IN].calls;
tot->call[IN].succs += cur->call[IN].succs;
tot->call[IN].calls += cur->call[IN].calls;
tot->call[IN].connect_time += cur->call[IN].connect_time;
}
}
@ -984,7 +984,7 @@ int main(argc, argv)
cur->Hostname, rf, sf,
t1, t2, t3, t4, t5,
ir, or);
}
}
if (! hdr_done)
{
puts("\n(I) No data found to print Compact summary report");
@ -1080,7 +1080,7 @@ int main(argc, argv)
prot->pr_eorder,
prot->pr_ereject);
type = NULL;
}
}
}
}
}
@ -1174,7 +1174,7 @@ int main(argc, argv)
{
char t1[32], t2[32];
double rate = 0, time = 0;
int b = 0;
int b = 0;
int lineOut = 0;
hdr_done = FALSE;
@ -1182,7 +1182,7 @@ int main(argc, argv)
{
lineOut = 0;
for (sent= IN; sent <= OUT; ++sent)
{
{
b = cur->call[IN].flow[sent].bytes +
cur->call[OUT].flow[sent].bytes;
time = cur->call[IN].flow[sent].time +
@ -1218,7 +1218,7 @@ int main(argc, argv)
t1, t2, rate);
lineOut = 1;
}
} /* end: for (sent ... ) */
} /* end: for (sent ... ) */
if (lineOut)
printf("\n");
} /* end: for (cur= ... ) */
@ -1266,7 +1266,7 @@ int main(argc, argv)
hdr_done = TRUE;
}
flow = cur->call[IN].flow[IN].time +
flow = cur->call[IN].flow[IN].time +
cur->call[IN].flow[OUT].time +
cur->call[OUT].flow[IN].time +
cur->call[OUT].flow[OUT].time;
@ -1299,12 +1299,12 @@ int main(argc, argv)
*/
if (show_commands || show_all)
{
{
if (have_commands)
{
int ncmds, i, match;
/*
/*
* layout the header line. The column's header is the command name
*/
@ -1334,7 +1334,7 @@ int main(argc, argv)
fputs(" ------", stdout);
putchar('\n');
/*
/*
* print out the number of executions for each host/command
*/
@ -1356,7 +1356,7 @@ int main(argc, argv)
for(ec= cur->cmds; ec != NULL; ec= ec->next)
{
if ( 0 == strcmp(cmd->Commandname, ec->Commandname) )
{
{
printf(" %7d", ec->count);
match = TRUE;
break;
@ -1369,7 +1369,7 @@ int main(argc, argv)
}
/*
* print the totals line
* print the totals line
*/
fputs(" --------", stdout);
@ -1405,7 +1405,7 @@ int main(argc, argv)
*/
/* ------------------------------------------------------------------
* display the help
* display the help
* ------------------------------------------------------------------
*/
@ -1647,7 +1647,7 @@ int chk_config(char *T_conf,int be_quiet, int type)
fprintf(stderr,"%s (C) ended due to errors\n",
Pgm_name);
return (8);
}
}
}
}
else

View File

@ -12,7 +12,7 @@
compile it form the Makefile or:
cc -c -g -pipe -O -I. -I. -DNEWCONFIGLIB=\"/usr/local/lib/uucp\" uusnap.c
cc -o uusnap uusnap.o
cc -o uusnap uusnap.o
For this, uusnap.[ch] must be in the same directory as uucp.h and so.
uusnap must have read access to SPOOLDIR/.Status in order to work.
@ -25,7 +25,7 @@
#include "uucp.h"
#if USE_RCS_ID
char uusnap_rcsid[] = "$Id: uusnap.c,v 1.2 1994/05/07 18:09:40 ache Exp $";
char uusnap_rcsid[] = "$Id: uusnap.c,v 1.9 92/05/05 22:51:50 hwr Exp Locker: hwr $";
#endif
#include <ctype.h>
@ -50,7 +50,7 @@ struct sysInfo {
int num_retries; /* number of retries */
};
struct sysInfo Systems[MAXSYS];
struct sysInfo Systems[MAXSYS];
/* I have extend the system status. If time for the specified system
@ -77,7 +77,7 @@ main()
int i;
i=get_systems();
display_info(i);
exit(0);
}
@ -115,7 +115,7 @@ get_systems()
get_stat_for_system(i); /* now get the system status */
get_inq_num(i,TRUE); /* number of unprocessed files */
get_outq_num(i,TRUE); /* number of files to send */
i++;
i++;
}
fclose(fp);
}
@ -126,7 +126,7 @@ get_systems()
return i;
}
display_info(int numSys)
{
@ -144,7 +144,7 @@ display_info(int numSys)
fprintf(stderr, "Can't malloc 1024 bytes");
exit(1);
}
while(TRUE) {
display_headline();
for (sysnum=0;sysnum<numSys;sysnum++) {
@ -170,21 +170,21 @@ int
display_status_line(int sn)
{
char *time_s;
int sys_stat,num_retries,wait;
int i;
time_t last_time;
time_t next_time;
struct sysInfo sys;
sys = Systems[sn];
printf("%10s ",sys.sysname);
get_inq_num(sn);
if (sys.in==0)
printf(" ");
else
else
printf("%3d ",sys.in);
get_outq_num(sn);
if (sys.out==0)
@ -198,13 +198,13 @@ display_status_line(int sn)
time_s = ctime(&sys.next);
time_s = time_s + 11;
*(time_s+8)='\0';
if (sys.last == sys.next)
if (sys.last == sys.next)
printf(" ");
else
printf("%8s ",time_s); /* time of next poll */
if (sys.num_retries==0)
if (sys.num_retries==0)
printf(" ");
else
else
printf("%2d ",sys.num_retries);
if (sys_stat==6) /* system is talking */
printf("\E[7m"); /* reverse video on */
@ -234,7 +234,7 @@ get_inq_num(int num,char firstTime)
char filename[1024];
struct stat stbuf;
DIR *dirp;
strcpy(filename,Systems[num].spooldir);
strcat(filename,"/X./.");
stat(filename,&stbuf);
@ -263,7 +263,7 @@ get_outq_num(int sys,char firstTime)
char filename[1024];
struct stat stbuf;
DIR *dirp;
strcpy(filename,Systems[sys].spooldir);
strcat(filename,"/C./.");
stat(filename,&stbuf);

View File

@ -197,7 +197,7 @@ sub print_dashes {
sub gethostname {
$ENV{"SHELL"} = "/bin/sh";
$try = `hostname 2>/dev/null`;
$try = `(hostname) 2>/dev/null`;
chop $try;
return $+ if $try =~ /^[-.\w]+$/;
$try = `uname -n 2>/dev/null`;

View File

@ -15,10 +15,10 @@
# files rather then being hard coded here.
#
Spool=/usr/spool/uucp
Lib=/usr/lib/uucp
Lib=/usr/local/lib/uucp
Status=$Spool/.Status
Debug=$Spool/Debug
Uucico=$lib/uucico
Uucico=$Lib/uucico
#
# Default option values
#
@ -32,7 +32,7 @@ for i in $* ; do
esac
done
if [ $s != "" ]; then
if [ x$s != x ]; then
rm -f $Status/$s
$Uucico -r1 $x -s$s &
>$Debug

View File

@ -21,7 +21,7 @@
* for timed reads. Use Taylor UUCP "conf.h" file to set
* configuration for this program. Add defaulting of script
* and log file paths.
*
*
* Daniel Hagerty - Mon Nov 22 18:17:38 1993
* V1.2 - Added a new opcode to xchat. "expectstr" is a cross between
* sendstr and expect, looking for a parameter supplied string.
@ -43,7 +43,7 @@
#include "xc-conf.h"
/*
/*
* Pick a timing routine to use, as done in Taylor UUCP.
*/
#if HAVE_USLEEP || HAVE_NAP || HAVE_NAPMS || HAVE_POLL
@ -279,7 +279,7 @@ extern void *malloc();
* arguments in argc/argv, and stdin/stdout mapped to the
* tty device, and stderr mapped to the Taylor logfile, where
* anything written to stdout will be logged as an error.
*
*
*/
int main(argc, argv)
int argc;
@ -312,7 +312,7 @@ char *argv[];
/*
* If the script file argument begins with '/', then we assume
* it is an absolute pathname, otherwise, we prepend the
* it is an absolute pathname, otherwise, we prepend the
* SCRIPT_DIR path.
*/
*sfname = '\0'; /* Empty name string */
@ -375,7 +375,7 @@ char *argv[];
exit(stat);
}
/*
/*
* deal_script - deallocate a script and all strings it points to
*/
int deal_script(loc)
@ -386,34 +386,34 @@ struct script *loc;
*/
if (loc == (struct script *)NULL)
return SUCCESS;
/*
* Deallocate the rest of the script
*/
deal_script(loc->next);
/*
* Deallocate the string parameter, if any
*/
if (loc->strprm != (char *)NULL)
free(loc->strprm);
/*
* Deallocate the new state name parameter, if any
*/
if (loc->newstate != (char *)NULL)
free(loc->newstate);
/*
* Deallocate this entry
*/
free(loc);
return SUCCESS;
}
/*
/*
* read_script
*
* Read & compile a script, return pointer to first entry, or null if bad
@ -428,10 +428,10 @@ struct script *read_script(fd)
char inpline[MAX_SCLINE];
char inpcopy[MAX_SCLINE];
char *c, *cln, *opc, *cp;
/*
* MAIN COMPILATION LOOP
*/
*/
while ((c = fgets(inpline, (sizeof inpline - 1), fd)) != (char *)NULL)
{
/*
@ -439,13 +439,13 @@ struct script *read_script(fd)
*/
if (*c == '#' || *c == '\n')
continue;
/*
/*
* Get rid of the trailing newline, and copy the string
*/
inpline[strlen(inpline)-1] = '\0';
strcpy(inpcopy, inpline);
/*
* Look for text starting in the first col (a label)
*/
@ -467,7 +467,7 @@ struct script *read_script(fd)
this->newstate = (char *)NULL;
c = cln + 1;
}
/*
* Now handle the opcode. Fold it to lower case.
*/
@ -477,14 +477,14 @@ struct script *read_script(fd)
cp = opc;
while(*cp)
tolower(*cp++);
/*
/*
* If we have an opcode but we haven't seen anything
* else (like a label) yet, i.e., this is the first
* entry, and there was no label. We need to
* entry, and there was no label. We need to
* cobble up a label so that read_script is happy
*/
if (first == (struct script *)NULL)
if (first == (struct script *)NULL)
{
this = (struct script *)malloc (sizeof (struct script));
prev = this;
@ -496,12 +496,12 @@ struct script *read_script(fd)
this->intprm = 0;
this->newstate = (char *)NULL;
}
/*
/*
* Find opcode - ndex through the opcode definition table
*/
for (i=1; sc_opdef[i].opcode != SC_END; i++)
if (strcmp(opc, sc_opdef[i].opname) == SAME)
if (strcmp(opc, sc_opdef[i].opname) == SAME)
break;
if ((sc_opdef[i].opcode) == SC_END)
{
@ -509,7 +509,7 @@ struct script *read_script(fd)
deal_script(first);
return (struct script *)NULL;
}
/*
* Found opcode. Allocate a new command node and initialize
*/
@ -521,8 +521,8 @@ struct script *read_script(fd)
this->strprm = (char *)NULL;
this->intprm = 0;
this->newstate = (char *)NULL;
/*
/*
* Pick up new state parameter, if any
*/
if (sc_opdef[i].newstate == SC_NWST)
@ -540,7 +540,7 @@ struct script *read_script(fd)
strcpy(this->newstate, c);
}
}
/*
* Pick up the string or integer parameter. Handle missing
* parameter gracefully.
@ -572,8 +572,8 @@ struct script *read_script(fd)
/*
* STR/XSTR strings.
*/
case SC_STR:
case SC_XSTR:
case SC_STR:
case SC_XSTR:
c = strtok((char *)NULL, CTL_DELIM);
if (c == (char *)NULL)
{
@ -597,9 +597,9 @@ struct script *read_script(fd)
/*
* For XSTR, Translate the string and store its
* length. Note that, after escape sequences are
* compressed, the resulting string may well be a
* few bytes shorter than the input string (whose
* length. Note that, after escape sequences are
* compressed, the resulting string may well be a
* few bytes shorter than the input string (whose
* length was the basis for the malloc above),
* but it will never be longer.
*/
@ -611,10 +611,10 @@ struct script *read_script(fd)
else
strcpy(this->strprm, c);
break;
}
}
/*
* EOF
*/
@ -630,23 +630,23 @@ struct script *read_script(fd)
* Called by read_script(), above.
*
* Returns the actual length of the resulting string. Note that imbedded
* nulls (specified by \000 in the input) ARE allowed in the result.
* nulls (specified by \000 in the input) ARE allowed in the result.
*/
xlat_str(out, in)
char *out, *in;
{
register int i = 0, j = 0;
int byte, k;
while (in[i])
while (in[i])
{
if (in[i] != '\\')
if (in[i] != '\\')
{
out[j++] = in[i++];
}
else
else
{
switch (in[++i])
switch (in[++i])
{
case 'd': /* EOT */
out[j++] = 0x04;
@ -682,11 +682,11 @@ xlat_str(out, in)
case '7':
byte = in[i] - '0';
k = 0;
while (3 > ++k)
while (3 > ++k)
if ((in[i+1] < '0') || (in[i+1] > '7'))
break;
else
else
{
byte = (byte<<3) + in[i+1] - '0';
++i;
@ -698,7 +698,7 @@ xlat_str(out, in)
}
++i;
}
}
}
return j;
}
@ -711,9 +711,9 @@ struct script *begin;
char *newstate;
{
struct script *here;
for (here=begin; here != (struct script *)NULL; here=here->next) {
if (here->opcode == SC_LABEL &&
if (here->opcode == SC_LABEL &&
strcmp(here->strprm, newstate) == SAME)
return here;
}
@ -721,8 +721,8 @@ char *newstate;
}
/*
* do_script() - execute a script
/*
* do_script() - execute a script
*/
int do_script(begin)
struct script *begin;
@ -734,7 +734,7 @@ int do_script(begin)
char *c, chr;
int prmlen;
int dbfd;
time_t sc_carrtime = 45000; /* time to wf carr after dial */
time_t sc_chrdly = 100; /* delay time for ttoslow */
time_t sc_ptime = 2000; /* time to allow for pause char */
@ -746,118 +746,118 @@ int do_script(begin)
char sc_wchar = 'W'; /* modem wait-for-dialtone character */
time_t sc_begwait; /* time at beg of wait */
time_t sc_secs; /* timeout period */
int expcnt;
int expin;
static char expbuf[MAX_EXPCT];
dbgsave = Debug;
curstate = begin;
if (curstate == (struct script *)NULL)
if (curstate == (struct script *)NULL)
return SUCCESS;
_newstate:
/*
/*
* do all of curstate's actions. Enter with curstate pointing
* to a label entry
*/
expin = 0;
for (curscr = curstate->next; /* point to 1st scr after label */
(curscr != (struct script *)NULL) && /* do until end of scr */
(curscr->opcode != SC_LABEL); /* or next label */
curscr = curscr->next)
curscr = curscr->next)
{
expcnt = 0;
switch (curscr->opcode)
switch (curscr->opcode)
{
case SC_LABEL:
logit("Script proc err", curstate->strprm);
return FAIL;
case SC_FLSH:
DEBUG(DB_LGII, "Flushing typeahead buffer\n", 0);
ttflui();
break;
case SC_CDLY:
sc_chrdly = curscr->intprm;
DEBUG(DB_LGII, "Set chrdly to %d\n", sc_chrdly);
break;
case SC_PCHR:
sc_pchar = *(curscr->strprm);
DEBUG(DB_LGII, "Set pause char to %c\n", sc_pchar);
break;
case SC_PTIM:
sc_ptime = curscr->intprm;
DEBUG(DB_LGII, "Set pause time to %d\n", sc_ptime);
break;
case SC_WCHR:
sc_wchar = *(curscr->strprm);
DEBUG(DB_LGII, "Set wait char to %c\n", sc_wchar);
break;
case SC_WTIM:
sc_wtime = curscr->intprm;
DEBUG(DB_LGII, "Set wait time to %d\n", sc_wtime);
break;
case SC_ZERO:
sc_counter = 0;
DEBUG(DB_LGII, "Set counter to %d\n", sc_counter);
break;
case SC_INCR:
sc_counter++;
DEBUG(DB_LGII, "Incr counter to %d\n", sc_counter);
break;
case SC_WAIT:
DEBUG(DB_LGII, "Sleeping %d tenth-secs\n", curscr->intprm);
msleep(curscr->intprm);
break;
case SC_DTIM:
sc_dtime = curscr->intprm;
DEBUG(DB_LGII, "Digit time is %d\n", sc_dtime);
break;
case SC_CTIM:
sc_carrtime = curscr->intprm;
DEBUG(DB_LGII, "Carrier time is %d\n", sc_carrtime);
break;
case SC_EXIT:
Debug = dbgsave;
DEBUG(DB_LGI, "Script ended successfully\n", 0);
return SUCCESS;
case SC_FAIL:
Debug = dbgsave;
if (DEBUG_LEVEL(DB_LGI) && dbf != NULL)
fprintf(dbf, "Script failed\n");
else if (expin)
charlog(expbuf, expin, DB_LOG,
charlog(expbuf, expin, DB_LOG,
"Script failed. Last received data");
return FAIL;
case SC_LOG:
logit(curscr->strprm, "");
break;
case SC_LOGE:
logit("ERROR: ", curscr->strprm);
break;
case SC_DBOF:
/*
* If the debug file name does not begin with "/", then
* we prepend the LOG_DIR to the string. Then CREATE the
* file. This WIPES OUT previous logs.
* file. This WIPES OUT previous logs.
*/
*dfname = '\0'; /* Zero name string */
if(curscr->strprm[0] != '/')
@ -877,102 +877,102 @@ int do_script(begin)
return FAIL;
}
break;
case SC_DBG:
DEBUG(DB_LGI, "<%s>\n", curscr->strprm);
break;
case SC_DBGE:
DEBUG(DB_LGIE, "ERROR: <%s>\n", curscr->strprm);
break;
case SC_DBST:
Debug |= curscr->intprm;
DEBUG(DB_LGII, "Debug mask set to %04o (octal)\n", Debug);
break;
case SC_DBCL:
Debug &= ~(curscr->intprm);
DEBUG(DB_LGII, "Debug mask set to %04o (octal)\n", Debug);
break;
case SC_BRK:
DEBUG(DB_LGI, "Sending break\n", 0);
ttbreak();
break;
case SC_HANG:
DEBUG(DB_LGI, "Dropping DTR\n", 0);
tthang();
break;
case SC_7BIT:
DEBUG(DB_LGI, "Enabling 7-bit stripping\n", 0);
tt7bit(TRUE);
break;
case SC_8BIT:
DEBUG(DB_LGI, "Disabling 7-bit stripping\n", 0);
tt7bit(FALSE);
break;
case SC_PNON:
DEBUG(DB_LGI, "Setting 8-bit, no parity\n", 0);
ttpar(NONE);
break;
case SC_PEVN:
DEBUG(DB_LGI, "Setting 7-bit, even parity\n", 0);
ttpar(EVEN);
break;
case SC_PODD:
DEBUG(DB_LGI, "Setting 7-bit, odd parity\n", 0);
ttpar(ODD);
break;
case SC_IFBL:
if (ttblind())
if (ttblind())
{
DEBUG(DB_LGI, "Blind mux,\n", 0);
goto _chgstate;
}
break;
case SC_IFBG:
if (ttblind() && sc_counter > curscr->intprm)
if (ttblind() && sc_counter > curscr->intprm)
{
DEBUG(DB_LGI, "Blind mux & ctr > %d\n",
DEBUG(DB_LGI, "Blind mux & ctr > %d\n",
curscr->intprm);
goto _chgstate;
}
break;
case SC_IFGT:
if (sc_counter > curscr->intprm)
if (sc_counter > curscr->intprm)
{
DEBUG(DB_LGI, "Counter > %d\n", curscr->intprm);
goto _chgstate;
}
break;
case SC_GOTO:
_chgstate:
DEBUG(DB_LGI, "Changing to state %s\n",
curscr->newstate);
curstate = find_state(begin, curscr->newstate);
if (curstate == NULL)
if (curstate == NULL)
{
logit("New state not found",
curscr->newstate);
return FAIL;
}
goto _newstate;
case SC_SEND:
ttoslow(curscr->strprm, curscr->intprm, sc_chrdly);
break;
case SC_TELN:
if (curscr->intprm > paramc - 1)
{
@ -983,7 +983,7 @@ int do_script(begin)
strcpy(telno, paramv[curscr->intprm]);
DEBUG(DB_LGII, "telno set to %s\n", telno);
break;
case SC_SNDP:
if (curscr->intprm > paramc - 1)
{
@ -994,17 +994,17 @@ int do_script(begin)
prmlen = xlat_str(tempstr, paramv[curscr->intprm]);
ttoslow(tempstr, prmlen, sc_chrdly);
break;
case SC_IF1P:
if (curscr->intprm < paramc)
goto _chgstate;
break;
case SC_IF0P:
if (curscr->intprm >= paramc)
goto _chgstate;
break;
case SC_DIAL:
if(telno[0] == '\0')
{
@ -1017,17 +1017,17 @@ int do_script(begin)
* changed by the script. See the man page xchat(8) for
* details.
*/
sc_dtmo = (sc_dtime+sc_chrdly)*strlen(telno)
sc_dtmo = (sc_dtime+sc_chrdly)*strlen(telno)
+ sc_carrtime;
c=strcpy(tempstr, telno);
for (; *c!='\0'; c++)
for (; *c!='\0'; c++)
{
if (*c == 'W')
if (*c == 'W')
{
*c = sc_wchar;
sc_dtmo += sc_wtime;
}
else if (*c == 'P')
else if (*c == 'P')
{
*c = sc_pchar;
sc_dtmo += sc_ptime;
@ -1036,7 +1036,7 @@ int do_script(begin)
DEBUG(DB_LGI, "Dialing, default timeout is %d millisecs\n", sc_dtmo);
ttoslow(tempstr, 0, sc_chrdly);
break;
case SC_TIMO: /* these are "expects", don't bother */
case SC_XPCT: /* with them yet, other than noting that */
case SC_CARR: /* they exist */
@ -1044,107 +1044,107 @@ int do_script(begin)
expcnt++;
break;
}
}
/* we've done the current state's actions, now do its expects, if any */
if (expcnt == 0)
if (expcnt == 0)
{
if (curscr != (struct script *)NULL &&
(curscr->opcode == SC_LABEL))
if (curscr != (struct script *)NULL &&
(curscr->opcode == SC_LABEL))
{
curstate = curscr;
DEBUG(DB_LGI, "Fell through to state %s\n",
curstate->strprm);
goto _newstate;
}
else
else
{
logit("No way out of state", curstate->strprm);
return FAIL;
}
}
time(&sc_begwait); /* log time at beg of expect */
DEBUG(DB_LGI, "Doing expects for state %s\n", curstate->strprm);
charlog((char *)NULL, 0, DB_LGI, "Received");
while (1)
while (1)
{
chr = xgetc(1); /* Returns upon char input or 1 sec. tmo */
charlog(&chr, 1, DB_LGI, (char *)NULL);
if (chr != EOF)
if (chr != EOF)
{
if (expin < MAX_EXPCT)
if (expin < MAX_EXPCT)
{
expbuf[expin++] = chr & 0x7f;
}
else
else
{
strncpy(expbuf, &expbuf[1], MAX_EXPCT-1);
expbuf[MAX_EXPCT-1] = chr & 0x7f;
}
}
/* for each entry in the current state... */
for (curscr = curstate->next;
for (curscr = curstate->next;
(curscr != (struct script *)NULL) &&
(curscr->opcode != SC_LABEL);
curscr = curscr->next)
curscr = curscr->next)
{
switch (curscr->opcode)
switch (curscr->opcode)
{
case SC_TIMO:
sc_secs = curscr->intprm;
if (sc_secs == 0)
sc_secs = sc_dtmo;
sc_secs /= 1000;
if (time(NULL)-sc_begwait > sc_secs)
if (time(NULL)-sc_begwait > sc_secs)
{
DEBUG(DB_LGI,
"\nTimed out (%d secs)\n", sc_secs);
goto _chgstate;
}
break;
case SC_CARR:
if (ttcd())
if (ttcd())
{
DEBUG(DB_LGI, "\nGot carrier\n", 0);
goto _chgstate;
}
break;
case SC_HUPS:
if (fShangup)
if (fShangup)
{
DEBUG(DB_LGI, "\nGot data set hangup\n", 0);
goto _chgstate;
}
break;
case SC_XPCT:
if ((expin >= curscr->intprm) &&
(strncmp(curscr->strprm,
(strncmp(curscr->strprm,
&expbuf[expin - curscr->intprm],
curscr->intprm) == SAME))
curscr->intprm) == SAME))
{
charlog(curscr->strprm, curscr->intprm,
DB_LGI, "Matched");
goto _chgstate;
}
break;
}
}
}
}
/* New opcode added by hag@eddie.mit.edu for expecting a
/* New opcode added by hag@eddie.mit.edu for expecting a
parameter supplied string */
case SC_XPST:
if(curscr->intprm >paramc-1)
@ -1194,8 +1194,8 @@ static int uhup(isig)
/*
* xgetc - get a character with timeout
*
* Assumes that stdin is opened on a terminal or TCP socket
* with O_NONBLOCK.
* Assumes that stdin is opened on a terminal or TCP socket
* with O_NONBLOCK.
*/
static char xgetc(tmo)
int tmo; /* Timeout, seconds */
@ -1218,7 +1218,7 @@ int tmo; /* Timeout, seconds */
return(c);
}
/*
/*
* Pause for an interval in milliseconds
*/
void msleep(msec)
@ -1248,7 +1248,7 @@ long msec;
if(msec == 0)
return;
/*
/*
* We need to pass an unused pollfd structure because poll checks
* the address before checking the number of elements.
*/
@ -1289,7 +1289,7 @@ char *msg1, *msg2;
*
* SPECIAL CASE: msg=NULL, len=1 and msg[0]='\377' gets logged
* when read does its 1 sec. timeout. Log "<1 sec.>"
* so user can see elapsed time
* so user can see elapsed time
*/
static void charlog(buf, len, mask, msg)
char *buf;
@ -1344,21 +1344,21 @@ int sig;
return;
}
/*
/*
* ttoslow() - Send characters with pacing delays
*/
static void ttoslow(s, len, delay)
char *s;
char *s;
int len;
time_t delay;
time_t delay;
{
int i;
if (len == 0)
len = strlen(s);
charlog (s, len, DB_LGI, "Sending slowly");
for (i = 0; i < len; i++, s++)
{
write(1, s, 1);

View File

@ -1,12 +1,12 @@
# Makefile for cu
# $Id: Makefile,v 1.2 1994/05/31 05:23:39 ache Exp $
# $Id: Makefile,v 1.3 1994/05/31 07:47:39 ache Exp $
BINDIR= $(bindir)
BINOWN= $(owner)
BINMODE= 4555
PROG= cu
SRCS= cu.c prot.c log.c chat.c conn.c tcp.c tli.c copy.c
SRCS= cu.c prot.c log.c chat.c conn.c copy.c
LDADD+= $(LIBUNIX) $(LIBUUCONF) $(LIBUUCP)
DPADD+= $(LIBUNIX) $(LIBUUCONF) $(LIBUUCP)
CFLAGS+= -I$(.CURDIR)/../common_sources\

View File

@ -1,5 +1,5 @@
''' $Id: cu.1,v 1.2 1994/05/07 18:09:51 ache Exp $
.TH cu 1 "Taylor UUCP 1.05"
''' $Id: cu.1,v 1.9 1995/08/02 00:16:58 ian Rel $
.TH cu 1 "Taylor UUCP 1.06"
.SH NAME
cu \- Call up another system
.SH SYNOPSIS
@ -169,7 +169,7 @@ returns. The default is false.
A string used before sending a binary character in a file transfer, if
the
.B binary
variable is true. The default is ^Z.
variable is true. The default is ^V.
.TP 5
.B echo-check
Whether to check file transfers by examining what the remote system
@ -228,6 +228,15 @@ are given.
.B \-h, \-\-halfduplex
Echo characters locally (half-duplex mode).
.TP 5
.B \-\-nostop
Turn off XON/XOFF handling (it is on by default).
.TP 5
.B \-E char, \-\-escape char
Set the escape character. Initially
.B ~
(tilde). To eliminate the escape character, use
.B -E ''.
.TP 5
.B \-z system, \-\-system system
The system to call.
.TP 5
@ -258,7 +267,7 @@ Prompt for the phone number to use.
.TP 5
.B \-d
Enter debugging mode. Equivalent to
.B \-debug all.
.B \-\-debug all.
.TP 5
.B \-x type, \-\-debug type
Turn on particular debugging types. The following types are

View File

@ -1,7 +1,7 @@
/* cu.c
Call up a remote system.
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 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 cu_rcsid[] = "$Id: cu.c,v 1.3 1994/10/02 23:10:39 ache Exp $";
const char cu_rcsid[] = "$Id: cu.c,v 1.42 1995/08/02 01:19:50 ian Rel $";
#endif
#include "cu.h"
@ -213,6 +213,7 @@ static boolean fcusend_buf P((struct sconnection *qconn, const char *zbuf,
static const struct option asCulongopts[] =
{
{ "phone", required_argument, NULL, 'c' },
{ "escape", required_argument, NULL, 'E' },
{ "parity", required_argument, NULL, 2 },
{ "halfduplex", no_argument, NULL, 'h' },
{ "prompt", no_argument, NULL, 'n' },
@ -221,6 +222,7 @@ static const struct option asCulongopts[] =
{ "speed", required_argument, NULL, 's' },
{ "baud", required_argument, NULL, 's' },
{ "mapcr", no_argument, NULL, 't' },
{ "nostop", no_argument, NULL, 3 },
{ "system", required_argument, NULL, 'z' },
{ "config", required_argument, NULL, 'I' },
{ "debug", required_argument, NULL, 'x' },
@ -252,6 +254,8 @@ main (argc, argv)
boolean fmapcr = FALSE;
/* -z: system. */
const char *zsystem = NULL;
/* --nostop: turn off XON/XOFF. */
enum txonxoffsetting txonxoff = XONXOFF_ON;
/* -I: configuration file name. */
const char *zconfig = NULL;
int iopt;
@ -291,7 +295,7 @@ main (argc, argv)
}
}
while ((iopt = getopt_long (argc, argv, "a:c:dehnI:l:op:s:tvx:z:",
while ((iopt = getopt_long (argc, argv, "a:c:deE:hnI:l:op:s:tvx:z:",
asCulongopts, (int *) NULL)) != EOF)
{
switch (iopt)
@ -313,6 +317,11 @@ main (argc, argv)
feven = TRUE;
break;
case 'E':
/* Escape character. */
zCuvar_escape = optarg;
break;
case 'h':
/* Local echo. */
fCulocalecho = TRUE;
@ -371,7 +380,7 @@ main (argc, argv)
/* Print version and exit. */
fprintf
(stderr,
"%s: Taylor UUCP %s, copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor\n",
"%s: Taylor UUCP %s, copyright (C) 1991, 92, 93, 94, 1995 Ian Lance Taylor\n",
zProgram, VERSION);
exit (EXIT_SUCCESS);
/*NOTREACHED*/
@ -395,6 +404,11 @@ main (argc, argv)
}
break;
case 3:
/* --nostop. */
txonxoff = XONXOFF_OFF;
break;
case 1:
/* --help. */
ucuhelp ();
@ -531,6 +545,7 @@ main (argc, argv)
{
enum tparitysetting tparity;
enum tstripsetting tstrip;
long iusebaud;
/* The uuconf_find_port function only selects directly on a port
name and a speed. To select based on the line name, we use a
@ -599,6 +614,7 @@ main (argc, argv)
if (! fsysdep_port_access (&sport))
ulog (LOG_FATAL, "%s: Permission denied", zline);
}
iusebaud = ibaud;
ihighbaud = 0L;
}
else
@ -660,12 +676,12 @@ main (argc, argv)
ulog (LOG_FATAL, "%s: No %smatching ports", zsystem, zrem);
}
ibaud = qsys->uuconf_ibaud;
iusebaud = qsys->uuconf_ibaud;
ihighbaud = qsys->uuconf_ihighbaud;
}
/* Here we have locked a connection to use. */
if (! fconn_open (&sconn, ibaud, ihighbaud, FALSE))
if (! fconn_open (&sconn, iusebaud, ihighbaud, FALSE))
ucuabort ();
fCuclose_conn = TRUE;
@ -695,7 +711,7 @@ main (argc, argv)
tstrip = STRIPSETTING_DEFAULT;
}
if (! fconn_set (&sconn, tparity, tstrip, XONXOFF_ON))
if (! fconn_set (&sconn, tparity, tstrip, txonxoff))
ucuabort ();
if (qsys != NULL)
@ -815,7 +831,7 @@ static void
ucuhelp ()
{
fprintf (stderr,
"Taylor UUCP %s, copyright (C) 1991, 1992, 1993, 1994 Ian Lance Taylor\n",
"Taylor UUCP %s, copyright (C) 1991, 92, 93, 94, 1995 Ian Lance Taylor\n",
VERSION);
fprintf (stderr,
"Usage: %s [options] [system or phone-number]\n", zProgram);
@ -835,8 +851,12 @@ ucuhelp ()
" -o: Set odd parity\n");
fprintf (stderr,
" --parity={odd,even}: Set parity\n");
fprintf (stderr,
" -E,--escape char: Set escape character\n");
fprintf (stderr,
" -h,--halfduplex: Echo locally\n");
fprintf (stderr,
" --nostop: Turn off XON/XOFF handling\n");
fprintf (stderr,
" -t,--mapcr: Map carriage return to carriage return/linefeed\n");
fprintf (stderr,
@ -1012,7 +1032,7 @@ fcudo_cmd (puuconf, qconn, bcmd)
{
default:
if (! isprint (*zCuvar_escape))
sprintf (abescape, "\\%03o", (unsigned int) *zCuvar_escape);
sprintf (abescape, "\\%03o", BUCHAR (*zCuvar_escape));
else
{
abescape[0] = *zCuvar_escape;
@ -1047,7 +1067,7 @@ fcudo_cmd (puuconf, qconn, bcmd)
case '|': t = SHELL_STDIN_FROM_PORT; break;
case '+': t = SHELL_STDIO_ON_PORT; break;
}
(void) fsysdep_shell (qconn, zline, t);
}
if (! fsysdep_cu_copy (TRUE)
@ -1098,7 +1118,7 @@ fcudo_cmd (puuconf, qconn, bcmd)
ucuabort ();
fCurestore_terminal = TRUE;
return TRUE;
case 's':
fret = fcuset_var (puuconf, zline);
ubuffree (zline);
@ -1110,7 +1130,7 @@ fcudo_cmd (puuconf, qconn, bcmd)
case '?':
if (! isprint (*zCuvar_escape))
sprintf (abescape, "\\%03o", (unsigned int) *zCuvar_escape);
sprintf (abescape, "\\%03o", BUCHAR (*zCuvar_escape));
else
{
abescape[0] = *zCuvar_escape;
@ -1192,7 +1212,6 @@ fcuset_var (puuconf, zline)
{
char *zvar, *zval;
char *azargs[2];
char azbool[2];
int iuuconf;
zvar = strtok (zline, "= \t");
@ -1208,25 +1227,27 @@ fcuset_var (puuconf, zline)
{
azargs[0] = zvar;
if (azargs[0][0] != '!')
azbool[0] = 't';
azargs[1] = zbufcpy ("t");
else
{
++azargs[0];
azbool[0] = 'f';
azargs[1] = zbufcpy ("f");
}
azbool[1] = '\0';
azargs[1] = azbool;
}
else
{
azargs[0] = zvar;
azargs[1] = zval;
azargs[1] = zbufcpy (zval);
}
iuuconf = uuconf_cmd_args (puuconf, 2, azargs, asCuvars,
(pointer) NULL, icuunrecogvar, 0,
(pointer) NULL);
if (iuuconf != UUCONF_SUCCESS)
if ((iuuconf & UUCONF_CMDTABRET_KEEP) == 0)
ubuffree (azargs[1]);
if ((iuuconf &~ UUCONF_CMDTABRET_KEEP) != UUCONF_SUCCESS)
ulog_uuconf (LOG_ERROR, puuconf, iuuconf);
return TRUE;
@ -1246,7 +1267,7 @@ icuunrecogvar (puuconf, argc, argv, pvar, pinfo)
char abescape[5];
if (! isprint (*zCuvar_escape))
sprintf (abescape, "\\%03o", (unsigned int) *zCuvar_escape);
sprintf (abescape, "\\%03o", BUCHAR (*zCuvar_escape));
else
{
abescape[0] = *zCuvar_escape;
@ -1301,7 +1322,7 @@ uculist_vars ()
if (! isprint (*z))
{
sprintf (abchar, "\\%03o", (unsigned int) *z);
sprintf (abchar, "\\%03o", BUCHAR (*z));
cchar = 4;
}
else
@ -1413,7 +1434,7 @@ icuunrecogfn (puuconf, argc, argv, pvar, pinfo)
char abescape[5];
if (! isprint (*zCuvar_escape))
sprintf (abescape, "\\%03o", (unsigned int) *zCuvar_escape);
sprintf (abescape, "\\%03o", BUCHAR (*zCuvar_escape));
else
{
abescape[0] = *zCuvar_escape;
@ -1651,7 +1672,7 @@ icuput (puuconf, argc, argv, pvar, pinfo)
if (ffileeof (e))
break;
c = cfileread (e, abbuf, sizeof abbuf);
if (ffilereaderror (e, c))
if (ffileioerror (e, c))
{
ucuputs ("[file read error]");
break;
@ -1827,8 +1848,6 @@ icutake (puuconf, argc, argv, pvar, pinfo)
return UUCONF_CMDTABRET_CONTINUE;
}
ubuffree (zto);
if (! fsysdep_cu_copy (FALSE)
|| ! fsysdep_terminal_signals (TRUE))
ucuabort ();
@ -1860,6 +1879,7 @@ icutake (puuconf, argc, argv, pvar, pinfo)
{
ucuputs ("[timed out waiting for newline]");
ucuputs (abCuconnected);
ubuffree (zto);
return UUCONF_CMDTABRET_CONTINUE;
}
}
@ -1883,7 +1903,7 @@ icutake (puuconf, argc, argv, pvar, pinfo)
the future. */
afSignal[INDEXSIG_SIGINT] = FALSE;
break;
}
}
b = breceive_char (qconn, cCuvar_timeout, TRUE);
if (b == -2)
@ -1896,7 +1916,7 @@ icutake (puuconf, argc, argv, pvar, pinfo)
break;
}
if (b == '\r')
if (b == '\r' && ! fCuvar_binary)
continue;
if (ceoflen == 0)
@ -1941,8 +1961,16 @@ icutake (puuconf, argc, argv, pvar, pinfo)
ubuffree (zlook);
if (! ffileclose (e))
ferr = TRUE;
if (! fsysdep_sync (e, zto))
{
(void) ffileclose (e);
ferr = TRUE;
}
else
{
if (! ffileclose (e))
ferr = TRUE;
}
if (ferr)
ucuputs ("[file write error]");
@ -1952,6 +1980,8 @@ icutake (puuconf, argc, argv, pvar, pinfo)
ucuputs (abCuconnected);
ubuffree (zto);
return UUCONF_CMDTABRET_CONTINUE;
}
@ -2055,7 +2085,7 @@ fcusend_buf (qconn, zbufarg, cbufarg)
*zput++ = *zget;
}
}
zbuf += csend;
cbuf -= csend;

File diff suppressed because it is too large Load Diff

View File

@ -17,6 +17,7 @@ dup2.c
efopen.c
epopen.c
exists.c
failed.c
filnam.c
fsusg.c
fsusg.h
@ -64,11 +65,15 @@ srmdir.c
statsb.c
status.c
strerr.c
sync.c
tcp.c
time.c
tli.c
tmpfil.c
trunc.c
uacces.c
ufopen.c
uid.c
ultspl.c
unknwn.c
uuto.c

View File

@ -1,17 +1,17 @@
# This subdirectory contains Unix specific support functions.
# $Id: Makefile,v 1.2 1994/05/07 18:10:03 ache Exp $
# $Id: Makefile,v 1.3 1995/05/13 12:57:23 ache Exp $
LIB= unix
SRCS = access.c addbas.c app3.c app4.c basnam.c bytfre.c corrup.c \
chmod.c cohtty.c cusub.c cwd.c detach.c efopen.c epopen.c \
exists.c filnam.c fsusg.c indir.c init.c isdir.c isfork.c \
iswait.c jobid.c lcksys.c link.c locfil.c lock.c loctim.c \
mail.c mkdirs.c mode.c move.c opensr.c pause.c picksb.c pipe.c \
portnm.c priv.c proctm.c recep.c run.c seq.c serial.c signal.c \
sindir.c size.c sleep.c spawn.c splcmd.c splnam.c spool.c \
srmdir.c statsb.c status.c time.c tmpfil.c trunc.c uacces.c \
ufopen.c ultspl.c unknwn.c uuto.c walk.c wldcrd.c work.c \
xqtfil.c xqtsub.c ftw.c
exists.c failed.c filnam.c fsusg.c indir.c init.c isdir.c \
isfork.c iswait.c jobid.c lcksys.c link.c locfil.c lock.c \
loctim.c mail.c mkdirs.c mode.c move.c opensr.c pause.c \
picksb.c pipe.c portnm.c priv.c proctm.c recep.c run.c seq.c \
serial.c signal.c sindir.c size.c sleep.c spawn.c splcmd.c \
splnam.c spool.c srmdir.c statsb.c status.c sync.c tcp.c \
time.c tli.c tmpfil.c trunc.c uacces.c ufopen.c uid.c ultspl.c \
unknwn.c uuto.c walk.c wldcrd.c work.c xqtfil.c xqtsub.c ftw.c
CFLAGS+= -I$(.CURDIR)/../common_sources \
-DOWNER=\"$(owner)\" -DSBINDIR=\"$(libxdir)\"

View File

@ -7,6 +7,12 @@
#include "sysdep.h"
#include "fsusg.h"
#if HAVE_LIMITS_H
#include <limits.h>
#else
#define LONG_MAX 2147483647
#endif
long
csysdep_bytes_free (zfile)
const char *zfile;
@ -15,5 +21,7 @@ csysdep_bytes_free (zfile)
if (get_fs_usage ((char *) zfile, (char *) NULL, &s) < 0)
return -1;
if (s.fsu_bavail >= LONG_MAX / (long) 512)
return LONG_MAX;
return s.fsu_bavail * (long) 512;
}

View File

@ -3,7 +3,7 @@
lightly edited by Ian Lance Taylor. */
/* The bottom part of this file is lock.c.
* This is a hacked lock.c. A full lock.c can be found in the libmisc sources
* This is a hacked lock.c. A full lock.c can be found in the libmisc sources
* under /usr/src/misc.tar.Z.
*
* These are for checking for the existence of locks:
@ -146,7 +146,7 @@ char enable_device[16]; /* this will hold our device name
return TRUE;
}else{
/* device not enabled */
return TRUE;
return TRUE;
}
}
}
@ -192,7 +192,7 @@ char *buff;
{
struct stat sbuf;
int status;
if (0 != (status = stat(path, &sbuf))) {
/* Can't stat the file. */
return (NULL);

View File

@ -1,7 +1,7 @@
/* cusub.c
System dependent routines for cu.
Copyright (C) 1992, 1993 Ian Lance Taylor
Copyright (C) 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 cusub_rcsid[] = "$Id: cusub.c,v 1.2 1994/05/07 18:10:14 ache Exp $";
const char cusub_rcsid[] = "$Id: cusub.c,v 1.24 1995/06/21 19:18:53 ian Rel $";
#endif
#include "uudefs.h"
@ -330,7 +330,7 @@ fsysdep_cu (qconn, pbcmd, zlocalname)
if (c <= 0)
break;
if (fstart && b == *zCuvar_escape)
if (fstart && b == *zCuvar_escape && b != '\0')
{
c = cscu_escape (pbcmd, zlocalname);
if (c <= 0)
@ -410,7 +410,7 @@ cscu_escape (pbcmd, zlocalname)
usysdep_start_catch ();
alarm (1);
}
c = 0;
while (TRUE)
@ -426,7 +426,7 @@ cscu_escape (pbcmd, zlocalname)
b = ']';
write (1, &b, 1);
}
if (c <= 0)
c = read (0, pbcmd, 1);
if (c >= 0 || errno != EINTR)
@ -437,7 +437,7 @@ cscu_escape (pbcmd, zlocalname)
return c;
}
}
}
}
/* A SIGALRM handler which does nothing but send a signal to the child
process and schedule another alarm. POSIX.1 permits kill and alarm
@ -715,7 +715,7 @@ uscu_child (qconn, opipe)
cwrite -= c;
zbuf += c;
}
}
}
else
{
/* On some systems apparently read will return 0 until
@ -788,7 +788,7 @@ fsysdep_terminal_raw (flocalecho)
}
fSterm = TRUE;
sSterm_new = sSterm_orig;
#if HAVE_BSD_TTY
@ -1114,7 +1114,14 @@ fsysdep_shell (qconn, zcmd, tcmd)
int aidescs[3];
pid_t ipid;
azargs[0] = "/bin/sh";
if (tcmd != SHELL_NORMAL)
azargs[0] = "/bin/sh";
else
{
azargs[0] = getenv ("SHELL");
if (azargs[0] == NULL)
azargs[0] = "/bin/sh";
}
if (zcmd == NULL || *zcmd == '\0')
azargs[1] = NULL;
else
@ -1158,7 +1165,7 @@ fsysdep_shell (qconn, zcmd, tcmd)
aidescs[0] = oread;
if (tcmd == SHELL_STDOUT_TO_PORT || tcmd == SHELL_STDIO_ON_PORT)
aidescs[1] = owrite;
ipid = ixsspawn (azargs, aidescs, FALSE, TRUE, (const char *) NULL,
FALSE, FALSE, (const char *) NULL,
(const char *) NULL, (const char *) NULL);

View File

@ -37,7 +37,7 @@ zsysdep_local_file_cwd (zfile, zpubdir, pfbadname)
return zsysdep_local_file (zfile, zpubdir, pfbadname);
else
return zsysdep_add_cwd (zfile);
}
}
/* Add the current working directory to a remote file name. */

View File

@ -1,7 +1,7 @@
/* detach.c
Detach from the controlling terminal.
Copyright (C) 1992, 1993 Ian Lance Taylor
Copyright (C) 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.
*/
#include "uucp.h"
@ -38,7 +38,7 @@
#ifdef TIOCNOTTY
#define HAVE_TIOCNOTTY 1
#else
#define HAVE_TIOCNOTTY 0
#define HAVE_TIOCNOTTY 0
#endif
#if HAVE_FCNTL_H
@ -71,6 +71,11 @@ usysdep_detach ()
{
pid_t igrp;
/* Make sure that we can open the log file. We do this now so that,
if we can't, a message will be written to stderr. After we leave
this routine, stderr will be closed. */
ulog (LOG_NORMAL, (const char *) NULL);
/* Make sure we are not a process group leader. */
#if HAVE_BSD_PGRP
igrp = getpgrp (0);
@ -107,17 +112,24 @@ usysdep_detach ()
if (! fignored)
usset_signal (SIGHUP, ussignal, TRUE, (boolean *) NULL);
DEBUG_MESSAGE2 (DEBUG_PORT, "Forked; old PID %ld, new pid %ld",
DEBUG_MESSAGE2 (DEBUG_PORT,
"usysdep_detach: Forked; old PID %ld, new pid %ld",
(long) igrp, (long) ipid);
}
#if ! HAVE_SETSID && HAVE_TIOCNOTTY
/* Lose the original controlling terminal as well as our process
group. If standard input has been reopened to /dev/null, this
will do no harm. If another port has been opened to become the
controlling terminal, it should have been detached when it was
closed. */
(void) ioctl (0, TIOCNOTTY, (char *) NULL);
group. */
{
int o;
o = open ((char *) "/dev/tty", O_RDONLY);
if (o >= 0)
{
(void) ioctl (o, TIOCNOTTY, (char *) NULL);
(void) close (o);
}
}
#endif /* ! HAVE_SETSID && HAVE_TIOCNOTTY */
/* Close stdin, stdout and stderr and reopen them on /dev/null, to

View File

@ -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.
*/
#include "uucp.h"

View File

@ -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.
*/
#include "uucp.h"
@ -47,7 +47,7 @@ dup2 (oold, onew)
if (oold == onew)
return onew;
(void) close (onew);
#ifdef F_DUPFD
return fcntl (oold, F_DUPFD, onew);
#else

View File

@ -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.
*/
#include "uucp.h"
@ -78,7 +78,7 @@ espopen (pazargs, frd, pipid)
errno = ierr;
return NULL;
}
*pipid = ipid;
return eret;

View File

@ -0,0 +1,26 @@
/* failed.c
Save a file in the .Failed directory. */
#include "uucp.h"
#include "sysdep.h"
#include "uudefs.h"
#include "system.h"
char *
zsysdep_save_failed_file (zfile)
const char *zfile;
{
char *zto;
zto = zsappend3 (zSspooldir, FAILEDDIR, zfile);
if (! fsysdep_move_file (zfile, zto, TRUE, FALSE, FALSE,
(const char *) NULL))
{
ubuffree (zto);
return NULL;
}
return zto;
}

View File

@ -1,7 +1,7 @@
/* filnam.c
Get names to use for UUCP files.
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.
*/
#include "uucp.h"
@ -56,6 +56,23 @@
#define SEEK_SET 0
#endif
/* We use POSIX style fcntl locks if they are available, unless
O_CREAT is not defined. We could use them in the latter case, but
the code would have to become more complex to avoid races
concerning the use of creat. It is very unlikely that there is any
system which does have POSIX style locking but does not have
O_CREAT. */
#if ! HAVE_BROKEN_SETLKW
#ifdef F_SETLKW
#ifdef O_CREAT
#define USE_POSIX_LOCKS 1
#endif
#endif
#endif
#ifndef USE_POSIX_LOCKS
#define USE_POSIX_LOCKS 0
#endif
/* External functions. */
#ifndef lseek
extern off_t lseek ();
@ -83,21 +100,31 @@ fscmd_seq (zsystem, zseq)
const char *zsystem;
char *zseq;
{
boolean ferr;
int cdelay;
char *zfree;
const char *zfile;
int o;
boolean flockfile;
int i;
boolean fret;
/* Lock the sequence file. This may not be correct for all systems,
but it only matters if the system UUCP and this UUCP are running
at the same time. */
while (! fsdo_lock ("LCK..SEQ", TRUE, &ferr))
{
if (ferr || FGOT_SIGNAL ())
return FALSE;
sleep (5);
}
cdelay = 5;
#if ! USE_POSIX_LOCKS
{
boolean ferr;
/* Lock the sequence file. */
while (! fsdo_lock ("LCK..SEQ", TRUE, &ferr))
{
if (ferr || FGOT_SIGNAL ())
return FALSE;
sleep (cdelay);
if (cdelay < 60)
++cdelay;
}
}
#endif
zfree = NULL;
@ -123,12 +150,12 @@ fscmd_seq (zsystem, zseq)
#endif /* SPOOLDIR_TAYLOR */
#ifdef O_CREAT
o = open ((char *) zfile, O_RDWR | O_CREAT | O_NOCTTY, IPUBLIC_FILE_MODE);
o = open ((char *) zfile, O_RDWR | O_CREAT | O_NOCTTY, IPRIVATE_FILE_MODE);
#else
o = open ((char *) zfile, O_RDWR | O_NOCTTY);
if (o < 0 && errno == ENOENT)
{
o = creat ((char *) zfile, IPUBLIC_FILE_MODE);
o = creat ((char *) zfile, IPRIVATE_FILE_MODE);
if (o >= 0)
{
(void) close (o);
@ -143,15 +170,17 @@ fscmd_seq (zsystem, zseq)
{
if (! fsysdep_make_dirs (zfile, FALSE))
{
#if ! USE_POSIX_LOCKS
(void) fsdo_unlock ("LCK..SEQ", TRUE);
#endif
return FALSE;
}
#ifdef O_CREAT
o = open ((char *) zfile,
O_RDWR | O_CREAT | O_NOCTTY,
IPUBLIC_FILE_MODE);
IPRIVATE_FILE_MODE);
#else
o = creat ((char *) zfile, IPUBLIC_FILE_MODE);
o = creat ((char *) zfile, IPRIVATE_FILE_MODE);
if (o >= 0)
{
(void) close (o);
@ -162,11 +191,79 @@ fscmd_seq (zsystem, zseq)
if (o < 0)
{
ulog (LOG_ERROR, "open (%s): %s", zfile, strerror (errno));
#if ! USE_POSIX_LOCKS
(void) fsdo_unlock ("LCK..SEQ", TRUE);
#endif
return FALSE;
}
}
#if ! USE_POSIX_LOCKS
flockfile = TRUE;
#else
{
struct flock slock;
flockfile = FALSE;
slock.l_type = F_WRLCK;
slock.l_whence = SEEK_SET;
slock.l_start = 0;
slock.l_len = 0;
while (fcntl (o, F_SETLKW, &slock) == -1)
{
boolean fagain;
/* Some systems define F_SETLKW, but it does not work. We try
to catch those systems at runtime, and revert to using a
lock file. */
if (errno == EINVAL)
{
boolean ferr;
/* Lock the sequence file. */
while (! fsdo_lock ("LCK..SEQ", TRUE, &ferr))
{
if (ferr || FGOT_SIGNAL ())
{
(void) close (o);
return FALSE;
}
sleep (cdelay);
if (cdelay < 60)
++cdelay;
}
flockfile = TRUE;
break;
}
fagain = FALSE;
if (errno == ENOMEM)
fagain = TRUE;
#ifdef ENOLCK
if (errno == ENOLCK)
fagain = TRUE;
#endif
#ifdef ENOSPC
if (errno == ENOSPC)
fagain = TRUE;
#endif
if (fagain)
{
sleep (cdelay);
if (cdelay < 60)
++cdelay;
continue;
}
ulog (LOG_ERROR, "Locking %s: %s", zfile, strerror (errno));
(void) close (o);
return FALSE;
}
}
#endif
if (read (o, zseq, CSEQLEN) != CSEQLEN)
strcpy (zseq, "0000");
zseq[CSEQLEN] = '\0';
@ -199,19 +296,24 @@ fscmd_seq (zsystem, zseq)
}
#endif /* SPOOLDIR_ULTRIX || SPOOLDIR_TAYLOR */
fret = TRUE;
if (lseek (o, (off_t) 0, SEEK_SET) < 0
|| write (o, zseq, CSEQLEN) != CSEQLEN
|| close (o) < 0)
{
ulog (LOG_ERROR, "lseek or write or close: %s", strerror (errno));
ulog (LOG_ERROR, "lseek or write or close %s: %s",
zfile, strerror (errno));
(void) close (o);
(void) fsdo_unlock ("LCK..SEQ", TRUE);
return FALSE;
fret = FALSE;
}
(void) fsdo_unlock ("LCK..SEQ", TRUE);
if (flockfile)
(void) fsdo_unlock ("LCK..SEQ", TRUE);
return TRUE;
ubuffree (zfree);
return fret;
}
/* Get the name of a command or data file for a remote system. The
@ -266,9 +368,9 @@ zsfile_name (btype, zsystem, zlocalname, bgrade, fxqt, ztname, zdname, zxname)
our system name so that remote UUCP's running SPOOLDIR_V2
and the like can distinguish while files come from which
systems. */
#if SPOOLDIR_HDB || SPOOLDIR_SVR4
#if SPOOLDIR_SVR4
sprintf (absimple, "D.%.7s%c%s", zsystem, bgrade, abseq);
#else /* ! SPOOLDIR_HDB && ! SPOOLDIR_SVR4 */
#else /* ! SPOOLDIR_SVR4 */
#if ! SPOOLDIR_TAYLOR
sprintf (absimple, "D.%.7s%c%s", zlocalname, bgrade, abseq);
#else /* SPOOLDIR_TAYLOR */
@ -329,10 +431,41 @@ zsysdep_data_file_name (qsys, zlocalname, bgrade, fxqt, ztname, zdname,
char *zdname;
char *zxname;
{
return zsfile_name ('D', qsys->uuconf_zname, zlocalname, bgrade, fxqt,
return zsfile_name ('D', qsys->uuconf_zname, zlocalname, bgrade, fxqt,
ztname, zdname, zxname);
}
#if SPOOLDIR_TAYLOR
/* Write out a number in base 62 into a given number of characters,
right justified with zero fill. This is used by zscmd_file if
SPOOLDIR_TAYLOR. */
static void usput62 P((long i, char *, int c));
static void
usput62 (i, z, c)
long i;
char *z;
int c;
{
for (--c; c >= 0; --c)
{
int d;
d = i % 62;
i /= 62;
if (d < 26)
z[c] = 'A' + d;
else if (d < 52)
z[c] = 'a' + d - 26;
else
z[c] = '0' + d - 52;
}
}
#endif /* SPOOLDIR_TAYLOR */
/* Get a command file name. */
char *
@ -340,9 +473,84 @@ zscmd_file (qsys, bgrade)
const struct uuconf_system *qsys;
int bgrade;
{
#if ! SPOOLDIR_TAYLOR
return zsfile_name ('C', qsys->uuconf_zname, (const char *) NULL,
bgrade, FALSE, (char *) NULL, (char *) NULL,
(char *) NULL);
#else
char *zname;
long isecs, imicros;
pid_t ipid;
/* This file name is never seen by the remote system, so we don't
actually need to get a sequence number for it. We just need to
get a file name which is unique for this system. We don't try
this optimization for other spool directory formats, mainly due
to compatibility concerns. It would be possible for HDB and SVR4
spool directory formats.
We get a unique name by combining the process ID and the current
time. The file name must start with C.g, where g is the grade.
Note that although it is likely that this name will be unique, it
is not guaranteed, so the caller must be careful. */
isecs = ixsysdep_time (&imicros);
ipid = getpid ();
/* We are going to represent the file name as a series of numbers in
base 62 (using the alphanumeric characters). The maximum file
name length is 14 characters, so we may use 11. We use 3 for the
seconds within the day, 3 for the microseconds, and 5 for the
process ID. */
/* Cut the seconds down to a number within a day (maximum value
86399 < 62 ** 3 == 238328). */
isecs %= (long) 24 * (long) 60 * (long) 60;
/* Divide the microseconds (max 999999) by 5 to make sure they are
less than 62 ** 3. */
imicros %= 1000000;
imicros /= 5;
while (TRUE)
{
char ab[15];
ab[0] = 'C';
ab[1] = '.';
ab[2] = bgrade;
usput62 (isecs, ab + 3, 3);
usput62 (imicros, ab + 6, 3);
usput62 ((long) ipid, ab + 9, 5);
ab[14] = '\0';
zname = zsfind_file (ab, qsys->uuconf_zname, bgrade);
if (zname == NULL)
return NULL;
if (! fsysdep_file_exists (zname))
break;
ubuffree (zname);
/* We hit a duplicate. Move backward in time until we find an
available name. Note that there is still a theoretical race
condition, since 5 base 62 digits might not be enough for the
process ID, and some other process might be running these
checks at the same time as we are. The caller must deal with
this. */
if (imicros == 0)
{
imicros = (long) 62 * (long) 62 * (long) 62;
if (isecs == 0)
isecs = (long) 62 * (long) 62 * (long) 62;
--isecs;
}
--imicros;
}
return zname;
#endif
}
/* Return a name for an execute file to be created locally. This is

View File

@ -1,5 +1,5 @@
/* fsusage.c -- return space usage of mounted filesystems
Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
Copyright (C) 1991, 1992 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -13,74 +13,70 @@
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.
This file was modified slightly by Ian Lance Taylor, December 1992,
for use with Taylor UUCP. */
and again July 1995, for use with Taylor UUCP. */
#include "uucp.h"
#include "uudefs.h"
#include "sysdep.h"
#include "fsusg.h"
#if STAT_STATFS2_BSIZE
#ifdef __FreeBSD__
int statfs ();
#if HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#if HAVE_SYS_MOUNT_H
#include <sys/mount.h>
#else
#ifndef _IBMR2 /* 4.3BSD, SunOS 4, HP-UX, AIX PS/2. */
#endif
#if HAVE_SYS_VFS_H
#include <sys/vfs.h>
#endif
#endif
#if HAVE_SYS_FILSYS_H
#include <sys/filsys.h> /* SVR2. */
#endif
#if STAT_STATFS2_FSIZE /* 4.4BSD. */
#include <sys/mount.h>
#if HAVE_FCNTL_H
#include <fcntl.h>
#endif
#if STAT_STATFS2_FS_DATA /* Ultrix. */
#include <sys/param.h>
#include <sys/mount.h>
#endif
#if STAT_USTAT /* SVR2 and others. */
#include <ustat.h>
#endif
#if STAT_STATFS4 /* SVR3, Dynix, Irix. */
#if HAVE_SYS_STATFS_H
#include <sys/statfs.h>
#endif
#ifdef _AIX
#ifdef _IBMR2 /* AIX RS6000. */
#include <sys/statfs.h>
#endif
#endif
#if STAT_DUSTAT /* AIX PS/2. */
#include <sys/stat.h>
#if HAVE_SYS_DUSTAT_H /* AIX PS/2. */
#include <sys/dustat.h>
#endif
#if STAT_STATVFS /* SVR4. */
#if HAVE_SYS_STATVFS_H /* SVR4. */
#include <sys/statvfs.h>
int statvfs ();
#endif
#if HAVE_USTAT_H /* SVR2 and others. */
#include <ustat.h>
#endif
#if STAT_DISK_SPACE /* QNX. */
#include <sys/disk.h>
#include <fcntl.h>
#include <errno.h>
#endif
#define STAT_NONE 0
#if ! STAT_STATVFS
#if ! STAT_STATFS3_OSF1
#if ! STAT_STATFS2_FS_DATA
#if ! STAT_STATFS2_BSIZE
#if ! STAT_STATFS2_FSIZE
#if ! STAT_STATFS2_FS_DATA
#if ! STAT_STATFS4
#if ! STAT_DUSTAT
#if ! STAT_USTAT
#if ! STAT_STATVFS
#if ! STAT_DISK_SPACE
#if ! STAT_USTAT
#undef STAT_NONE
#define STAT_NONE 1
#endif
@ -97,19 +93,25 @@
static long adjust_blocks P((long blocks, int fromsize, int tosize));
/* Return the number of TOSIZE-byte blocks used by
BLOCKS FROMSIZE-byte blocks, rounding up. */
BLOCKS FROMSIZE-byte blocks, rounding away from zero.
TOSIZE must be positive. Return -1 if FROMSIZE is not positive. */
static long
adjust_blocks (blocks, fromsize, tosize)
long blocks;
int fromsize, tosize;
{
if (tosize <= 0)
abort ();
if (fromsize <= 0)
return -1;
if (fromsize == tosize) /* E.g., from 512 to 512. */
return blocks;
else if (fromsize > tosize) /* E.g., from 2048 to 512. */
return blocks * (fromsize / tosize);
else /* E.g., from 256 to 512. */
return (blocks + 1) / (tosize / fromsize);
return (blocks + (blocks < 0 ? -1 : 1)) / (tosize / fromsize);
}
#endif
@ -129,25 +131,33 @@ get_fs_usage (path, disk, fsp)
return -1;
#endif
#if STAT_STATFS3_OSF1
struct statfs fsd;
if (statfs (path, &fsd, sizeof (struct statfs)) != 0)
return -1;
#define CONVERT_BLOCKS(b) adjust_blocks ((b), fsd.f_fsize, 512)
#endif /* STAT_STATFS3_OSF1 */
#if STAT_STATFS2_FS_DATA /* Ultrix. */
struct fs_data fsd;
if (statfs (path, &fsd) != 1)
return -1;
#define convert_blocks(b) adjust_blocks ((long) (b), 1024, 512)
fsp->fsu_blocks = convert_blocks (fsd.fd_req.btot);
fsp->fsu_bfree = convert_blocks (fsd.fd_req.bfree);
fsp->fsu_bavail = convert_blocks (fsd.fd_req.bfreen);
#define CONVERT_BLOCKS(b) adjust_blocks ((long) (b), 1024, 512)
fsp->fsu_blocks = CONVERT_BLOCKS (fsd.fd_req.btot);
fsp->fsu_bfree = CONVERT_BLOCKS (fsd.fd_req.bfree);
fsp->fsu_bavail = CONVERT_BLOCKS (fsd.fd_req.bfreen);
fsp->fsu_files = fsd.fd_req.gtot;
fsp->fsu_ffree = fsd.fd_req.gfree;
#endif
#if STAT_STATFS2_BSIZE || STAT_DUSTAT /* 4.3BSD, SunOS 4, HP-UX, AIX. */
#if STAT_STATFS2_BSIZE /* 4.3BSD, SunOS 4, HP-UX, AIX. */
struct statfs fsd;
if (statfs (path, &fsd) < 0)
return -1;
#define convert_blocks(b) adjust_blocks ((b), fsd.f_bsize, 512)
#define CONVERT_BLOCKS(b) adjust_blocks ((b), fsd.f_bsize, 512)
#endif
#if STAT_STATFS2_FSIZE /* 4.4BSD. */
@ -155,7 +165,7 @@ get_fs_usage (path, disk, fsp)
if (statfs (path, &fsd) < 0)
return -1;
#define convert_blocks(b) adjust_blocks ((b), fsd.f_fsize, 512)
#define CONVERT_BLOCKS(b) adjust_blocks ((b), fsd.f_fsize, 512)
#endif
#if STAT_STATFS4 /* SVR3, Dynix, Irix. */
@ -166,10 +176,16 @@ get_fs_usage (path, disk, fsp)
/* Empirically, the block counts on most SVR3 and SVR3-derived
systems seem to always be in terms of 512-byte blocks,
no matter what value f_bsize has. */
#define convert_blocks(b) (b)
#ifndef _SEQUENT_ /* _SEQUENT_ is DYNIX/ptx. */
#define f_bavail f_bfree
#endif
# if _AIX
# define CONVERT_BLOCKS(b) adjust_blocks ((b), fsd.f_bsize, 512)
# else
# define CONVERT_BLOCKS(b) (b)
# ifndef _SEQUENT_ /* _SEQUENT_ is DYNIX/ptx. */
# ifndef DOLPHIN /* DOLPHIN 3.8.alfa/7.18 has f_bavail */
# define f_bavail f_bfree
# endif
# endif
# endif
#endif
#if STAT_STATVFS /* SVR4. */
@ -178,7 +194,7 @@ get_fs_usage (path, disk, fsp)
if (statvfs (path, &fsd) < 0)
return -1;
/* f_frsize isn't guaranteed to be supported. */
#define convert_blocks(b) \
#define CONVERT_BLOCKS(b) \
adjust_blocks ((b), fsd.f_frsize ? fsd.f_frsize : fsd.f_bsize, 512)
#endif
@ -188,7 +204,7 @@ get_fs_usage (path, disk, fsp)
long cfree_blocks, ctotal_blocks;
char *zpath;
char *zslash;
zpath = zbufcpy (path);
while ((o = open (zpath, O_RDONLY, 0)) == -1
&& errno == ENOENT)
@ -247,7 +263,7 @@ get_fs_usage (path, disk, fsp)
fsp->fsu_blocks = ctotal_blocks;
fsp->fsu_bfree = cfree_blocks;
fsp->fsu_bavail = cfree_blocks;
/* QNX has no limit on the number of inodes. Most inodes are stored
directly in the directory entry. */
fsp->fsu_files = -1;
@ -272,9 +288,9 @@ get_fs_usage (path, disk, fsp)
#if ! STAT_DISK_SPACE
#if ! STAT_USTAT
#if ! STAT_NONE
fsp->fsu_blocks = convert_blocks (fsd.f_blocks);
fsp->fsu_bfree = convert_blocks (fsd.f_bfree);
fsp->fsu_bavail = convert_blocks (fsd.f_bavail);
fsp->fsu_blocks = CONVERT_BLOCKS (fsd.f_blocks);
fsp->fsu_bfree = CONVERT_BLOCKS (fsd.f_bfree);
fsp->fsu_bavail = CONVERT_BLOCKS (fsd.f_bavail);
fsp->fsu_files = fsd.f_files;
fsp->fsu_ffree = fsd.f_ffree;
#endif
@ -285,7 +301,8 @@ get_fs_usage (path, disk, fsp)
return 0;
}
#if STAT_DUSTAT
#ifdef _AIX
#ifdef _I386
/* AIX PS/2 does not supply statfs. */
int
@ -311,4 +328,5 @@ statfs (path, fsb)
fsb->f_fsid.val[1] = fsd.du_pckno;
return 0;
}
#endif /* STAT_DUSTAT */
#endif /* _I386 */
#endif /* _AIX */

View File

@ -13,7 +13,7 @@
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.
This files was modified slightly by Ian Lance Taylor for use with
Taylor UUCP. */

View File

@ -14,8 +14,8 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA.
not, write to the Free Software Foundation, Inc., 59 Temple Place -
Suite 330, Boston, MA 02111-1307, USA.
Modified by Ian Lance Taylor for Taylor UUCP, June 1992, and October 1993. */
@ -76,7 +76,7 @@ ftw_dir (dirs, level, descriptors, dir, len, func)
{
size_t namlen;
struct stat s;
int flag, ret, newlev;
int flag, ret, newlev = 0;
++got;

View File

@ -48,7 +48,7 @@ getcwd (zbuf, cbuf)
cread = 0;
}
}
if (cread == 0)
{
errno = ierr;

View File

@ -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.
*/
#include "uucp.h"

View File

@ -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.
*/
#include "uucp.h"

View File

@ -1,4 +1,4 @@
/* isfork.c
/* isfork.c
Retry fork several times before giving up. */
#include "uucp.h"

View File

@ -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.
*/
#include "uucp.h"
@ -134,7 +134,7 @@ ixswait (ipid, zreport)
}
}
#endif /* ! HAVE_WAIT4 */
#endif /* ! HAVE_WAITPID */
#endif /* ! HAVE_WAITPID */
DEBUG_MESSAGE2 (DEBUG_EXECUTE, "%s %d",
WIFEXITED (istat) ? "Exit status" : "Signal",

View File

@ -1,7 +1,7 @@
/* jobid.c
Convert file names to jobids and vice versa.
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,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.
*/
#include "uucp.h"
@ -31,10 +31,7 @@
#include "system.h"
/* Translate a file name and an associated system into a job id.
These job ids are used by uustat. We use the system name attached
to the grade and sequence number. This won't work correctly if the
file name was actually created by some other version of uucp that
uses a different length for the sequence number. Too bad. */
These job ids are used by uustat. */
char *
zsfile_to_jobid (qsys, zfile, bgrade)
@ -46,10 +43,50 @@ zsfile_to_jobid (qsys, zfile, bgrade)
char *zret;
clen = strlen (qsys->uuconf_zname);
#if ! SPOOLDIR_TAYLOR
/* We use the system name attached to the grade and sequence number.
This won't work correctly if the file name was actually created
by some other version of uucp that uses a different length for
the sequence number. Too bad. */
zret = zbufalc (clen + CSEQLEN + 2);
memcpy (zret, qsys->uuconf_zname, clen);
zret[clen] = bgrade;
memcpy (zret + clen + 1, zfile + strlen (zfile) - CSEQLEN, CSEQLEN + 1);
#else
/* We use the system name followed by a dot, the grade, and the
sequence number. In this case, the sequence number is a long
string. */
{
size_t cseqlen;
/* zfile is SYS/C./C.gseq. */
zfile = strrchr (zfile, '/');
#if DEBUG > 0
if (zfile == NULL
|| zfile[1] != 'C'
|| zfile[2] != '.'
|| zfile[3] == '\0')
ulog (LOG_FATAL, "zsfile_to_jobid: Can't happen");
#endif
/* Make zfile point at .gseq. */
zfile += 2;
cseqlen = strlen (zfile);
zret = zbufalc (clen + cseqlen + 1);
memcpy (zret, qsys->uuconf_zname, clen);
memcpy (zret + clen, zfile, cseqlen + 1);
}
#endif
return zret;
}
@ -61,6 +98,7 @@ zsjobid_to_file (zid, pzsystem, pbgrade)
char **pzsystem;
char *pbgrade;
{
#if ! SPOOLDIR_TAYLOR
size_t clen;
const char *zend;
char *zsys;
@ -81,11 +119,7 @@ zsjobid_to_file (zid, pzsystem, pbgrade)
zsys[clen - CSEQLEN - 1] = '\0';
/* This must correspond to zsfile_name. */
#if ! SPOOLDIR_TAYLOR
sprintf (abname, "C.%.7s%s", zsys, zend);
#else
sprintf (abname, "C.%s", zend);
#endif
zret = zsfind_file (abname, zsys, *zend);
@ -98,4 +132,38 @@ zsjobid_to_file (zid, pzsystem, pbgrade)
*pbgrade = *zend;
return zret;
#else /* SPOOLDIR_TAYLOR */
char *zdot;
size_t csyslen;
char *zsys;
char ab[15];
char *zret;
zdot = strrchr (zid, '.');
if (zdot == NULL)
{
ulog (LOG_ERROR, "%s: Bad job id", zid);
return NULL;
}
csyslen = zdot - zid;
zsys = zbufalc (csyslen + 1);
memcpy (zsys, zid, csyslen);
zsys[csyslen] = '\0';
ab[0] = 'C';
strcpy (ab + 1, zdot);
zret = zsfind_file (ab, zsys, zdot[1]);
if (zret != NULL && pzsystem != NULL)
*pzsystem = zsys;
else
ubuffree (zsys);
if (pbgrade != NULL)
*pbgrade = zdot[1];
return zret;
#endif /* SPOOLDIR_TAYLOR */
}

View File

@ -8,21 +8,39 @@
#include "sysdep.h"
#include "system.h"
/* Get the name of a system lock file. */
/* Do the actual lock or unlock. */
static char *zssys_lock_name P((const struct uuconf_system *qsys, char *z));
static boolean fslock_sys P((boolean, const char *));
#define LOCKNAMELEN (sizeof "LCK..12345678")
static char *
zssys_lock_name (qsys, z)
const struct uuconf_system *qsys;
char *z;
static boolean
fslock_sys (flock, zname)
boolean flock;
const char *zname;
{
strcpy (z, "LCK..");
strncpy (z + sizeof "LCK.." - 1, qsys->uuconf_zname, 8);
z[sizeof "LCK.." - 1 + 8] = '\0';
return z;
size_t clen;
char *z;
boolean fret;
clen = strlen (zname);
#if ! HAVE_LONG_FILE_NAMES
if (clen > 8)
clen = 8;
#endif
z = zbufalc (sizeof "LCK.." + clen);
memcpy (z, "LCK..", sizeof "LCK.." - 1);
memcpy (z + sizeof "LCK.." - 1, zname, clen);
z[sizeof "LCK.." - 1 + clen] = '\0';
if (flock)
fret = fsdo_lock (z, FALSE, (boolean *) NULL);
else
fret = fsdo_unlock (z, FALSE);
ubuffree (z);
return fret;
}
/* Lock a remote system. */
@ -31,9 +49,7 @@ boolean
fsysdep_lock_system (qsys)
const struct uuconf_system *qsys;
{
char ab[LOCKNAMELEN];
return fsdo_lock (zssys_lock_name (qsys, ab), FALSE, (boolean *) NULL);
return fslock_sys (TRUE, qsys->uuconf_zname);
}
/* Unlock a remote system. */
@ -42,7 +58,5 @@ boolean
fsysdep_unlock_system (qsys)
const struct uuconf_system *qsys;
{
char ab[LOCKNAMELEN];
return fsdo_unlock (zssys_lock_name (qsys, ab), FALSE);
return fslock_sys (FALSE, qsys->uuconf_zname);
}

View File

@ -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.
*/
#include "uucp.h"
@ -77,7 +77,7 @@ zsysdep_local_file (zfile, zpubdir, pfbadname)
zcopy = zbufalc (cuserlen + 1);
memcpy (zcopy, zfile, cuserlen);
zcopy[cuserlen] = '\0';
q = getpwnam (zcopy);
if (q == NULL)
{

View File

@ -1,7 +1,7 @@
/* lock.c
Lock and unlock a file name.
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 lock_rcsid[] = "$Id: lock.c,v 1.2 1994/05/07 18:10:40 ache Exp $";
const char lock_rcsid[] = "$Id: lock.c,v 1.20 1995/06/21 19:19:38 ian Rel $";
#endif
#include "uudefs.h"
@ -34,6 +34,7 @@ const char lock_rcsid[] = "$Id: lock.c,v 1.2 1994/05/07 18:10:40 ache Exp $";
#include "system.h"
#include <errno.h>
#include <ctype.h>
#if HAVE_FCNTL_H
#include <fcntl.h>
@ -178,7 +179,7 @@ fsdo_lock (zlock, fspooldir, pferr)
}
#if HAVE_QNX_LOCKFILES
sprintf (ab, "%10ld %10ld\n", (long) ime, (long) inid);
sprintf (ab, "%10ld %10ld\n", (long) ime, (long) inme);
cwrote = write (o, ab, strlen (ab));
#else
#if HAVE_V2_LOCKFILES
@ -274,6 +275,25 @@ fsdo_lock (zlock, fspooldir, pferr)
break;
}
#if DEBUG > 0
#if HAVE_V2_LOCKFILES
{
char ab[10];
if (read (o, ab, sizeof ab) > 4
&& isdigit (BUCHAR (ab[0])))
ulog (LOG_ERROR,
"Lock file %s may be HDB format; check LOCKFILES in policy.h",
zpath);
}
#else
if (cgot == 4)
ulog (LOG_ERROR,
"Lock file %s may be V2 format; check LOCKFILES in policy.h",
zpath);
#endif
#endif /* DEBUG > 0 */
#if HAVE_QNX_LOCKFILES
ab[cgot] = '\0';
ipid = (pid_t) strtol (ab, &zend, 10);
@ -308,17 +328,23 @@ fsdo_lock (zlock, fspooldir, pferr)
}
}
/* If the lock file is empty (cgot == 0), we assume that it is
stale. This can happen if the system crashed after the lock
file was created but before the process ID was written out. */
if (cgot > 0)
{
#if HAVE_QNX_LOCKFILES
if (! fsqnx_stale ((unsigned long) ipid, (unsigned long) inme,
(unsigned long) inid, pferr))
break;
if (! fsqnx_stale ((unsigned long) ipid, (unsigned long) inme,
(unsigned long) inid, pferr))
break;
#else
/* If the process still exists, we will get EPERM rather than
ESRCH. We then return FALSE to indicate that we cannot make
the lock. */
if (kill (ipid, 0) == 0 || errno == EPERM)
break;
/* If the process still exists, we will get EPERM rather
than ESRCH. We then return FALSE to indicate that we
cannot make the lock. */
if (kill (ipid, 0) == 0 || errno == EPERM)
break;
#endif
}
if (fstat (o, &st) < 0)
strcpy (abtime, "unknown");
@ -411,7 +437,7 @@ fsdo_lock (zlock, fspooldir, pferr)
}
#if HAVE_QNX_LOCKFILES
sprintf (ab, "%10ld %10ld\n", (long) ime, (long) inid);
sprintf (ab, "%10ld %10ld\n", (long) ime, (long) inme);
cwrote = write (o, ab, strlen (ab));
#else
#if HAVE_V2_LOCKFILES
@ -620,7 +646,7 @@ fsqnx_stale (ipid, inme, inid, pferr)
/* Use the local pid of the local process manager. */
ivid = PROC_PID;
}
/* Request the process information. */
ifound_pid = qnx_psinfo (ivid /* process manager handling request */,
ipid /* get info on this process */,
@ -636,7 +662,7 @@ fsqnx_stale (ipid, inme, inid, pferr)
strerror (errno));
errno = isaved_errno;
}
/* If the returned pid matches then the process still holds the lock. */
if ((ifound_pid == ipid) && (spsdata.pid == ipid))
return FALSE;

View File

@ -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.
*/
#include "uucp.h"

View File

@ -28,9 +28,18 @@ fsysdep_make_dirs (zfile, fpublic)
{
if (*z == '/' && z != zcopy)
{
/* Some versions of uuto will send a double slash. Some
systems will fail to create a directory ending in a
slash. */
if (z[-1] == '/')
continue;
*z = '\0';
if (mkdir (zcopy, imode) != 0
&& errno != EEXIST
&& errno != EISDIR
#ifdef EROFS
&& errno != EROFS
#endif
&& (errno != EACCES || ! fsysdep_directory (zcopy)))
{
ulog (LOG_ERROR, "mkdir (%s): %s", zcopy,
@ -38,10 +47,7 @@ fsysdep_make_dirs (zfile, fpublic)
ubuffree (zcopy);
return FALSE;
}
*z = '/'; /* replace '/' in its place */
/* now skips over multiple '/' in name */
while ( (*(z + 1)) && (*(z + 1)) == '/')
z++;
*z = '/';
}
}

View File

@ -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.
*/
#include "uucp.h"
@ -152,7 +152,7 @@ fsysdep_move_file (zorig, zto, fmkdirs, fpublic, fcheck, zuser)
}
(void) close (o);
if (! fcopy_file (zorig, zto, fpublic, fmkdirs))
if (! fcopy_file (zorig, zto, fpublic, fmkdirs, FALSE))
return FALSE;
if (remove (zorig) != 0)

View File

@ -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.
*/
#include "uucp.h"
@ -75,7 +75,7 @@ esysdep_open_send (qsys, zfile, fcheck, zuser)
struct stat s;
openfile_t e;
int o;
if (fsysdep_directory (zfile))
{
ulog (LOG_ERROR, "%s: is a directory", zfile);
@ -148,7 +148,7 @@ zsysdep_receive_temp (qsys, zto, ztemp, frestart)
return zsappend3 (".Temp", qsys->uuconf_zname, ztemp);
else
return zstemp_file (qsys);
}
}
/* The number of seconds in one week. We must cast to long for this
to be calculated correctly on a machine with 16 bit ints. */

View File

@ -7,27 +7,29 @@
#include "system.h"
/* Pick a timing routine to use. I somewhat arbitrarily picked usleep
above nap above napms above poll above select. */
#if HAVE_USLEEP || HAVE_NAP || HAVE_NAPMS || HAVE_POLL
above napms above poll above select above nap. The nap function is
last because on different systems the argument has different
meanings. */
#if HAVE_USLEEP || HAVE_NAPMS || HAVE_POLL || HAVE_SELECT
#undef HAVE_NAP
#define HAVE_NAP 0
#endif
#if HAVE_USLEEP || HAVE_NAPMS || HAVE_POLL
#undef HAVE_SELECT
#define HAVE_SELECT 0
#endif
#if HAVE_USLEEP || HAVE_NAP || HAVE_NAPMS
#if HAVE_USLEEP || HAVE_NAPMS
#undef HAVE_POLL
#define HAVE_POLL 0
#endif
#if HAVE_USLEEP || HAVE_NAP
#if HAVE_USLEEP
#undef HAVE_NAPMS
#define HAVE_NAPMS 0
#endif
#if HAVE_USLEEP
#undef HAVE_NAP
#define HAVE_NAP 0
#endif
#if HAVE_SELECT
#if HAVE_SYS_TIME_H
#include <sys/time.h>
@ -81,6 +83,7 @@ usysdep_pause ()
/* We need to pass an unused pollfd structure because poll checks
the address before checking the number of elements. */
memset (&sdummy, 0, sizeof sdummy);
poll (&sdummy, 0, 500);
#endif /* HAVE_POLL */
#if HAVE_SELECT

View File

@ -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 picksb_rcsid[] = "$Id: picksb.c,v 1.2 1994/05/07 18:10:54 ache Exp $";
const char picksb_rcsid[] = "$Id: picksb.c,v 1.10 1995/06/21 19:19:54 ian Rel $";
#endif
#include "uudefs.h"
@ -219,7 +219,7 @@ zsysdep_uupick_local_file (zfile, pfbadname)
if (zfile[0] != '~'
|| (zfile[1] != '/' && zfile[1] != '\0'))
return zsysdep_local_file_cwd (zfile, (const char *) NULL, pfbadname);
q = getpwuid (getuid ());
if (q == NULL)
{

View File

@ -18,16 +18,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 pipe_rcsid[] = "$Id: pipe.c,v 1.4 1994/03/25 04:09:30 ian Rel $";
const char pipe_rcsid[] = "$Id: pipe.c,v 1.6 1995/06/21 19:19:57 ian Rel $";
#endif
#include "uudefs.h"

View File

@ -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.
*/
#include "uucp.h"

View File

@ -1,7 +1,7 @@
/* recep.c
See whether a file has already been received.
Copyright (C) 1992, 1993 Ian Lance Taylor
Copyright (C) 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.
*/
#include "uucp.h"
@ -50,7 +50,7 @@ static char *zsreceived_name P((const struct uuconf_system *qsys,
/* These routines are used to see whether we have already received a
file in a previous UUCP connection. It is possible for the
acknowledgement of a received file to be lost. The sending system
will then now know that the file was correctly received, and will
will then not know that the file was correctly received, and will
send it again. This can be a problem particularly with protocols
which support channels, since they may send several small files in
a single window, all of which may be received correctly although

View File

@ -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.
*/
#include "uucp.h"

View File

@ -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.
*/
#include "uucp.h"
@ -68,7 +68,7 @@ ixsysdep_get_sequence (qsys)
ubuffree (zname);
return -1;
}
e = fopen (zname, "r+");
if (e == NULL)
{

View File

@ -1,7 +1,7 @@
/* serial.c
The serial port communication routines for Unix.
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 serial_rcsid[] = "$Id: serial.c,v 1.4 1994/05/07 18:11:09 ache Exp $";
const char serial_rcsid[] = "$Id: serial.c,v 1.65 1995/08/10 00:53:54 ian Rel $";
#endif
#include "uudefs.h"
@ -82,7 +82,7 @@ const char serial_rcsid[] = "$Id: serial.c,v 1.4 1994/05/07 18:11:09 ache Exp $"
#include <sys/ioctl.h>
#endif
#if HAVE_BSD_TTY
#if HAVE_SELECT
#if HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
@ -92,7 +92,7 @@ const char serial_rcsid[] = "$Id: serial.c,v 1.4 1994/05/07 18:11:09 ache Exp $"
#endif
#if HAVE_TIME_H
#if ! HAVE_SYS_TIME_H || ! HAVE_BSD_TTY || TIME_WITH_SYS_TIME
#if ! HAVE_SYS_TIME_H || ! HAVE_SELECT || TIME_WITH_SYS_TIME
#include <time.h>
#endif
#endif
@ -517,6 +517,9 @@ boolean
fsysdep_stdin_init (qconn)
struct sconnection *qconn;
{
/* chmod /dev/tty to prevent other users from writing messages to
it. This is essentially `mesg n'. */
(void) chmod ("/dev/tty", S_IRUSR | S_IWUSR);
return fsserial_init (qconn, &sstdincmds, (const char *) NULL);
}
@ -647,7 +650,7 @@ fsserial_lockfile (flok, qconn)
strerror (errno));
return FALSE;
}
zalc = zbufalc (sizeof "LK.123.123.123");
zalc = zbufalc (sizeof "LK.1234567890.1234567890.1234567890");
sprintf (zalc, "LK.%03d.%03d.%03d", major (s.st_dev),
major (s.st_rdev), minor (s.st_rdev));
z = zalc;
@ -860,7 +863,7 @@ fsserial_unlock (qconn)
}
qsysdep->o = -1;
}
if (! fsserial_lockfile (FALSE, qconn))
fret = FALSE;
@ -1748,7 +1751,7 @@ fsmodem_carrier (qconn, fcarrier)
return FALSE;
#ifdef TIOCNCAR
/* Tell the modem to ignore carrier. */
/* Tell the modem to ignore carrier. */
if (ioctl (q->o, TIOCNCAR, 0) < 0)
{
ulog (LOG_ERROR, "ioctl (TIOCNCAR): %s", strerror (errno));
@ -1782,19 +1785,19 @@ fsmodem_carrier (qconn, fcarrier)
ulog (LOG_ERROR, "Can't set CLOCAL: %s", strerror (errno));
return FALSE;
}
#if HAVE_CLOCAL_BUG
/* On SCO and AT&T UNIX PC you have to reopen the port. */
{
int onew;
onew = open (q->zdevice, O_RDWR);
if (onew < 0)
{
ulog (LOG_ERROR, "open (%s): %s", q->zdevice, strerror (errno));
return FALSE;
}
if (fcntl (onew, F_SETFD,
fcntl (onew, F_GETFD, 0) | FD_CLOEXEC) < 0)
{
@ -1817,8 +1820,9 @@ fsmodem_carrier (qconn, fcarrier)
/* Tell the port to use hardware flow control. There is no standard
mechanism for controlling this. This implementation supports
CRTSCTS on SunOS, RTS/CTSFLOW on 386(ish) unix, CTSCD on the 3b1,
and TXADDCD/TXDELCD on AIX. If you know how to do it on other
systems, please implement it and send me the patches. */
CCTS_OFLOW/CRTS_IFLOW on BSDI, TXADDCD/TXDELCD on AIX, and IRTS on
NCR Tower. If you know how to do it on other systems, please
implement it and send me the patches. */
static boolean
fsserial_hardflow (qconn, fhardflow)
@ -1841,12 +1845,16 @@ fsserial_hardflow (qconn, fhardflow)
#ifndef CRTSFL
#ifndef CRTSCTS
#ifndef CTSCD
#ifndef CCTS_OFLOW
#ifndef IRTS
#define HAVE_HARDFLOW 0
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#ifndef HAVE_HARDFLOW
#define HAVE_HARDFLOW 1
@ -1871,6 +1879,12 @@ fsserial_hardflow (qconn, fhardflow)
#ifdef CTSCD
q->snew.c_cflag |= CTSCD;
#endif /* defined (CTSCD) */
#ifdef CCTS_OFLOW
q->snew.c_cflag |= CCTS_OFLOW | CRTS_IFLOW;
#endif
#ifdef IRTS
q->snew.c_iflag |= IRTS;
#endif
#endif /* HAVE_SYSV_TERMIO || HAVE_POSIX_TERMIOS */
if (! fsetterminfo (q->o, &q->snew))
{
@ -1898,6 +1912,12 @@ fsserial_hardflow (qconn, fhardflow)
#ifdef CTSCD
q->snew.c_cflag &=~ CTSCD;
#endif /* defined (CTSCD) */
#ifdef CCTS_OFLOW
q->snew.c_cflag &=~ (CCTS_OFLOW | CRTS_IFLOW);
#endif
#ifdef IRTS
q->snew.c_iflag &=~ IRTS;
#endif
#endif /* HAVE_SYSV_TERMIO || HAVE_POSIX_TERMIOS */
if (! fsetterminfo (q->o, &q->snew))
{
@ -2001,7 +2021,7 @@ fsysdep_modem_end_dial (qconn, qdial)
errors. */
{
int onew;
onew = open (q->zdevice, O_RDWR);
if (onew >= 0)
{
@ -2039,7 +2059,7 @@ fsysdep_modem_end_dial (qconn, qdial)
#endif /* ! defined (TIOCWONLINE) */
}
return TRUE;
return TRUE;
}
/* Read data from a connection, with a timeout. This routine handles
@ -2562,7 +2582,10 @@ fsysdep_conn_io (qconn, zwrite, pcwrite, zread, pcread)
write up to SINGLE_WRITE bytes
if all data written, return
if no data written
blocked write of up to SINGLE_WRITE bytes
if select works
select on the write descriptor with a ten second timeout
else
blocked write of one byte with a ten second alarm
This algorithm should work whether the system supports
unblocked writes on terminals or not. If the system supports
@ -2572,7 +2595,28 @@ fsysdep_conn_io (qconn, zwrite, pcwrite, zread, pcread)
then the write may hang so long that incoming data is lost.
This is actually possible at high baud rates on any system
when a blocking write is done; there is no solution, except
hardware handshaking. */
hardware handshaking.
If we were not able to write any data, then we need to block
until we can write something. The code used to simply do a
blocking write. However, that fails when a bidirectional
protocol is permitted to push out enough bytes to fill the
entire pipe between the two communicating uucico processes.
They can both block on writing, because neither is reading.
In this case, we use select. We could select on both the
read and write descriptor, but on some systems that would
lead to calling read on each byte, which would be very
inefficient. Instead, we select only on the write
descriptor. After the select succeeds or times out, we retry
the read.
Of course, some systems don't have select, and on some
systems that have it it doesn't work on terminal devices. If
we can't use select, then we do a blocked write of a single
byte after setting an alarm. We only write a single byte to
avoid any confusion as to whether or not the byte was
actually written. */
/* If we are running on standard input, we switch the file
descriptors by hand. */
@ -2717,38 +2761,105 @@ fsysdep_conn_io (qconn, zwrite, pcwrite, zread, pcread)
}
else
{
/* We didn't write any data. Do a blocking write. */
#if HAVE_SELECT
struct timeval stime;
int imask;
int c;
if (q->ord >= 0)
q->o = q->ord;
/* We didn't write any data. Call select. We use a timeout
long enough for 1024 bytes to be sent.
secs/kbyte == (1024 bytes/kbyte * 10 bits/byte) / baud bits/sec
usecs/kbyte == (((1024 bytes/kbyte * 1000000 usecs/sec)
/ baud bits/sec)
* 10 bits/byte)
*/
stime.tv_sec = (long) 10240 / q->ibaud;
stime.tv_usec = ((((long) 1024000000 / q->ibaud) * (long) 10)
% (long) 1000000);
if (! fsblock (q, TRUE))
imask = 1 << q->o;
if (imask == 0)
ulog (LOG_FATAL, "fsysdep_conn_io: File descriptors too large");
/* If we've received a signal, don't continue. */
if (FGOT_QUIT_SIGNAL ())
return FALSE;
cdo = cwrite;
if (cdo > SINGLE_WRITE)
cdo = SINGLE_WRITE;
DEBUG_MESSAGE0 (DEBUG_PORT, "fsysdep_conn_io: Calling select");
DEBUG_MESSAGE1 (DEBUG_PORT,
"fsysdep_conn_io: Blocking write of %lu",
(unsigned long) cdo);
if (q->owr >= 0)
q->o = q->owr;
/* Loop until we get something besides EINTR. */
while (TRUE)
/* We don't bother to loop on EINTR. If we get a signal, we
just loop around and try the read and write again. */
c = select (q->o + 1, (pointer) NULL, (pointer) &imask,
(pointer) NULL, &stime);
if (c < 0 && errno == EINTR)
{
/* We got interrupted by a signal. Log it. */
ulog (LOG_ERROR, (const char *) NULL);
}
else if (c >= 0)
{
/* The select either discovered that we could write
something, or it timed out. Either way, we go around
the main read/write loop again. */
}
else
#endif /* HAVE_SELECT */
{
int ierr;
/* Either the select failed for some reason other than
EINTR, or the system does not support select at all.
Fall back on a timed write. We don't worry about why
the select might have failed, we just assume that it
will not succeed on this descriptor. */
#if HAVE_RESTARTABLE_SYSCALLS
/* If HAVE_RESTARTABLE_SYSCALLS, then receiving an alarm
signal in the middle of a write will not cause the
write to return EINTR, and the only way to interrupt
the write is to longjmp out of it (see sysh.unx).
That is unreliable, because it means that we won't
know whether the byte was actually written or not.
However, I believe that the only system on which we
need to do this longjmp is BSD 4.2, and that system
supports select, so we should never execute this
case. */
ulog (LOG_FATAL, "fsysdep_conn_io: Unsupported case; see code");
#endif
if (q->ord >= 0)
q->o = q->ord;
if (! fsblock (q, TRUE))
return FALSE;
DEBUG_MESSAGE0 (DEBUG_PORT, "fsysdep_conn_io: Blocking write");
if (q->owr >= 0)
q->o = q->owr;
/* If we've received a signal, don't continue. */
if (FGOT_QUIT_SIGNAL ())
return FALSE;
/* Start up an alarm to interrupt the write. Note that
we don't need to use the catch stuff, since we know
that HAVE_RESTARTABLE_SYSCALLS is 0. */
usset_signal (SIGALRM, usalarm, TRUE, (boolean *) NULL);
alarm ((int) ((long) 10240 / q->ibaud) + 1);
/* There is a race condition here: on a severely loaded
system, we could get the alarm before we start the
write call. This would not be a disaster; often the
write will succeed anyhow. */
#if HAVE_TLI
if (q->ftli)
{
cdid = t_snd (q->o, (char *) zwrite, cdo, 0);
cdid = t_snd (q->o, (char *) zwrite, 1, 0);
if (cdid < 0 && t_errno != TSYSERR)
{
usset_signal (SIGALRM, SIG_IGN, TRUE, (boolean *) NULL);
alarm (0);
ulog (LOG_ERROR, "t_snd: %s",
(t_errno >= 0 && t_errno < t_nerr
? t_errlist[t_errno]
@ -2758,44 +2869,54 @@ fsysdep_conn_io (qconn, zwrite, pcwrite, zread, pcread)
}
else
#endif
cdid = write (q->o, zwrite, cdo);
cdid = write (q->o, zwrite, 1);
if (cdid >= 0)
break;
if (errno != EINTR)
break;
ierr = errno;
/* We got interrupted by a signal. Log it. */
ulog (LOG_ERROR, (const char *) NULL);
}
/* Note that we don't really care whether the write
finished because the byte was written out or whether
it finished because the alarm was triggered. Either
way, we are going to loop around and try another
read. */
if (cdid < 0)
{
ulog (LOG_ERROR, "write: %s", strerror (errno));
return FALSE;
}
usset_signal (SIGALRM, SIG_IGN, TRUE, (boolean *) NULL);
alarm (0);
if (cdid == 0)
{
/* On some systems write will return 0 if carrier is
lost. If we fail to write anything ten times in a
row, we assume that this has happened. This is
hacked in like this because there seems to be no
reliable way to tell exactly why the write returned
0. */
++czero;
if (czero >= 10)
if (cdid < 0)
{
ulog (LOG_ERROR, "Line disconnected");
return FALSE;
if (ierr == EINTR)
{
/* We got interrupted by a signal. Log it. */
ulog (LOG_ERROR, (const char *) NULL);
}
else
{
ulog (LOG_ERROR, "write: %s", strerror (ierr));
return FALSE;
}
}
else if (cdid == 0)
{
/* On some systems write will return 0 if carrier is
lost. If we fail to write anything ten times in
a row, we assume that this has happened. This is
hacked in like this because there seems to be no
reliable way to tell exactly why the write
returned 0. */
++czero;
if (czero >= 10)
{
ulog (LOG_ERROR, "Line disconnected");
return FALSE;
}
}
else
{
cwrite -= cdid;
zwrite += cdid;
*pcwrite += cdid;
czero = 0;
}
}
else
{
cwrite -= cdid;
zwrite += cdid;
*pcwrite += cdid;
czero = 0;
}
}
}
@ -2937,7 +3058,7 @@ fsserial_set (qconn, tparity, tstrip, txonxoff)
/* Not supported. */
break;
}
if (fdo)
{
if ((q->snew.c_cflag & iset) != iset
@ -2973,7 +3094,7 @@ fsserial_set (qconn, tparity, tstrip, txonxoff)
}
#endif
#else /* ! HAVE_BSD_TTY */
#else /* ! HAVE_BSD_TTY */
fdo = FALSE;
switch (tstrip)

View File

@ -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.
*/
#include "uucp.h"

View File

@ -1,7 +1,7 @@
/* spawn.c
Spawn a program securely.
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 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.
*/
#include "uucp.h"
@ -147,7 +147,7 @@ ixsspawn (pazargs, aidescs, fkeepuid, fkeepenv, zchdir, fnosigs, fshell,
zspace = azenv[0] + sizeof "PATH=" - 1;
while ((zspace = strchr (zspace, ' ')) != NULL)
*zspace = ':';
azenv[1] = zbufalc (sizeof "HOME=" + strlen (zSspooldir));
sprintf (azenv[1], "HOME=%s", zSspooldir);
@ -158,7 +158,7 @@ ixsspawn (pazargs, aidescs, fkeepuid, fkeepenv, zchdir, fnosigs, fshell,
sprintf (azenv[2], "TERM=%s", zterm);
azenv[3] = zbufcpy ("SHELL=/bin/sh");
azenv[4] = zbufalc (sizeof "USER=" + strlen (OWNER));
sprintf (azenv[4], "USER=%s", OWNER);
@ -275,7 +275,7 @@ ixsspawn (pazargs, aidescs, fkeepuid, fkeepenv, zchdir, fnosigs, fshell,
ierr = errno;
ferr = TRUE;
break;
}
}
}
}
@ -360,12 +360,22 @@ ixsspawn (pazargs, aidescs, fkeepuid, fkeepenv, zchdir, fnosigs, fshell,
{
/* Try to force the UUCP uid to be both real and effective user
ID, in order to present a consistent environment regardless
of the invoking user. This won't work on System V based
systems, but it will do no harm. It would be possible to use
a setuid root program to force the UID setting, but I don't
think the efficiency loss is worth it. */
of the invoking user. This won't work on older System V
based systems, where it can cause trouble if ordinary users
wind up executing uuxqt, perhaps via uucico; any program
which uuxqt executes will have an arbitrary real user ID, so
if the program is itself a setuid program, any security
checks it does based on the real user ID will be incorrect.
Fixing this problem would seem to require a special setuid
root program; I have not used this approach because
modern systems should not suffer from it. */
#if HAVE_SETREUID
(void) setreuid (geteuid (), -1);
(void) setregid (getegid (), -1);
#else
(void) setuid (geteuid ());
(void) setgid (getegid ());
#endif
}
if (zchdir != NULL)
@ -406,7 +416,7 @@ ixsspawn (pazargs, aidescs, fkeepuid, fkeepenv, zchdir, fnosigs, fshell,
{
char *zto;
const char *azshargs[4];
pazargs[0] = zcmd;
zto = zshcmd;
for (i = 0; pazargs[i] != NULL; i++)

View File

@ -1,7 +1,7 @@
/* splcmd.c
Spool a command.
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.
*/
#include "uucp.h"
@ -104,6 +104,14 @@ zsysdep_spool_commands (qsys, bgrade, ccmds, pascmds)
}
}
if (! fstdiosync (e, ztemp))
{
(void) fclose (e);
(void) remove (ztemp);
ubuffree (ztemp);
return NULL;
}
if (fclose (e) != 0)
{
ulog (LOG_ERROR, "fclose: %s", strerror (errno));
@ -112,23 +120,37 @@ zsysdep_spool_commands (qsys, bgrade, ccmds, pascmds)
return NULL;
}
z = zscmd_file (qsys, bgrade);
if (z == NULL)
/* The filename returned by zscmd_file is subject to some unlikely
race conditions, so keep trying the link until the destination
file does not already exist. Each call to zscmd_file should
return a file name which does not already exist, so we don't have
to do anything special before calling it again. */
while (TRUE)
{
(void) remove (ztemp);
ubuffree (ztemp);
return NULL;
}
z = zscmd_file (qsys, bgrade);
if (z == NULL)
{
(void) remove (ztemp);
ubuffree (ztemp);
return NULL;
}
if (link (ztemp, z) >= 0)
break;
if (errno != EEXIST)
{
ulog (LOG_ERROR, "link (%s, %s): %s", ztemp, z, strerror (errno));
(void) remove (ztemp);
ubuffree (ztemp);
ubuffree (z);
return NULL;
}
if (! fsysdep_move_file (ztemp, z, FALSE, FALSE, FALSE,
(const char *) NULL))
{
(void) remove (ztemp);
ubuffree (ztemp);
ubuffree (z);
return NULL;
}
(void) remove (ztemp);
ubuffree (ztemp);
zjobid = zsfile_to_jobid (qsys, z, bgrade);

View File

@ -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 spool_rcsid[] = "$Id: spool.c,v 1.2 1994/05/07 18:11:24 ache Exp $";
const char spool_rcsid[] = "$Id: spool.c,v 1.11 1995/06/30 21:22:54 ian Rel $";
#endif
#include "uudefs.h"
@ -41,7 +41,7 @@ const char spool_rcsid[] = "$Id: spool.c,v 1.2 1994/05/07 18:11:24 ache Exp $";
Command files
These contain instructions for uucico indicating what files to transfer
to and from what systems. Each line of a work file is a command
beginning with S, R or X.
beginning with S, R, X, or E.
#if ! SPOOLDIR_TAYLOR
They are named C.ssssssgqqqq, where ssssss is the system name to
transfer to or from, g is the grade and qqqq is the sequence number.
@ -55,15 +55,17 @@ const char spool_rcsid[] = "$Id: spool.c,v 1.2 1994/05/07 18:11:24 ache Exp $";
#elif SPOOLDIR_ULTRIX
If the directory sys/ssssss exists, they are put in the directory
sys/ssssss/C; otherwise, they are put in the directory sys/DEFAULT/C.
#endif
#elif SPOOLDIR_SVR4
They are put in the directory sys/g, where sys is the system name
and g is the grade.
#endif
#else SPOOLDIR_TAYLOR
They are named C.gqqqq, where g is the grade and qqqq is the sequence
number, and are placed in the directory ssssss/C. where ssssss is
the system name to transfer to or from.
They are named C.gqqqq, where g is the grade and qqqq is the
sequence number, and are placed in the directory ssssss/C. where
ssssss is the system name to transfer to or from. The sequence
number for a C. file is actually a long string; it is not based on
the sequence number file, but is generated via a process which
attempts to produce a unique string each time it is run.
#endif
Data files
@ -287,7 +289,7 @@ zsfind_file (zsimple, zsystem, bgrade)
{
size_t c;
boolean ftruncated;
/* D.LOCAL in D.LOCAL/, others in D./. If BSD43, D.LOCALX in
D.LOCALX/. */
ftruncated = TRUE;
@ -336,7 +338,7 @@ zsfind_file (zsimple, zsystem, bgrade)
char *zfree;
const char *zdir;
char *zret;
/* D.LOCALX in D.LOCALX/, D.LOCAL in D.LOCAL/, others in D./. */
ftruncated = TRUE;
if (strncmp (zsimple + 2, zSlocalname, strlen (zSlocalname)) == 0)
@ -380,7 +382,7 @@ zsfind_file (zsimple, zsystem, bgrade)
zfree = NULL;
zdir = "D.";
}
zret = zsappend4 ("sys",
(fsultrix_has_spool (zsystem)
? zsystem

View File

@ -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.
*/
#include "uucp.h"
@ -69,7 +69,7 @@ fsysdep_rmdir (zdir)
while (q != NULL)
{
struct sdirlist *qnext;
if (rmdir (q->zdir) != 0)
{
ulog (LOG_ERROR, "rmdir (%s): %s", q->zdir, strerror (errno));

View File

@ -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 statsb_rcsid[] = "$Id: statsb.c,v 1.17 1994/04/10 22:06:10 ian Rel $";
const char statsb_rcsid[] = "$Id: statsb.c,v 1.19 1995/06/21 19:20:39 ian Rel $";
#endif
#include "uudefs.h"

View File

@ -1,7 +1,7 @@
/* status.c
Routines to get and set the status for a system.
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.
*/
#include "uucp.h"
@ -31,6 +31,7 @@
#include "system.h"
#include <errno.h>
#include <ctype.h>
#if SPOOLDIR_HDB || SPOOLDIR_SVR4
@ -104,6 +105,7 @@ fsysdep_get_status (qsys, qret, pfnone)
qret->cretries = 0;
qret->ilast = 0;
qret->cwait = 0;
qret->zstring = NULL;
if (pfnone != NULL)
*pfnone = TRUE;
ubuffree (zname);
@ -157,6 +159,33 @@ fsysdep_get_status (qsys, qret, pfnone)
if (zend == znext)
fbad = TRUE;
if (! fbad)
{
znext = zend;
while (isspace (BUCHAR (*znext)))
++znext;
if (*znext == '\0')
qret->zstring = NULL;
else
{
if (*znext == '"')
++znext;
qret->zstring = zbufcpy (znext);
zend = qret->zstring + strlen (qret->zstring);
while (zend != qret->zstring && *zend != ' ')
--zend;
if (*zend == '"' && zend != qret->zstring)
--zend;
if (zend != qret->zstring)
*zend = '\0';
else
{
ubuffree (qret->zstring);
qret->zstring = NULL;
}
}
}
xfree ((pointer) zline);
if (fbad)
@ -199,9 +228,16 @@ fsysdep_set_status (qsys, qset)
istat = aiMapstatus[istat];
#endif /* MAP_STATUS */
fprintf (e, "%d %d %ld %d %s %s\n", istat, qset->cretries,
qset->ilast, qset->cwait, azStatus[(int) qset->ttype],
qsys->uuconf_zname);
fprintf (e, "%d %d %ld %d ", istat, qset->cretries, qset->ilast,
qset->cwait);
#if SPOOLDIR_SVR4
fprintf (e, "\"%s\"", azStatus[(int) qset->ttype]);
#else
fprintf (e, "%s", azStatus[(int) qset->ttype]);
#endif
fprintf (e, " %s\n", qsys->uuconf_zname);
if (fclose (e) != 0)
{
ulog (LOG_ERROR, "fclose: %s", strerror (errno));

View File

@ -0,0 +1,42 @@
/* sync.c
Sync a file to disk, if FSYNC_ON_CLOSE is set. */
#include "uucp.h"
#include "uudefs.h"
#include "sysdep.h"
#include "system.h"
#include <errno.h>
boolean
fsysdep_sync (e, zmsg)
openfile_t e;
const char *zmsg;
{
int o;
#if USE_STDIO
if (fflush (e) == EOF)
{
ulog (LOG_ERROR, "%s: fflush: %s", zmsg, strerror (errno));
return FALSE;
}
#endif
#if USE_STDIO
o = fileno (e);
#else
o = e;
#endif
#if FSYNC_ON_CLOSE
if (fsync (o) < 0)
{
ulog (LOG_ERROR, "%s: fsync: %s", zmsg, strerror (errno));
return FALSE;
}
#endif
return TRUE;
}

View File

@ -0,0 +1,444 @@
/* tcp.c
Code to handle TCP connections.
Copyright (C) 1991, 1992, 1993, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, 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, 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, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
const char tcp_rcsid[] = "$Id: tcp.c,v 1.5 1995/06/21 19:20:46 ian Rel $";
#endif
#if HAVE_TCP
#include "uudefs.h"
#include "uuconf.h"
#include "sysdep.h"
#include "conn.h"
#include "system.h"
#include <errno.h>
#if HAVE_SYS_TYPES_TCP_H
#include <sys/types.tcp.h>
#endif
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#if HAVE_FCNTL_H
#include <fcntl.h>
#else
#if HAVE_SYS_FILE_H
#include <sys/file.h>
#endif
#endif
#ifndef FD_CLOEXEC
#define FD_CLOEXEC 1
#endif
/* This code handles TCP connections. It assumes a Berkeley socket
interface. */
/* The normal "uucp" port number. */
#define IUUCP_PORT (540)
/* Local functions. */
static void utcp_free P((struct sconnection *qconn));
static boolean ftcp_open P((struct sconnection *qconn, long ibaud,
boolean fwait));
static boolean ftcp_close P((struct sconnection *qconn,
pointer puuconf,
struct uuconf_dialer *qdialer,
boolean fsuccess));
static boolean ftcp_dial P((struct sconnection *qconn, pointer puuconf,
const struct uuconf_system *qsys,
const char *zphone,
struct uuconf_dialer *qdialer,
enum tdialerfound *ptdialer));
static int itcp_port_number P((const char *zport));
/* The command table for a TCP connection. */
static const struct sconncmds stcpcmds =
{
utcp_free,
NULL, /* pflock */
NULL, /* pfunlock */
ftcp_open,
ftcp_close,
ftcp_dial,
fsysdep_conn_read,
fsysdep_conn_write,
fsysdep_conn_io,
NULL, /* pfbreak */
NULL, /* pfset */
NULL, /* pfcarrier */
fsysdep_conn_chat,
NULL /* pibaud */
};
/* Initialize a TCP connection. */
boolean
fsysdep_tcp_init (qconn)
struct sconnection *qconn;
{
struct ssysdep_conn *q;
q = (struct ssysdep_conn *) xmalloc (sizeof (struct ssysdep_conn));
q->o = -1;
q->ord = -1;
q->owr = -1;
q->zdevice = NULL;
q->iflags = -1;
q->iwr_flags = -1;
q->fterminal = FALSE;
q->ftli = FALSE;
q->ibaud = 0;
qconn->psysdep = (pointer) q;
qconn->qcmds = &stcpcmds;
return TRUE;
}
/* Free a TCP connection. */
static void
utcp_free (qconn)
struct sconnection *qconn;
{
xfree (qconn->psysdep);
}
/* Open a TCP connection. If the fwait argument is TRUE, we are
running as a server. Otherwise we are just trying to reach another
system. */
static boolean
ftcp_open (qconn, ibaud, fwait)
struct sconnection *qconn;
long ibaud;
boolean fwait;
{
struct ssysdep_conn *qsysdep;
struct sockaddr_in s;
const char *zport;
uid_t ieuid;
boolean fswap;
ulog_device ("TCP");
qsysdep = (struct ssysdep_conn *) qconn->psysdep;
qsysdep->o = socket (AF_INET, SOCK_STREAM, 0);
if (qsysdep->o < 0)
{
ulog (LOG_ERROR, "socket: %s", strerror (errno));
return FALSE;
}
if (fcntl (qsysdep->o, F_SETFD,
fcntl (qsysdep->o, F_GETFD, 0) | FD_CLOEXEC) < 0)
{
ulog (LOG_ERROR, "fcntl (FD_CLOEXEC): %s", strerror (errno));
(void) close (qsysdep->o);
qsysdep->o = -1;
return FALSE;
}
qsysdep->iflags = fcntl (qsysdep->o, F_GETFL, 0);
if (qsysdep->iflags < 0)
{
ulog (LOG_ERROR, "fcntl: %s", strerror (errno));
(void) close (qsysdep->o);
qsysdep->o = -1;
return FALSE;
}
/* We save our process ID in the qconn structure. This is checked
in ftcp_close. */
qsysdep->ipid = getpid ();
/* If we aren't waiting for a connection, we're done. */
if (! fwait)
return TRUE;
/* Run as a server and wait for a new connection. The code in
uucico.c has already detached us from our controlling terminal.
From this point on if the server gets an error we exit; we only
return if we have received a connection. It would be more robust
to respawn the server if it fails; someday. */
bzero ((pointer) &s, sizeof s);
s.sin_family = AF_INET;
zport = qconn->qport->uuconf_u.uuconf_stcp.uuconf_zport;
s.sin_port = itcp_port_number (zport);
s.sin_addr.s_addr = htonl (INADDR_ANY);
/* Swap to our real user ID when doing the bind call. This will
permit the server to use privileged TCP ports when invoked by
root. We only swap if our effective user ID is not root, so that
the program can also be made suid root in order to get privileged
ports when invoked by anybody. */
fswap = geteuid () != 0;
if (fswap)
{
if (! fsuser_perms (&ieuid))
{
(void) close (qsysdep->o);
qsysdep->o = -1;
return FALSE;
}
}
if (bind (qsysdep->o, (struct sockaddr *) &s, sizeof s) < 0)
{
if (fswap)
(void) fsuucp_perms ((long) ieuid);
ulog (LOG_FATAL, "bind: %s", strerror (errno));
}
/* Now swap back to the uucp user ID. */
if (fswap)
{
if (! fsuucp_perms ((long) ieuid))
ulog (LOG_FATAL, "Could not swap back to UUCP user permissions");
}
if (listen (qsysdep->o, 5) < 0)
ulog (LOG_FATAL, "listen: %s", strerror (errno));
while (! FGOT_SIGNAL ())
{
size_t clen;
int onew;
pid_t ipid;
DEBUG_MESSAGE0 (DEBUG_PORT,
"ftcp_open: Waiting for connections");
clen = sizeof s;
onew = accept (qsysdep->o, (struct sockaddr *) &s, &clen);
if (onew < 0)
ulog (LOG_FATAL, "accept: %s", strerror (errno));
DEBUG_MESSAGE0 (DEBUG_PORT,
"ftcp_open: Got connection; forking");
ipid = ixsfork ();
if (ipid < 0)
ulog (LOG_FATAL, "fork: %s", strerror (errno));
if (ipid == 0)
{
(void) close (qsysdep->o);
qsysdep->o = onew;
/* Now we fork and let our parent die, so that we become
a child of init. This lets the main server code wait
for its child and then continue without accumulating
zombie children. */
ipid = ixsfork ();
if (ipid < 0)
{
ulog (LOG_ERROR, "fork: %s", strerror (errno));
_exit (EXIT_FAILURE);
}
if (ipid != 0)
_exit (EXIT_SUCCESS);
ulog_id (getpid ());
return TRUE;
}
(void) close (onew);
/* Now wait for the child. */
(void) ixswait ((unsigned long) ipid, (const char *) NULL);
}
/* We got a signal. */
usysdep_exit (FALSE);
/* Avoid compiler warnings. */
return FALSE;
}
/* Close the port. */
/*ARGSUSED*/
static boolean
ftcp_close (qconn, puuconf, qdialer, fsuccess)
struct sconnection *qconn;
pointer puuconf;
struct uuconf_dialer *qdialer;
boolean fsuccess;
{
struct ssysdep_conn *qsysdep;
boolean fret;
qsysdep = (struct ssysdep_conn *) qconn->psysdep;
fret = TRUE;
if (qsysdep->o >= 0 && close (qsysdep->o) < 0)
{
ulog (LOG_ERROR, "close: %s", strerror (errno));
fret = FALSE;
}
qsysdep->o = -1;
/* If the current pid is not the one we used to open the port, then
we must have forked up above and we are now the child. In this
case, we are being called from within the fendless loop in
uucico.c. We return FALSE to force the loop to end and the child
to exit. This should be handled in a cleaner fashion. */
if (qsysdep->ipid != getpid ())
fret = FALSE;
return fret;
}
/* Dial out on a TCP port, so to speak: connect to a remote computer. */
/*ARGSUSED*/
static boolean
ftcp_dial (qconn, puuconf, qsys, zphone, qdialer, ptdialer)
struct sconnection *qconn;
pointer puuconf;
const struct uuconf_system *qsys;
const char *zphone;
struct uuconf_dialer *qdialer;
enum tdialerfound *ptdialer;
{
struct ssysdep_conn *qsysdep;
const char *zhost;
struct hostent *q;
struct sockaddr_in s;
const char *zport;
char **pzdialer;
qsysdep = (struct ssysdep_conn *) qconn->psysdep;
*ptdialer = DIALERFOUND_FALSE;
zhost = zphone;
if (zhost == NULL)
{
if (qsys == NULL)
{
ulog (LOG_ERROR, "No address for TCP connection");
return FALSE;
}
zhost = qsys->uuconf_zname;
}
errno = 0;
q = gethostbyname ((char *) zhost);
if (q != NULL)
{
s.sin_family = q->h_addrtype;
memcpy (&s.sin_addr.s_addr, q->h_addr, (size_t) q->h_length);
}
else
{
if (errno != 0)
{
ulog (LOG_ERROR, "gethostbyname (%s): %s", zhost, strerror (errno));
return FALSE;
}
s.sin_family = AF_INET;
s.sin_addr.s_addr = inet_addr ((char *) zhost);
if ((long) s.sin_addr.s_addr == (long) -1)
{
ulog (LOG_ERROR, "%s: unknown host name", zhost);
return FALSE;
}
}
zport = qconn->qport->uuconf_u.uuconf_stcp.uuconf_zport;
s.sin_port = itcp_port_number (zport);
if (connect (qsysdep->o, (struct sockaddr *) &s, sizeof s) < 0)
{
ulog (LOG_ERROR, "connect: %s", strerror (errno));
return FALSE;
}
/* Handle the dialer sequence, if any. */
pzdialer = qconn->qport->uuconf_u.uuconf_stcp.uuconf_pzdialer;
if (pzdialer != NULL && *pzdialer != NULL)
{
if (! fconn_dial_sequence (qconn, puuconf, pzdialer, qsys, zphone,
qdialer, ptdialer))
return FALSE;
}
return TRUE;
}
/* Get the port number given a name. The argument will almost always
be "uucp" so we cache that value. The return value is always in
network byte order. This returns -1 on error. */
static int
itcp_port_number (zname)
const char *zname;
{
boolean fuucp;
static int iuucp;
int i;
char *zend;
struct servent *q;
fuucp = strcmp (zname, "uucp") == 0;
if (fuucp && iuucp != 0)
return iuucp;
/* Try it as a number first. */
i = strtol ((char *) zname, &zend, 10);
if (i != 0 && *zend == '\0')
return htons (i);
q = getservbyname ((char *) zname, (char *) "tcp");
if (q == NULL)
{
/* We know that the "uucp" service should be 540, even if isn't
in /etc/services. */
if (fuucp)
{
iuucp = htons (IUUCP_PORT);
return iuucp;
}
ulog (LOG_ERROR, "getservbyname (%s): %s", zname, strerror (errno));
return -1;
}
if (fuucp)
iuucp = q->s_port;
return q->s_port;
}
#endif /* HAVE_TCP */

View File

@ -0,0 +1,628 @@
/* tli.c
Code to handle TLI connections.
Copyright (C) 1992, 1993, 1994 Ian Lance Taylor
This file is part of the Taylor UUCP package.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, 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, 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, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#if USE_RCS_ID
const char tli_rcsid[] = "$Id: tli.c,v 1.4 1995/06/21 19:20:50 ian Rel $";
#endif
#if HAVE_TLI
#include "sysdep.h"
#include "uudefs.h"
#include "uuconf.h"
#include "conn.h"
#include "system.h"
#include <errno.h>
#if HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
#if HAVE_TIUSER_H
#include <tiuser.h>
#else
#if HAVE_XTI_H
#include <xti.h>
#else
#if HAVE_SYS_TLI_H
#include <sys/tli.h>
#endif
#endif
#endif
#if HAVE_STROPTS_H
#include <stropts.h>
#endif
#if HAVE_FCNTL_H
#include <fcntl.h>
#else
#if HAVE_SYS_FILE_H
#include <sys/file.h>
#endif
#endif
#ifndef O_RDONLY
#define O_RDONLY 0
#define O_WRONLY 1
#define O_RDWR 2
#endif
#ifndef FD_CLOEXEC
#define FD_CLOEXEC 1
#endif
/* The arguments to t_alloca have two different names. I want the
SVID ones, not the XPG3 ones. */
#ifndef T_BIND
#define T_BIND T_BIND_STR
#endif
#ifndef T_CALL
#define T_CALL T_CALL_STR
#endif
/* Hopefully these externs will not cause any trouble. This is how
they are shown in the SVID. */
extern int t_errno;
extern char *t_errlist[];
extern int t_nerr;
#ifndef HAVE_TIUSER_H
#ifndef t_alloc
extern pointer t_alloc ();
#endif
#endif
/* This code handles TLI connections. It's Unix specific. It's
largely based on code from Unix Network Programming, by W. Richard
Stevens. */
/* Local functions. */
static const char *ztlierror P((void));
static void utli_free P((struct sconnection *qconn));
static boolean ftli_push P((struct sconnection *qconn));
static boolean ftli_open P((struct sconnection *qconn, long ibaud,
boolean fwait));
static boolean ftli_close P((struct sconnection *qconn,
pointer puuconf,
struct uuconf_dialer *qdialer,
boolean fsuccess));
static boolean ftli_dial P((struct sconnection *qconn, pointer puuconf,
const struct uuconf_system *qsys,
const char *zphone,
struct uuconf_dialer *qdialer,
enum tdialerfound *ptdialer));
/* The command table for a TLI connection. */
static const struct sconncmds stlicmds =
{
utli_free,
NULL, /* pflock */
NULL, /* pfunlock */
ftli_open,
ftli_close,
ftli_dial,
fsysdep_conn_read,
fsysdep_conn_write,
fsysdep_conn_io,
NULL, /* pfbreak */
NULL, /* pfset */
NULL, /* pfcarrier */
fsysdep_conn_chat,
NULL /* pibaud */
};
/* Get a TLI error string. */
static const char *
ztlierror ()
{
if (t_errno == TSYSERR)
return strerror (errno);
if (t_errno < 0 || t_errno >= t_nerr)
return "Unknown TLI error";
return t_errlist[t_errno];
}
/* Initialize a TLI connection. This may be called with qconn->qport
NULL, when opening standard input as a TLI connection. */
boolean
fsysdep_tli_init (qconn)
struct sconnection *qconn;
{
struct ssysdep_conn *q;
q = (struct ssysdep_conn *) xmalloc (sizeof (struct ssysdep_conn));
q->o = -1;
q->ord = -1;
q->owr = -1;
q->zdevice = NULL;
q->iflags = -1;
q->iwr_flags = -1;
q->fterminal = FALSE;
q->ftli = TRUE;
q->ibaud = 0;
qconn->psysdep = (pointer) q;
qconn->qcmds = &stlicmds;
return TRUE;
}
/* Free a TLI connection. */
static void
utli_free (qconn)
struct sconnection *qconn;
{
xfree (qconn->psysdep);
}
/* Push all desired modules onto a TLI stream. If the user requests a
STREAMS connection without giving a list of modules, we just push
tirdwr. If the I_PUSH ioctl is not defined on this system, we just
ignore any list of modules. */
static boolean
ftli_push (qconn)
struct sconnection *qconn;
{
#ifdef I_PUSH
struct ssysdep_conn *qsysdep;
qsysdep = (struct ssysdep_conn *) qconn->psysdep;
if (qconn->qport->uuconf_u.uuconf_stli.uuconf_pzpush != NULL)
{
char **pz;
for (pz = qconn->qport->uuconf_u.uuconf_stli.uuconf_pzpush;
*pz != NULL;
pz++)
{
if (ioctl (qsysdep->o, I_PUSH, *pz) < 0)
{
ulog (LOG_ERROR, "ioctl (I_PUSH, %s): %s", *pz,
strerror (errno));
return FALSE;
}
}
}
else if (qconn->qport->uuconf_u.uuconf_stli.uuconf_fstream)
{
if (ioctl (qsysdep->o, I_PUSH, "tirdwr") < 0)
{
ulog (LOG_ERROR, "ioctl (I_PUSH, tirdwr): %s",
strerror (errno));
return FALSE;
}
}
/* If we have just put the connection into stream mode, we must turn
off the TLI flag to avoid using TLI calls on it. */
if (qconn->qport->uuconf_u.uuconf_stli.uuconf_fstream)
qsysdep->ftli = FALSE;
#endif /* defined (I_PUSH) */
return TRUE;
}
/* Open a TLI connection. If the fwait argument is TRUE, we are
running as a server. Otherwise we are just trying to reach another
system. */
static boolean
ftli_open (qconn, ibaud, fwait)
struct sconnection *qconn;
long ibaud;
boolean fwait;
{
struct ssysdep_conn *qsysdep;
const char *zdevice;
char *zfreedev;
const char *zservaddr;
char *zfreeaddr;
uid_t ieuid;
boolean fswap;
struct t_bind *qtbind;
struct t_call *qtcall;
/* Unlike most other device types, we don't bother to call
ulog_device here, because fconn_open calls it with the name of
the port anyhow. */
qsysdep = (struct ssysdep_conn *) qconn->psysdep;
zdevice = qconn->qport->uuconf_u.uuconf_stli.uuconf_zdevice;
if (zdevice == NULL)
zdevice = qconn->qport->uuconf_zname;
zfreedev = NULL;
if (*zdevice != '/')
{
zfreedev = zbufalc (sizeof "/dev/" + strlen (zdevice));
sprintf (zfreedev, "/dev/%s", zdevice);
zdevice = zfreedev;
}
/* If we are acting as a server, swap to our real user ID before
calling t_open. This will permit the server to use privileged
TCP ports when invoked by root. We only swap if our effective
user ID is not root, so that the program can also be made suid
root in order to get privileged ports when invoked by anybody. */
fswap = fwait && geteuid () != 0;
if (fswap)
{
if (! fsuser_perms (&ieuid))
{
ubuffree (zfreedev);
return FALSE;
}
}
qsysdep->o = t_open (zdevice, O_RDWR, (struct t_info *) NULL);
if (qsysdep->o < 0)
{
if (fswap)
(void) fsuucp_perms ((long) ieuid);
ulog (LOG_ERROR, "t_open (%s): %s", zdevice, ztlierror ());
ubuffree (zfreedev);
return FALSE;
}
if (fcntl (qsysdep->o, F_SETFD,
fcntl (qsysdep->o, F_GETFD, 0) | FD_CLOEXEC) < 0)
{
if (fswap)
(void) fsuucp_perms ((long) ieuid);
ulog (LOG_ERROR, "fcntl (FD_CLOEXEC): %s", strerror (errno));
ubuffree (zfreedev);
(void) t_close (qsysdep->o);
qsysdep->o = -1;
return FALSE;
}
qsysdep->iflags = fcntl (qsysdep->o, F_GETFL, 0);
if (qsysdep->iflags < 0)
{
if (fswap)
(void) fsuucp_perms ((long) ieuid);
ulog (LOG_ERROR, "fcntl: %s", strerror (errno));
ubuffree (zfreedev);
(void) t_close (qsysdep->o);
qsysdep->o = -1;
return FALSE;
}
/* We save our process ID in the qconn structure. This is checked
in ftli_close. */
qsysdep->ipid = getpid ();
/* If we aren't waiting for a connection, we can bind to any local
address, and then we're finished. */
if (! fwait)
{
/* fswap is known to be FALSE here. */
ubuffree (zfreedev);
if (t_bind (qsysdep->o, (struct t_bind *) NULL,
(struct t_bind *) NULL) < 0)
{
ulog (LOG_ERROR, "t_bind: %s", ztlierror ());
(void) t_close (qsysdep->o);
qsysdep->o = -1;
return FALSE;
}
return TRUE;
}
/* Run as a server and wait for a new connection. The code in
uucico.c has already detached us from our controlling terminal.
From this point on if the server gets an error we exit; we only
return if we have received a connection. It would be more robust
to respawn the server if it fails; someday. */
qtbind = (struct t_bind *) t_alloc (qsysdep->o, T_BIND, T_ALL);
if (qtbind == NULL)
{
if (fswap)
(void) fsuucp_perms ((long) ieuid);
ulog (LOG_FATAL, "t_alloc (T_BIND): %s", ztlierror ());
}
zservaddr = qconn->qport->uuconf_u.uuconf_stli.uuconf_zservaddr;
if (zservaddr == NULL)
{
if (fswap)
(void) fsuucp_perms ((long) ieuid);
ulog (LOG_FATAL, "Can't run as TLI server; no server address");
}
zfreeaddr = zbufcpy (zservaddr);
qtbind->addr.len = cescape (zfreeaddr);
if (qtbind->addr.len > qtbind->addr.maxlen)
{
if (fswap)
(void) fsuucp_perms ((long) ieuid);
ulog (LOG_FATAL, "%s: TLI server address too long (max %d)",
zservaddr, qtbind->addr.maxlen);
}
memcpy (qtbind->addr.buf, zfreeaddr, qtbind->addr.len);
ubuffree (zfreeaddr);
qtbind->qlen = 5;
if (t_bind (qsysdep->o, qtbind, (struct t_bind *) NULL) < 0)
{
if (fswap)
(void) fsuucp_perms ((long) ieuid);
ulog (LOG_FATAL, "t_bind (%s): %s", zservaddr, ztlierror ());
}
if (fswap)
{
if (! fsuucp_perms ((long) ieuid))
ulog (LOG_FATAL, "Could not swap back to UUCP user permissions");
}
(void) t_free ((pointer) qtbind, T_BIND);
qtcall = (struct t_call *) t_alloc (qsysdep->o, T_CALL, T_ALL);
if (qtcall == NULL)
ulog (LOG_FATAL, "t_alloc (T_CALL): %s", ztlierror ());
while (! FGOT_SIGNAL ())
{
int onew;
pid_t ipid;
DEBUG_MESSAGE0 (DEBUG_PORT,
"ftli_open: Waiting for connections");
if (t_listen (qsysdep->o, qtcall) < 0)
ulog (LOG_FATAL, "t_listen: %s", ztlierror ());
onew = t_open (zdevice, O_RDWR, (struct t_info *) NULL);
if (onew < 0)
ulog (LOG_FATAL, "t_open (%s): %s", zdevice, ztlierror ());
if (fcntl (onew, F_SETFD,
fcntl (onew, F_GETFD, 0) | FD_CLOEXEC) < 0)
ulog (LOG_FATAL, "fcntl (FD_CLOEXEC): %s", strerror (errno));
if (t_bind (onew, (struct t_bind *) NULL, (struct t_bind *) NULL) < 0)
ulog (LOG_FATAL, "t_bind: %s", ztlierror ());
if (t_accept (qsysdep->o, onew, qtcall) < 0)
{
/* We may have received a disconnect. */
if (t_errno != TLOOK)
ulog (LOG_FATAL, "t_accept: %s", ztlierror ());
if (t_rcvdis (qsysdep->o, (struct t_discon *) NULL) < 0)
ulog (LOG_FATAL, "t_rcvdis: %s", ztlierror ());
(void) t_close (onew);
continue;
}
DEBUG_MESSAGE0 (DEBUG_PORT,
"ftli_open: Got connection; forking");
ipid = ixsfork ();
if (ipid < 0)
ulog (LOG_FATAL, "fork: %s", strerror (errno));
if (ipid == 0)
{
ulog_close ();
(void) t_close (qsysdep->o);
qsysdep->o = onew;
/* Push any desired modules. */
if (! ftli_push (qconn))
_exit (EXIT_FAILURE);
/* Now we fork and let our parent die, so that we become
a child of init. This lets the main server code wait
for its child and then continue without accumulating
zombie children. */
ipid = ixsfork ();
if (ipid < 0)
{
ulog (LOG_ERROR, "fork: %s", strerror (errno));
_exit (EXIT_FAILURE);
}
if (ipid != 0)
_exit (EXIT_SUCCESS);
ulog_id (getpid ());
return TRUE;
}
(void) t_close (onew);
/* Now wait for the child. */
(void) ixswait ((unsigned long) ipid, (const char *) NULL);
}
/* We got a signal. */
usysdep_exit (FALSE);
/* Avoid compiler warnings. */
return FALSE;
}
/* Close the port. */
/*ARGSUSED*/
static boolean
ftli_close (qconn, puuconf, qdialer, fsuccess)
struct sconnection *qconn;
pointer puuconf;
struct uuconf_dialer *qdialer;
boolean fsuccess;
{
struct ssysdep_conn *qsysdep;
boolean fret;
qsysdep = (struct ssysdep_conn *) qconn->psysdep;
fret = TRUE;
if (qsysdep->o >= 0)
{
if (qsysdep->ftli)
{
if (t_close (qsysdep->o) < 0)
{
ulog (LOG_ERROR, "t_close: %s", ztlierror ());
fret = FALSE;
}
}
else
{
if (close (qsysdep->o) < 0)
{
ulog (LOG_ERROR, "close: %s", strerror (errno));
fret = FALSE;
}
}
qsysdep->o = -1;
}
/* If the current pid is not the one we used to open the port, then
we must have forked up above and we are now the child. In this
case, we are being called from within the fendless loop in
uucico.c. We return FALSE to force the loop to end and the child
to exit. This should be handled in a cleaner fashion. */
if (qsysdep->ipid != getpid ())
fret = FALSE;
return fret;
}
/* Dial out on a TLI port, so to speak: connect to a remote computer. */
/*ARGSUSED*/
static boolean
ftli_dial (qconn, puuconf, qsys, zphone, qdialer, ptdialerfound)
struct sconnection *qconn;
pointer puuconf;
const struct uuconf_system *qsys;
const char *zphone;
struct uuconf_dialer *qdialer;
enum tdialerfound *ptdialerfound;
{
struct ssysdep_conn *qsysdep;
char **pzdialer;
const char *zaddr;
struct t_call *qtcall;
char *zescape;
qsysdep = (struct ssysdep_conn *) qconn->psysdep;
*ptdialerfound = DIALERFOUND_FALSE;
pzdialer = qconn->qport->uuconf_u.uuconf_stli.uuconf_pzdialer;
if (*pzdialer == NULL)
pzdialer = NULL;
/* If the first dialer is "TLI" or "TLIS", we use the first token
(pzdialer[1]) as the address to connect to. */
zaddr = zphone;
if (pzdialer != NULL
&& (strcmp (pzdialer[0], "TLI") == 0
|| strcmp (pzdialer[0], "TLIS") == 0))
{
if (pzdialer[1] == NULL)
++pzdialer;
else
{
if (strcmp (pzdialer[1], "\\D") != 0
&& strcmp (pzdialer[1], "\\T") != 0)
zaddr = pzdialer[1];
pzdialer += 2;
}
}
if (zaddr == NULL)
{
ulog (LOG_ERROR, "No address for TLI connection");
return FALSE;
}
qtcall = (struct t_call *) t_alloc (qsysdep->o, T_CALL, T_ADDR);
if (qtcall == NULL)
{
ulog (LOG_ERROR, "t_alloc (T_CALL): %s", ztlierror ());
return FALSE;
}
zescape = zbufcpy (zaddr);
qtcall->addr.len = cescape (zescape);
if (qtcall->addr.len > qtcall->addr.maxlen)
{
ulog (LOG_ERROR, "%s: TLI address too long (max %d)", zaddr,
qtcall->addr.maxlen);
ubuffree (zescape);
return FALSE;
}
memcpy (qtcall->addr.buf, zescape, qtcall->addr.len);
ubuffree (zescape);
if (t_connect (qsysdep->o, qtcall, (struct t_call *) NULL) < 0)
{
if (t_errno != TLOOK)
ulog (LOG_ERROR, "t_connect: %s", ztlierror ());
else
{
if (t_rcvdis (qsysdep->o, (struct t_discon *) NULL) < 0)
ulog (LOG_ERROR, "t_rcvdis: %s", ztlierror ());
else
ulog (LOG_ERROR, "Connection refused");
}
return FALSE;
}
/* We've connected to the remote. Push any desired modules. */
if (! ftli_push (qconn))
return FALSE;
/* Handle the rest of the dialer sequence. */
if (pzdialer != NULL && *pzdialer != NULL)
{
if (! fconn_dial_sequence (qconn, puuconf, pzdialer, qsys, zphone,
qdialer, ptdialerfound))
return FALSE;
}
return TRUE;
}
#endif /* HAVE_TLI */

View File

@ -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.
*/
#include "uucp.h"

View File

@ -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.
*/
#include "uucp.h"

View File

@ -1,7 +1,7 @@
/* ufopen.c
Open a file with the permissions of the invoking user.
Copyright (C) 1992 Ian Lance Taylor
Copyright (C) 1992, 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.
*/
#include "uucp.h"
@ -53,89 +53,6 @@
#define FD_CLOEXEC 1
#endif
/* Local functions. */
static boolean fsuser_perms P((uid_t *pieuid));
static boolean fsuucp_perms P((long ieuid));
/* Switch to permissions of the invoking user. */
static boolean
fsuser_perms (pieuid)
uid_t *pieuid;
{
uid_t ieuid, iuid;
ieuid = geteuid ();
iuid = getuid ();
if (pieuid != NULL)
*pieuid = ieuid;
#if HAVE_SETREUID
/* Swap the effective user id and the real user id. We can then
swap them back again when we want to return to the uucp user's
permissions. */
if (setreuid (ieuid, iuid) < 0)
{
ulog (LOG_ERROR, "setreuid (%ld, %ld): %s",
(long) ieuid, (long) iuid, strerror (errno));
return FALSE;
}
#else /* ! HAVE_SETREUID */
#if HAVE_SAVED_SETUID
/* Set the effective user id to the real user id. Since the
effective user id is saved (it's the saved setuid) we will able
to set back to it later. If the real user id is root we will not
be able to switch back and forth, so don't even try. */
if (iuid != 0)
{
if (setuid (iuid) < 0)
{
ulog (LOG_ERROR, "setuid (%ld): %s", (long) iuid, strerror (errno));
return FALSE;
}
}
#else /* ! HAVE_SAVED_SETUID */
/* There's no way to switch between real permissions and effective
permissions. Just try to open the file with the uucp
permissions. */
#endif /* ! HAVE_SAVED_SETUID */
#endif /* ! HAVE_SETREUID */
return TRUE;
}
/* Restore the uucp permissions. */
/*ARGSUSED*/
static boolean
fsuucp_perms (ieuid)
long ieuid;
{
#if HAVE_SETREUID
/* Swap effective and real user id's back to what they were. */
if (! fsuser_perms ((uid_t *) NULL))
return FALSE;
#else /* ! HAVE_SETREUID */
#if HAVE_SAVED_SETUID
/* Set ourselves back to our original effective user id. */
if (setuid ((uid_t) ieuid) < 0)
{
ulog (LOG_ERROR, "setuid (%ld): %s", (long) ieuid, strerror (errno));
/* Is this error message helpful or confusing? */
if (errno == EPERM)
ulog (LOG_ERROR,
"Probably HAVE_SAVED_SETUID in policy.h should be set to 0");
return FALSE;
}
#else /* ! HAVE_SAVED_SETUID */
/* We didn't switch, no need to switch back. */
#endif /* ! HAVE_SAVED_SETUID */
#endif /* ! HAVE_SETREUID */
return TRUE;
}
/* Open a file with the permissions of the invoking user. Ignore the
fbinary argument since Unix has no distinction between text and
binary files. */

View File

@ -0,0 +1,109 @@
/* uid.c
Switch back and forth between UUCP and user permissions.
Copyright (C) 1992, 1995 Ian Lance Taylor
This file is part of the Taylor UUCP package.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, 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, 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, 48 Grove Street, Somerville, MA 02144.
*/
#include "uucp.h"
#include "uudefs.h"
#include "sysdep.h"
#include <errno.h>
/* Switch to permissions of the invoking user. */
boolean
fsuser_perms (pieuid)
uid_t *pieuid;
{
uid_t ieuid, iuid;
ieuid = geteuid ();
iuid = getuid ();
if (pieuid != NULL)
*pieuid = ieuid;
#if HAVE_SETREUID
/* Swap the effective user id and the real user id. We can then
swap them back again when we want to return to the uucp user's
permissions. */
if (setreuid (ieuid, iuid) < 0)
{
ulog (LOG_ERROR, "setreuid (%ld, %ld): %s",
(long) ieuid, (long) iuid, strerror (errno));
return FALSE;
}
#else /* ! HAVE_SETREUID */
#if HAVE_SAVED_SETUID
/* Set the effective user id to the real user id. Since the
effective user id is saved (it's the saved setuid) we will able
to set back to it later. If the real user id is root we will not
be able to switch back and forth, so don't even try. */
if (iuid != 0)
{
if (setuid (iuid) < 0)
{
ulog (LOG_ERROR, "setuid (%ld): %s", (long) iuid, strerror (errno));
return FALSE;
}
}
#else /* ! HAVE_SAVED_SETUID */
/* There's no way to switch between real permissions and effective
permissions. Just try to open the file with the uucp
permissions. */
#endif /* ! HAVE_SAVED_SETUID */
#endif /* ! HAVE_SETREUID */
return TRUE;
}
/* Restore the uucp permissions. */
/*ARGSUSED*/
boolean
fsuucp_perms (ieuid)
long ieuid;
{
#if HAVE_SETREUID
/* Swap effective and real user id's back to what they were. */
if (! fsuser_perms ((uid_t *) NULL))
return FALSE;
#else /* ! HAVE_SETREUID */
#if HAVE_SAVED_SETUID
/* Set ourselves back to our original effective user id. */
if (setuid ((uid_t) ieuid) < 0)
{
ulog (LOG_ERROR, "setuid (%ld): %s", (long) ieuid, strerror (errno));
/* Is this error message helpful or confusing? */
if (errno == EPERM)
ulog (LOG_ERROR,
"Probably HAVE_SAVED_SETUID in policy.h should be set to 0");
return FALSE;
}
#else /* ! HAVE_SAVED_SETUID */
/* We didn't switch, no need to switch back. */
#endif /* ! HAVE_SAVED_SETUID */
#endif /* ! HAVE_SETREUID */
return TRUE;
}

View File

@ -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.
*/
#include "uucp.h"
@ -167,7 +167,7 @@ zsysdep_wildcard (zfile)
zret = zbufcpy (sSglob.gl_pathv[iSglob]);
++iSglob;
return zret;
#else /* ! HAVE_GLOB */
char *zret;

View File

@ -1,7 +1,7 @@
/* work.c
Routines to read command files.
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 work_rcsid[] = "$Id: work.c,v 1.2 1994/05/07 18:11:41 ache Exp $";
const char work_rcsid[] = "$Id: work.c,v 1.20 1995/06/30 21:35:14 ian Rel $";
#endif
#include "uudefs.h"
@ -189,7 +189,7 @@ fswork_file (zsystem, zfile, pbgrade)
*pbgrade = zfile[2];
return (zfile[0] == 'C'
&& zfile[1] == '.'
&& strlen (zfile) == 7);
&& zfile[2] != '\0');
#endif /* SPOOLDIR_TAYLOR */
}
@ -426,13 +426,12 @@ fsysdep_get_work_init (qsys, bgrade)
/* Get the next work entry for a system. This must parse the next
line in the next work file. The type of command is set into
qcmd->bcmd; if there are no more commands we call
fsysdep_get_work_init to rescan, in case any came in since the last
call. If there are still no commands, qcmd->bcmd is set to 'H'.
qcmd->bcmd If there are no more commands, qcmd->bcmd is set to 'H'.
Each field in the structure is set to point to a spot in an
malloced string. The only time we use the grade here is when
calling fsysdep_get_work_init to rescan. */
malloced string. The grade argument is never used; it has been
used by fsysdep_get_work_init. */
/*ARGSUSED*/
boolean
fsysdep_get_work (qsys, bgrade, qcmd)
const struct uuconf_system *qsys;
@ -471,18 +470,9 @@ fsysdep_get_work (qsys, bgrade, qcmd)
{
if (iSwork_file >= cSwork_files)
{
/* Rescan the work directory. */
if (! fsysdep_get_work_init (qsys, bgrade))
{
ubuffree (zdir);
return FALSE;
}
if (iSwork_file >= cSwork_files)
{
qcmd->bcmd = 'H';
ubuffree (zdir);
return TRUE;
}
qcmd->bcmd = 'H';
ubuffree (zdir);
return TRUE;
}
if (zdir == NULL)
@ -506,7 +496,7 @@ fsysdep_get_work (qsys, bgrade, qcmd)
}
}
while (e == NULL);
qfile = (struct ssfile *) xmalloc (sizeof (struct ssfile));
callocated = CFILELINES;
iline = 0;
@ -561,7 +551,7 @@ fsysdep_get_work (qsys, bgrade, qcmd)
while (TRUE)
{
int iline;
if (qSwork_file->cdid >= qSwork_file->clines)
{
/* We don't want to free qSwork_file here, since it must
@ -628,7 +618,7 @@ fsysdep_did_work (pseq)
struct ssfile *qfile;
struct ssline *qline;
int i;
qline = (struct ssline *) pseq;
ubuffree (qline->zline);
@ -745,7 +735,7 @@ zsysdep_save_temp_file (pseq)
ubuffree (zto);
return "Could not move file to preservation directory";
}
cwant = sizeof "File saved as\n\t/" + strlen (zSspooldir) + strlen (zto);
if (cwant > cbuf)
{
@ -787,10 +777,14 @@ bsgrade (pseq)
zfile = ((struct ssline *) pseq)->qfile->zfile;
#if SPOOLDIR_TAYLOR
bgrade = *(strrchr (zfile, '/') + 3);
#else
#if ! SPOOLDIR_SVR4
bgrade = zfile[strlen (zfile) - CSEQLEN - 1];
#else
bgrade = *(strchr (zfile, '/') + 1);
#endif
#endif
return bgrade;

View File

@ -1,7 +1,7 @@
/* xqtfil.c
Routines to read execute files.
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 xqtfil_rcsid[] = "$Id: xqtfil.c,v 1.2 1994/05/07 18:11:42 ache Exp $";
const char xqtfil_rcsid[] = "$Id: xqtfil.c,v 1.10 1995/07/19 04:18:37 ian Rel $";
#endif
#include "uudefs.h"
@ -78,6 +78,7 @@ static DIR *qSxqt_topdir;
#if ! SUBDIRS
static const char *zSdir;
#else /* SUBDIRS */
static boolean fSone_dir;
static char *zSdir;
static DIR *qSxqt_dir;
static char *zSsystem;
@ -89,9 +90,36 @@ static char *zSsystem;
/*ARGSUSED*/
boolean
fsysdep_get_xqt_init ()
fsysdep_get_xqt_init (zsystem)
const char *zsystem;
{
usysdep_get_xqt_free ();
usysdep_get_xqt_free ((const char *) NULL);
#if SUBDIRS
if (zsystem != NULL)
{
#if SPOOLDIR_HDB || SPOOLDIR_SVR4
zSdir = zbufcpy (zsystem);
#endif
#if SPOOLDIR_ULTRIX
zSdir = zsappend3 ("sys", zsystem, "X.");
#endif
#if SPOOLDIR_TAYLOR
zSdir = zsysdep_in_dir (zsystem, "X.");
#endif
qSxqt_dir = opendir ((char *) zSdir);
if (qSxqt_dir != NULL)
{
qSxqt_topdir = qSxqt_dir;
fSone_dir = TRUE;
zSsystem = zbufcpy (zsystem);
return TRUE;
}
}
fSone_dir = FALSE;
#endif
qSxqt_topdir = opendir ((char *) ZDIR);
if (qSxqt_topdir == NULL)
@ -111,8 +139,10 @@ fsysdep_get_xqt_init ()
*pzsystem will be set to the system for which the execute file was
created. */
/*ARGSUSED*/
char *
zsysdep_get_xqt (pzsystem, pferr)
zsysdep_get_xqt (zsystem, pzsystem, pferr)
const char *zsystem;
char **pzsystem;
boolean *pferr;
{
@ -220,20 +250,22 @@ zsysdep_get_xqt (pzsystem, pferr)
#endif
return zret;
}
/* If we've reached the end of the directory, then if we are
using subdirectories loop around to read the next one,
otherwise we are finished. */
if (q == NULL)
{
(void) closedir (qdir);
#if SUBDIRS
qSxqt_dir = NULL;
continue;
#else
if (! fSone_dir)
continue;
#endif
qSxqt_topdir = NULL;
return NULL;
#endif
}
}
}
@ -243,7 +275,8 @@ zsysdep_get_xqt (pzsystem, pferr)
/*ARGSUSED*/
void
usysdep_get_xqt_free ()
usysdep_get_xqt_free (zsystem)
const char *zsystem;
{
if (qSxqt_topdir != NULL)
{
@ -260,5 +293,6 @@ usysdep_get_xqt_free ()
zSdir = NULL;
ubuffree (zSsystem);
zSsystem = NULL;
fSone_dir = FALSE;
#endif
}

View File

@ -1,7 +1,7 @@
/* xqtsub.c
System dependent functions used only by uuxqt.
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 xqtsub_rcsid[] = "$Id: xqtsub.c,v 1.2 1994/05/07 18:11:43 ache Exp $";
const char xqtsub_rcsid[] = "$Id: xqtsub.c,v 1.18 1995/06/21 20:21:14 ian Rel $";
#endif
#include "uudefs.h"
@ -263,9 +263,9 @@ fsysdep_execute (qsys, zuser, pazargs, zfullcmd, zinput, zoutput,
{
ulog (LOG_ERROR, "fcntl (FD_CLOEXEC): %s", strerror (errno));
ferr = TRUE;
}
}
}
if (! ferr && zoutput != NULL)
{
aidescs[1] = creat ((char *) zoutput, IPRIVATE_FILE_MODE);
@ -280,7 +280,7 @@ fsysdep_execute (qsys, zuser, pazargs, zfullcmd, zinput, zoutput,
{
ulog (LOG_ERROR, "fcntl (FD_CLOEXEC): %s", strerror (errno));
ferr = TRUE;
}
}
}
if (! ferr)
@ -312,7 +312,7 @@ fsysdep_execute (qsys, zuser, pazargs, zfullcmd, zinput, zoutput,
{
ulog (LOG_ERROR, "fcntl (FD_CLOEXEC): %s", strerror (errno));
ferr = TRUE;
}
}
}
if (iseq == 0)
@ -545,7 +545,8 @@ fsysdep_lock_uuxqt_dir (iseq)
}
if (mkdir (zxqtdir, S_IRWXU) < 0
&& errno != EEXIST)
&& errno != EEXIST
&& errno != EISDIR)
{
ulog (LOG_ERROR, "mkdir (%s): %s", zxqtdir, strerror (errno));
return FALSE;
@ -658,7 +659,7 @@ fsysdep_move_uuxqt_files (cfiles, pzfrom, pzto, fto, iseq, pzinput)
if (! fto)
{
const char *ztemp;
ztemp = zfrom;
zfrom = zto;
zto = ztemp;
@ -682,7 +683,7 @@ fsysdep_move_uuxqt_files (cfiles, pzfrom, pzto, fto, iseq, pzinput)
break;
}
if (! fcopy_file (zfrom, zto, FALSE, FALSE))
if (! fcopy_file (zfrom, zto, FALSE, FALSE, FALSE))
{
ubuffree (zfree);
break;

View File

@ -67,6 +67,7 @@ snams.c
split.c
spool.c
stafil.c
strip.c
syssub.c
tcalou.c
tdial.c

View File

@ -1,5 +1,5 @@
# This is the Makefile for the Taylor UUCP uuconf library
# $Id: Makefile,v 1.1 1993/08/05 18:24:52 conklin Exp $
# $Id: Makefile,v 1.2 1994/05/07 18:11:49 ache Exp $
LIB= uuconf
SRCS = addblk.c addstr.c allblk.c alloc.c base.c bool.c callin.c \
@ -10,10 +10,11 @@ SRCS = addblk.c addstr.c allblk.c alloc.c base.c bool.c callin.c \
hsys.c hunk.c iniglb.c init.c int.c lckdir.c lineno.c llocnm.c \
local.c locnm.c logfil.c maxuxq.c mrgblk.c paramc.c port.c \
prtsub.c pubdir.c rdlocs.c rdperm.c reliab.c remunk.c runuxq.c \
sinfo.c snams.c split.c spool.c stafil.c syssub.c tcalou.c \
tdial.c tdialc.c tdnams.c tgcmp.c thread.c time.c tinit.c \
tlocnm.c tport.c tportc.c tsinfo.c tsnams.c tsys.c tval.c \
ugtlin.c unk.c val.c vinit.c vport.c vsinfo.c vsnams.c vsys.c
sinfo.c snams.c split.c spool.c stafil.c strip.c syssub.c \
tcalou.c tdial.c tdialc.c tdnams.c tgcmp.c thread.c time.c \
tinit.c tlocnm.c tport.c tportc.c tsinfo.c tsnams.c tsys.c \
tval.c ugtlin.c unk.c val.c vinit.c vport.c vsinfo.c vsnams.c \
vsys.c
CFLAGS+= -I$(.CURDIR)/../common_sources \
-DNEWCONFIGLIB=\"$(newconfigdir)\"\
-DOLDCONFIGLIB=\"$(oldconfigdir)\"

View File

@ -1,8 +1,8 @@
This is the README file for the beta release of the uuconf library.
It was written by Ian Lance Taylor. I can be reached at ian@airs.com,
or, equivalently, uunet!cygint!airs!ian, or c/o Cygnus Support, 4th
Floor, Building 200, 1 Kendall Square, Cambridge MA, 02139, USA.
or, equivalently, uunet!cygint!airs!ian, or c/o Cygnus Support,
48 Grove Street, Somerville, MA, 02144, USA.
This package is covered by the Gnu Library General Public License.
See the file COPYING.LIB for details. If you would like to do

View File

@ -17,16 +17,16 @@
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 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 "uucnfi.h"
#if USE_RCS_ID
const char _uuconf_addblk_rcsid[] = "$Id: addblk.c,v 1.3 1994/01/30 21:14:29 ian Rel $";
const char _uuconf_addblk_rcsid[] = "$Id: addblk.c,v 1.5 1995/06/21 19:21:23 ian Rel $";
#endif
#include "alloc.h"

View File

@ -17,16 +17,16 @@
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 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 "uucnfi.h"
#if USE_RCS_ID
const char _uuconf_addstr_rcsid[] = "$Id: addstr.c,v 1.5 1994/01/30 21:14:29 ian Rel $";
const char _uuconf_addstr_rcsid[] = "$Id: addstr.c,v 1.7 1995/06/21 19:21:26 ian Rel $";
#endif
#include <errno.h>

View File

@ -17,16 +17,16 @@
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 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 "uucnfi.h"
#if USE_RCS_ID
const char _uuconf_allblk_rcsid[] = "$Id: allblk.c,v 1.3 1994/01/30 21:14:29 ian Rel $";
const char _uuconf_allblk_rcsid[] = "$Id: allblk.c,v 1.5 1995/06/21 19:21:28 ian Rel $";
#endif
#include "alloc.h"

View File

@ -17,16 +17,16 @@
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 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 "uucnfi.h"
#if USE_RCS_ID
const char _uuconf_alloc_rcsid[] = "$Id: alloc.c,v 1.3 1994/01/30 21:14:29 ian Rel $";
const char _uuconf_alloc_rcsid[] = "$Id: alloc.c,v 1.5 1995/06/21 19:21:31 ian Rel $";
#endif
#include "alloc.h"

View File

@ -17,10 +17,10 @@
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 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 is private to the uuconf memory allocation

View File

@ -17,16 +17,16 @@
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 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 "uucnfi.h"
#if USE_RCS_ID
const char _uuconf_base_rcsid[] = "$Id: base.c,v 1.3 1994/01/30 21:14:29 ian Rel $";
const char _uuconf_base_rcsid[] = "$Id: base.c,v 1.5 1995/06/21 19:21:36 ian Rel $";
#endif
/* This turns a cmdtab_offset table into a uuconf_cmdtab table. Each

View File

@ -17,16 +17,16 @@
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 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 "uucnfi.h"
#if USE_RCS_ID
const char _uuconf_bool_rcsid[] = "$Id: bool.c,v 1.2 1994/05/07 18:11:58 ache Exp $";
const char _uuconf_bool_rcsid[] = "$Id: bool.c,v 1.5 1995/06/21 19:21:39 ian Rel $";
#endif
/* Parse a boolean string into a variable. This is called by
@ -61,4 +61,4 @@ _uuconf_iboolean (qglobal, zval, pi)
}
return UUCONF_CMDTABRET_CONTINUE;
}
}

Some files were not shown because too many files have changed in this diff Show More