1*7c478bd9Sstevel@tonic-gate /* 2*7c478bd9Sstevel@tonic-gate * CDDL HEADER START 3*7c478bd9Sstevel@tonic-gate * 4*7c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*7c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*7c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*7c478bd9Sstevel@tonic-gate * with the License. 8*7c478bd9Sstevel@tonic-gate * 9*7c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*7c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*7c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 12*7c478bd9Sstevel@tonic-gate * and limitations under the License. 13*7c478bd9Sstevel@tonic-gate * 14*7c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*7c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*7c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*7c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*7c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*7c478bd9Sstevel@tonic-gate * 20*7c478bd9Sstevel@tonic-gate * CDDL HEADER END 21*7c478bd9Sstevel@tonic-gate */ 22*7c478bd9Sstevel@tonic-gate /* 23*7c478bd9Sstevel@tonic-gate * Copyright 1997 Sun Microsystems, Inc. All rights reserved. 24*7c478bd9Sstevel@tonic-gate * Use is subject to license terms. 25*7c478bd9Sstevel@tonic-gate */ 26*7c478bd9Sstevel@tonic-gate 27*7c478bd9Sstevel@tonic-gate /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 28*7c478bd9Sstevel@tonic-gate /* All Rights Reserved */ 29*7c478bd9Sstevel@tonic-gate 30*7c478bd9Sstevel@tonic-gate 31*7c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 32*7c478bd9Sstevel@tonic-gate 33*7c478bd9Sstevel@tonic-gate #include "uucp.h" 34*7c478bd9Sstevel@tonic-gate 35*7c478bd9Sstevel@tonic-gate /* Configurable parameters */ 36*7c478bd9Sstevel@tonic-gate 37*7c478bd9Sstevel@tonic-gate GLOBAL char _ProtoCfg[40]=""; /* protocol string from Config file */ 38*7c478bd9Sstevel@tonic-gate 39*7c478bd9Sstevel@tonic-gate /* Non-configurable parameters */ 40*7c478bd9Sstevel@tonic-gate 41*7c478bd9Sstevel@tonic-gate GLOBAL int Ifn, Ofn; 42*7c478bd9Sstevel@tonic-gate GLOBAL int Sgrades = FALSE; 43*7c478bd9Sstevel@tonic-gate GLOBAL int Debug = 0; 44*7c478bd9Sstevel@tonic-gate GLOBAL int SizeCheck = 0; /* Ulimit checking supported flag */ 45*7c478bd9Sstevel@tonic-gate GLOBAL long RemUlimit = 0; /* Ulimit of remote if supported */ 46*7c478bd9Sstevel@tonic-gate GLOBAL int Restart = 0; /* checkpoint restart supported flag */ 47*7c478bd9Sstevel@tonic-gate GLOBAL uid_t Uid, Euid; /* user-id and effective-uid */ 48*7c478bd9Sstevel@tonic-gate GLOBAL long Ulimit; 49*7c478bd9Sstevel@tonic-gate GLOBAL mode_t Dev_mode; /* save device mode here */ 50*7c478bd9Sstevel@tonic-gate GLOBAL char Progname[NAMESIZE]; 51*7c478bd9Sstevel@tonic-gate GLOBAL char Pchar; 52*7c478bd9Sstevel@tonic-gate GLOBAL char Grade = 'Z'; 53*7c478bd9Sstevel@tonic-gate GLOBAL char Rmtname[MAXFULLNAME]; 54*7c478bd9Sstevel@tonic-gate GLOBAL char JobGrade[MAXBASENAME+1] = { NULLCHAR }; 55*7c478bd9Sstevel@tonic-gate GLOBAL char RemSpool[MAXFULLNAME]; /* spool subdirectory for remote system */ 56*7c478bd9Sstevel@tonic-gate GLOBAL char User[MAXFULLNAME]; 57*7c478bd9Sstevel@tonic-gate GLOBAL char Uucp[NAMESIZE]; 58*7c478bd9Sstevel@tonic-gate GLOBAL char Loginuser[NAMESIZE]; 59*7c478bd9Sstevel@tonic-gate GLOBAL char Myname[MAXBASENAME+1]; 60*7c478bd9Sstevel@tonic-gate GLOBAL char Wrkdir[MAXFULLNAME]; 61*7c478bd9Sstevel@tonic-gate GLOBAL char Logfile[MAXFULLNAME]; 62*7c478bd9Sstevel@tonic-gate GLOBAL char *Spool = SPOOL; 63*7c478bd9Sstevel@tonic-gate GLOBAL char *Pubdir = PUBDIR; 64*7c478bd9Sstevel@tonic-gate GLOBAL char **Env; 65*7c478bd9Sstevel@tonic-gate GLOBAL char *Shchar = ";&|<>^`\\()'\"{}\t\n "; 66*7c478bd9Sstevel@tonic-gate 67*7c478bd9Sstevel@tonic-gate 68*7c478bd9Sstevel@tonic-gate GLOBAL long Retrytime = 0; /* default is to use exponential backoff */ 69*7c478bd9Sstevel@tonic-gate GLOBAL struct nstat Nstat; 70*7c478bd9Sstevel@tonic-gate GLOBAL char Dc[50]; /* line name */ 71*7c478bd9Sstevel@tonic-gate GLOBAL int Seqn; /* sequence # */ 72*7c478bd9Sstevel@tonic-gate GLOBAL int Role; 73*7c478bd9Sstevel@tonic-gate GLOBAL char *Bnptr; /* used when BASENAME macro is expanded */ 74*7c478bd9Sstevel@tonic-gate GLOBAL char Jobid[NAMESIZE] = ""; /* Jobid of current C. file */ 75*7c478bd9Sstevel@tonic-gate GLOBAL int Uerror; /* global error code */ 76*7c478bd9Sstevel@tonic-gate 77*7c478bd9Sstevel@tonic-gate GLOBAL void (*genbrk)(); 78*7c478bd9Sstevel@tonic-gate 79*7c478bd9Sstevel@tonic-gate GLOBAL int Verbose = 0; /* only for cu and ct to change */ 80*7c478bd9Sstevel@tonic-gate 81*7c478bd9Sstevel@tonic-gate /* used for READANY and READSOME macros */ 82*7c478bd9Sstevel@tonic-gate GLOBAL struct stat __s_; 83*7c478bd9Sstevel@tonic-gate 84*7c478bd9Sstevel@tonic-gate /* messages */ 85*7c478bd9Sstevel@tonic-gate GLOBAL char *Ct_OPEN = "CAN'T OPEN"; 86*7c478bd9Sstevel@tonic-gate GLOBAL char *Ct_WRITE = "CAN'T WRITE"; 87*7c478bd9Sstevel@tonic-gate GLOBAL char *Ct_READ = "CAN'T READ"; 88*7c478bd9Sstevel@tonic-gate GLOBAL char *Ct_CREATE = "CAN'T CREATE"; 89*7c478bd9Sstevel@tonic-gate GLOBAL char *Ct_ALLOCATE = "CAN'T ALLOCATE"; 90*7c478bd9Sstevel@tonic-gate GLOBAL char *Ct_LOCK = "CAN'T LOCK"; 91*7c478bd9Sstevel@tonic-gate GLOBAL char *Ct_STAT = "CAN'T STAT"; 92*7c478bd9Sstevel@tonic-gate GLOBAL char *Ct_CHOWN = "CAN'T CHOWN"; 93*7c478bd9Sstevel@tonic-gate GLOBAL char *Ct_CHMOD = "CAN'T CHMOD"; 94*7c478bd9Sstevel@tonic-gate GLOBAL char *Ct_LINK = "CAN'T LINK"; 95*7c478bd9Sstevel@tonic-gate GLOBAL char *Ct_CHDIR = "CAN'T CHDIR"; 96*7c478bd9Sstevel@tonic-gate GLOBAL char *Ct_UNLINK = "CAN'T UNLINK"; 97*7c478bd9Sstevel@tonic-gate GLOBAL char *Wr_ROLE = "WRONG ROLE"; 98*7c478bd9Sstevel@tonic-gate GLOBAL char *Ct_CORRUPT = "CAN'T MOVE TO CORRUPTDIR"; 99*7c478bd9Sstevel@tonic-gate GLOBAL char *Ct_CLOSE = "CAN'T CLOSE"; 100*7c478bd9Sstevel@tonic-gate GLOBAL char *Ct_FORK = "CAN'T FORK"; 101*7c478bd9Sstevel@tonic-gate GLOBAL char *Fl_EXISTS = "FILE EXISTS"; 102*7c478bd9Sstevel@tonic-gate GLOBAL char *Ct_BADOWN = "BAD OWNER/PERMS"; 103*7c478bd9Sstevel@tonic-gate 104*7c478bd9Sstevel@tonic-gate GLOBAL char *UerrorText[] = { 105*7c478bd9Sstevel@tonic-gate /* SS_OK 0 */ "SUCCESSFUL", 106*7c478bd9Sstevel@tonic-gate /* SS_NO_DEVICE 1 */ "NO DEVICES AVAILABLE", 107*7c478bd9Sstevel@tonic-gate /* SS_TIME_WRONG 2 */ "WRONG TIME TO CALL", 108*7c478bd9Sstevel@tonic-gate /* SS_INPROGRESS 3 */ "TALKING", 109*7c478bd9Sstevel@tonic-gate /* SS_CONVERSATION 4 */ "CONVERSATION FAILED", 110*7c478bd9Sstevel@tonic-gate /* SS_SEQBAD 5 */ "BAD SEQUENCE CHECK", 111*7c478bd9Sstevel@tonic-gate /* SS_LOGIN_FAILED 6 */ "LOGIN FAILED", 112*7c478bd9Sstevel@tonic-gate /* SS_DIAL_FAILED 7 */ "DIAL FAILED", 113*7c478bd9Sstevel@tonic-gate /* SS_BAD_LOG_MCH 8 */ "BAD LOGIN/MACHINE COMBINATION", 114*7c478bd9Sstevel@tonic-gate /* SS_LOCKED_DEVICE 9 */ "DEVICE LOCKED", 115*7c478bd9Sstevel@tonic-gate /* SS_ASSERT_ERROR 10 */ "ASSERT ERROR", 116*7c478bd9Sstevel@tonic-gate /* SS_BADSYSTEM 11 */ "SYSTEM NOT IN Systems FILE", 117*7c478bd9Sstevel@tonic-gate /* SS_CANT_ACCESS_DEVICE 12 */ "CAN'T ACCESS DEVICE", 118*7c478bd9Sstevel@tonic-gate /* SS_DEVICE_FAILED 13 */ "DEVICE FAILED", 119*7c478bd9Sstevel@tonic-gate /* SS_WRONG_MCH 14 */ "WRONG MACHINE NAME", 120*7c478bd9Sstevel@tonic-gate /* SS_CALLBACK 15 */ "CALLBACK REQUIRED", 121*7c478bd9Sstevel@tonic-gate /* SS_RLOCKED 16 */ "REMOTE HAS A LCK FILE FOR ME", 122*7c478bd9Sstevel@tonic-gate /* SS_RUNKNOWN 17 */ "REMOTE DOES NOT KNOW ME", 123*7c478bd9Sstevel@tonic-gate /* SS_RLOGIN 18 */ "REMOTE REJECT AFTER LOGIN", 124*7c478bd9Sstevel@tonic-gate /* SS_UNKNOWN_RESPONSE 19 */ "REMOTE REJECT, UNKNOWN MESSAGE", 125*7c478bd9Sstevel@tonic-gate /* SS_STARTUP 20 */ "STARTUP FAILED", 126*7c478bd9Sstevel@tonic-gate /* SS_CHAT_FAILED 21 */ "CALLER SCRIPT FAILED", 127*7c478bd9Sstevel@tonic-gate /* SS_CALLBACK_LOOP 22 */ "CALLBACK REQUIRED - LOOP", 128*7c478bd9Sstevel@tonic-gate }; 129