122704Sdist /* 234921Sbostic * Copyright (c) 1983 Eric P. Allman 333729Sbostic * Copyright (c) 1988 Regents of the University of California. 433729Sbostic * All rights reserved. 533729Sbostic * 642826Sbostic * %sccs.include.redist.c% 733729Sbostic */ 822704Sdist 922704Sdist #ifndef lint 10*57943Seric static char sccsid[] = "@(#)envelope.c 6.6 (Berkeley) 02/12/93"; 1133729Sbostic #endif /* not lint */ 1222704Sdist 1336928Sbostic #include <sys/types.h> 1436928Sbostic #include <sys/time.h> 1536928Sbostic #include <sys/stat.h> 169536Seric #include <pwd.h> 1757737Seric #include <fcntl.h> 189536Seric #include "sendmail.h" 199536Seric 209536Seric /* 219536Seric ** NEWENVELOPE -- allocate a new envelope 229536Seric ** 239536Seric ** Supports inheritance. 249536Seric ** 259536Seric ** Parameters: 269536Seric ** e -- the new envelope to fill in. 279536Seric ** 289536Seric ** Returns: 299536Seric ** e. 309536Seric ** 319536Seric ** Side Effects: 329536Seric ** none. 339536Seric */ 349536Seric 359536Seric ENVELOPE * 369536Seric newenvelope(e) 379536Seric register ENVELOPE *e; 389536Seric { 399536Seric register ENVELOPE *parent; 409536Seric extern putheader(), putbody(); 4125611Seric extern ENVELOPE BlankEnvelope; 429536Seric 439536Seric parent = CurEnv; 4456215Seric if (e == CurEnv && e->e_parent != NULL) 459536Seric parent = e->e_parent; 4625611Seric clearenvelope(e, TRUE); 4724944Seric if (e == CurEnv) 4824944Seric bcopy((char *) &NullAddress, (char *) &e->e_from, sizeof e->e_from); 4924944Seric else 5024944Seric bcopy((char *) &CurEnv->e_from, (char *) &e->e_from, sizeof e->e_from); 519536Seric e->e_parent = parent; 529536Seric e->e_ctime = curtime(); 5356215Seric if (parent != NULL) 5456215Seric e->e_msgpriority = parent->e_msgsize; 559536Seric e->e_puthdr = putheader; 569536Seric e->e_putbody = putbody; 579536Seric if (CurEnv->e_xfp != NULL) 589536Seric (void) fflush(CurEnv->e_xfp); 599536Seric 609536Seric return (e); 619536Seric } 629536Seric /* 639536Seric ** DROPENVELOPE -- deallocate an envelope. 649536Seric ** 659536Seric ** Parameters: 669536Seric ** e -- the envelope to deallocate. 679536Seric ** 689536Seric ** Returns: 699536Seric ** none. 709536Seric ** 719536Seric ** Side Effects: 729536Seric ** housekeeping necessary to dispose of an envelope. 739536Seric ** Unlocks this queue file. 749536Seric */ 759536Seric 769536Seric dropenvelope(e) 779536Seric register ENVELOPE *e; 789536Seric { 799536Seric bool queueit = FALSE; 809536Seric register ADDRESS *q; 81*57943Seric char *id = e->e_id; 829536Seric 839536Seric if (tTd(50, 1)) 849536Seric { 859536Seric printf("dropenvelope %x id=", e); 869536Seric xputs(e->e_id); 879536Seric printf(" flags=%o\n", e->e_flags); 889536Seric } 89*57943Seric 90*57943Seric if (id == NULL) 91*57943Seric id = "(none)"; 92*57943Seric 939536Seric #ifdef LOG 9455360Seric if (LogLevel > 12) 959536Seric syslog(LOG_DEBUG, "dropenvelope, id=%s, flags=%o, pid=%d", 96*57943Seric id, e->e_flags, getpid()); 9756795Seric #endif /* LOG */ 989536Seric 999536Seric /* we must have an id to remove disk files */ 1009536Seric if (e->e_id == NULL) 1019536Seric return; 1029536Seric 1039536Seric /* 1049536Seric ** Extract state information from dregs of send list. 1059536Seric */ 1069536Seric 1079536Seric for (q = e->e_sendqueue; q != NULL; q = q->q_next) 1089536Seric { 1099536Seric if (bitset(QQUEUEUP, q->q_flags)) 1109536Seric queueit = TRUE; 1119536Seric } 1129536Seric 1139536Seric /* 1149536Seric ** Send back return receipts as requested. 1159536Seric */ 1169536Seric 1179536Seric if (e->e_receiptto != NULL && bitset(EF_SENDRECEIPT, e->e_flags)) 1189536Seric { 11910844Seric auto ADDRESS *rlist = NULL; 1209536Seric 12155012Seric sendtolist(e->e_receiptto, (ADDRESS *) NULL, &rlist, e); 12255012Seric (void) returntosender("Return receipt", rlist, FALSE, e); 1239536Seric } 1249536Seric 1259536Seric /* 1269536Seric ** Arrange to send error messages if there are fatal errors. 1279536Seric */ 1289536Seric 12910754Seric if (bitset(EF_FATALERRS|EF_TIMEOUT, e->e_flags) && ErrorMode != EM_QUIET) 1309536Seric savemail(e); 1319536Seric 1329536Seric /* 1339536Seric ** Instantiate or deinstantiate the queue. 1349536Seric */ 1359536Seric 1369536Seric if ((!queueit && !bitset(EF_KEEPQUEUE, e->e_flags)) || 1379536Seric bitset(EF_CLRQUEUE, e->e_flags)) 1389536Seric { 13923497Seric if (e->e_df != NULL) 14023497Seric xunlink(e->e_df); 1419536Seric xunlink(queuename(e, 'q')); 1429536Seric } 1439536Seric else if (queueit || !bitset(EF_INQUEUE, e->e_flags)) 14410754Seric { 14510754Seric #ifdef QUEUE 14651920Seric queueup(e, FALSE, FALSE); 14756795Seric #else /* QUEUE */ 14810754Seric syserr("dropenvelope: queueup"); 14956795Seric #endif /* QUEUE */ 15010754Seric } 1519536Seric 1529536Seric /* now unlock the job */ 15310196Seric closexscript(e); 1549536Seric unlockqueue(e); 1559536Seric 1569536Seric /* make sure that this envelope is marked unused */ 1579536Seric e->e_id = e->e_df = NULL; 15824944Seric if (e->e_dfp != NULL) 15924944Seric (void) fclose(e->e_dfp); 16010196Seric e->e_dfp = NULL; 16157589Seric 16257589Seric #ifdef LOG 16357589Seric if (LogLevel >= 10) 164*57943Seric syslog(LOG_INFO, "%s: done", id); 16557589Seric #endif /* LOG */ 1669536Seric } 1679536Seric /* 1689536Seric ** CLEARENVELOPE -- clear an envelope without unlocking 1699536Seric ** 1709536Seric ** This is normally used by a child process to get a clean 1719536Seric ** envelope without disturbing the parent. 1729536Seric ** 1739536Seric ** Parameters: 1749536Seric ** e -- the envelope to clear. 17525611Seric ** fullclear - if set, the current envelope is total 17625611Seric ** garbage and should be ignored; otherwise, 17725611Seric ** release any resources it may indicate. 1789536Seric ** 1799536Seric ** Returns: 1809536Seric ** none. 1819536Seric ** 1829536Seric ** Side Effects: 1839536Seric ** Closes files associated with the envelope. 1849536Seric ** Marks the envelope as unallocated. 1859536Seric */ 1869536Seric 18725611Seric clearenvelope(e, fullclear) 1889536Seric register ENVELOPE *e; 18925611Seric bool fullclear; 1909536Seric { 19125514Seric register HDR *bh; 19225514Seric register HDR **nhp; 19325514Seric extern ENVELOPE BlankEnvelope; 19425514Seric 19525611Seric if (!fullclear) 19625611Seric { 19725611Seric /* clear out any file information */ 19825611Seric if (e->e_xfp != NULL) 19925611Seric (void) fclose(e->e_xfp); 20025611Seric if (e->e_dfp != NULL) 20125611Seric (void) fclose(e->e_dfp); 20225611Seric } 2039536Seric 20424961Seric /* now clear out the data */ 20524965Seric STRUCTCOPY(BlankEnvelope, *e); 20625514Seric bh = BlankEnvelope.e_header; 20725514Seric nhp = &e->e_header; 20825514Seric while (bh != NULL) 20925514Seric { 21025514Seric *nhp = (HDR *) xalloc(sizeof *bh); 21125514Seric bcopy((char *) bh, (char *) *nhp, sizeof *bh); 21225514Seric bh = bh->h_link; 21325514Seric nhp = &(*nhp)->h_link; 21425514Seric } 2159536Seric } 2169536Seric /* 2179536Seric ** INITSYS -- initialize instantiation of system 2189536Seric ** 2199536Seric ** In Daemon mode, this is done in the child. 2209536Seric ** 2219536Seric ** Parameters: 2229536Seric ** none. 2239536Seric ** 2249536Seric ** Returns: 2259536Seric ** none. 2269536Seric ** 2279536Seric ** Side Effects: 2289536Seric ** Initializes the system macros, some global variables, 2299536Seric ** etc. In particular, the current time in various 2309536Seric ** forms is set. 2319536Seric */ 2329536Seric 23355012Seric initsys(e) 23455012Seric register ENVELOPE *e; 2359536Seric { 2369536Seric static char cbuf[5]; /* holds hop count */ 2379536Seric static char pbuf[10]; /* holds pid */ 23822963Smiriam #ifdef TTYNAME 2399536Seric static char ybuf[10]; /* holds tty id */ 2409536Seric register char *p; 24156795Seric #endif /* TTYNAME */ 2429536Seric extern char *ttyname(); 2439536Seric extern char *macvalue(); 2449536Seric extern char Version[]; 2459536Seric 2469536Seric /* 2479536Seric ** Give this envelope a reality. 2489536Seric ** I.e., an id, a transcript, and a creation time. 2499536Seric */ 2509536Seric 25155012Seric openxscript(e); 25255012Seric e->e_ctime = curtime(); 2539536Seric 2549536Seric /* 2559536Seric ** Set OutChannel to something useful if stdout isn't it. 2569536Seric ** This arranges that any extra stuff the mailer produces 2579536Seric ** gets sent back to the user on error (because it is 2589536Seric ** tucked away in the transcript). 2599536Seric */ 2609536Seric 2619536Seric if (OpMode == MD_DAEMON && QueueRun) 26255012Seric OutChannel = e->e_xfp; 2639536Seric 2649536Seric /* 2659536Seric ** Set up some basic system macros. 2669536Seric */ 2679536Seric 2689536Seric /* process id */ 2699536Seric (void) sprintf(pbuf, "%d", getpid()); 27055012Seric define('p', pbuf, e); 2719536Seric 2729536Seric /* hop count */ 27355012Seric (void) sprintf(cbuf, "%d", e->e_hopcount); 27455012Seric define('c', cbuf, e); 2759536Seric 2769536Seric /* time as integer, unix time, arpa time */ 27755012Seric settime(e); 2789536Seric 27917472Seric #ifdef TTYNAME 2809536Seric /* tty name */ 28155012Seric if (macvalue('y', e) == NULL) 2829536Seric { 2839536Seric p = ttyname(2); 2849536Seric if (p != NULL) 2859536Seric { 28656795Seric if (strrchr(p, '/') != NULL) 28756795Seric p = strrchr(p, '/') + 1; 2889536Seric (void) strcpy(ybuf, p); 28955012Seric define('y', ybuf, e); 2909536Seric } 2919536Seric } 29256795Seric #endif /* TTYNAME */ 2939536Seric } 2949536Seric /* 29511932Seric ** SETTIME -- set the current time. 29611932Seric ** 29711932Seric ** Parameters: 29811932Seric ** none. 29911932Seric ** 30011932Seric ** Returns: 30111932Seric ** none. 30211932Seric ** 30311932Seric ** Side Effects: 30411932Seric ** Sets the various time macros -- $a, $b, $d, $t. 30511932Seric */ 30611932Seric 30755012Seric settime(e) 30855012Seric register ENVELOPE *e; 30911932Seric { 31011932Seric register char *p; 31111932Seric auto time_t now; 31211932Seric static char tbuf[20]; /* holds "current" time */ 31311932Seric static char dbuf[30]; /* holds ctime(tbuf) */ 31411932Seric register struct tm *tm; 31511932Seric extern char *arpadate(); 31611932Seric extern struct tm *gmtime(); 31711932Seric extern char *macvalue(); 31811932Seric 31911932Seric now = curtime(); 32011932Seric tm = gmtime(&now); 32157014Seric (void) sprintf(tbuf, "%04d%02d%02d%02d%02d", tm->tm_year + 1900, 32257014Seric tm->tm_mon+1, tm->tm_mday, tm->tm_hour, tm->tm_min); 32355012Seric define('t', tbuf, e); 32411932Seric (void) strcpy(dbuf, ctime(&now)); 32556795Seric *strchr(dbuf, '\n') = '\0'; 32655012Seric if (macvalue('d', e) == NULL) 32755012Seric define('d', dbuf, e); 32811932Seric p = newstr(arpadate(dbuf)); 32955012Seric if (macvalue('a', e) == NULL) 33055012Seric define('a', p, e); 33155012Seric define('b', p, e); 33211932Seric } 33311932Seric /* 3349536Seric ** OPENXSCRIPT -- Open transcript file 3359536Seric ** 3369536Seric ** Creates a transcript file for possible eventual mailing or 3379536Seric ** sending back. 3389536Seric ** 3399536Seric ** Parameters: 3409536Seric ** e -- the envelope to create the transcript in/for. 3419536Seric ** 3429536Seric ** Returns: 3439536Seric ** none 3449536Seric ** 3459536Seric ** Side Effects: 3469536Seric ** Creates the transcript file. 3479536Seric */ 3489536Seric 3499536Seric openxscript(e) 3509536Seric register ENVELOPE *e; 3519536Seric { 3529536Seric register char *p; 35340933Srick int fd; 3549536Seric 35510196Seric # ifdef LOG 35610196Seric if (LogLevel > 19) 35710196Seric syslog(LOG_DEBUG, "%s: openx%s", e->e_id, e->e_xfp == NULL ? "" : " (no)"); 35856795Seric # endif /* LOG */ 3599536Seric if (e->e_xfp != NULL) 3609536Seric return; 3619536Seric p = queuename(e, 'x'); 36240933Srick fd = open(p, O_WRONLY|O_CREAT, 0644); 36340933Srick if (fd < 0) 3649536Seric syserr("Can't create %s", p); 3659536Seric else 36640933Srick e->e_xfp = fdopen(fd, "w"); 3679536Seric } 3689536Seric /* 36910196Seric ** CLOSEXSCRIPT -- close the transcript file. 37010196Seric ** 37110196Seric ** Parameters: 37210196Seric ** e -- the envelope containing the transcript to close. 37310196Seric ** 37410196Seric ** Returns: 37510196Seric ** none. 37610196Seric ** 37710196Seric ** Side Effects: 37810196Seric ** none. 37910196Seric */ 38010196Seric 38110196Seric closexscript(e) 38210196Seric register ENVELOPE *e; 38310196Seric { 38410196Seric if (e->e_xfp == NULL) 38510196Seric return; 38610196Seric (void) fclose(e->e_xfp); 38710196Seric e->e_xfp = NULL; 38810196Seric } 38910196Seric /* 3909536Seric ** SETSENDER -- set the person who this message is from 3919536Seric ** 3929536Seric ** Under certain circumstances allow the user to say who 3939536Seric ** s/he is (using -f or -r). These are: 3949536Seric ** 1. The user's uid is zero (root). 3959536Seric ** 2. The user's login name is in an approved list (typically 3969536Seric ** from a network server). 3979536Seric ** 3. The address the user is trying to claim has a 3989536Seric ** "!" character in it (since #2 doesn't do it for 3999536Seric ** us if we are dialing out for UUCP). 4009536Seric ** A better check to replace #3 would be if the 4019536Seric ** effective uid is "UUCP" -- this would require me 4029536Seric ** to rewrite getpwent to "grab" uucp as it went by, 4039536Seric ** make getname more nasty, do another passwd file 4049536Seric ** scan, or compile the UID of "UUCP" into the code, 4059536Seric ** all of which are reprehensible. 4069536Seric ** 4079536Seric ** Assuming all of these fail, we figure out something 4089536Seric ** ourselves. 4099536Seric ** 4109536Seric ** Parameters: 4119536Seric ** from -- the person we would like to believe this message 4129536Seric ** is from, as specified on the command line. 41353182Seric ** e -- the envelope in which we would like the sender set. 4149536Seric ** 4159536Seric ** Returns: 4169536Seric ** none. 4179536Seric ** 4189536Seric ** Side Effects: 4199536Seric ** sets sendmail's notion of who the from person is. 4209536Seric */ 4219536Seric 42253182Seric setsender(from, e) 4239536Seric char *from; 42453182Seric register ENVELOPE *e; 4259536Seric { 4269536Seric register char **pvp; 4279536Seric char *realname = NULL; 42818665Seric register struct passwd *pw; 4299536Seric char buf[MAXNAME]; 43016913Seric char pvpbuf[PSBUFSIZE]; 43118665Seric extern struct passwd *getpwnam(); 4329536Seric extern char *macvalue(); 4339536Seric extern char **prescan(); 4349536Seric extern bool safefile(); 4359536Seric extern char *FullName; 4369536Seric 4379536Seric if (tTd(45, 1)) 43814786Seric printf("setsender(%s)\n", from == NULL ? "" : from); 4399536Seric 4409536Seric /* 4419536Seric ** Figure out the real user executing us. 4429536Seric ** Username can return errno != 0 on non-errors. 4439536Seric */ 4449536Seric 44552220Seric if (QueueRun || OpMode == MD_SMTP) 4469536Seric realname = from; 4479536Seric if (realname == NULL || realname[0] == '\0') 4489536Seric { 4499536Seric extern char *username(); 4509536Seric 4519536Seric realname = username(); 4529536Seric } 4539536Seric 4549536Seric /* 4559536Seric ** Determine if this real person is allowed to alias themselves. 4569536Seric */ 4579536Seric 4589536Seric if (from != NULL) 4599536Seric { 4609536Seric extern bool trusteduser(); 4619536Seric 46236230Skarels if (!trusteduser(realname) && getuid() != geteuid() && 46356795Seric strchr(from, '!') == NULL && getuid() != 0) 4649536Seric { 4659536Seric /* network sends -r regardless (why why why?) */ 4669536Seric /* syserr("%s, you cannot use the -f flag", realname); */ 4679536Seric from = NULL; 4689536Seric } 4699536Seric } 4709536Seric 47157589Seric /* 4729536Seric SuprErrs = TRUE; 47357589Seric */ 47455012Seric if (from == NULL || parseaddr(from, &e->e_from, 1, '\0', e) == NULL) 4759536Seric { 47621750Seric /* log garbage addresses for traceback */ 47755173Seric # ifdef LOG 47855173Seric if (from != NULL && LogLevel >= 1) 47921750Seric { 48055173Seric char *host = RealHostName; 48155173Seric 48255173Seric if (host == NULL) 48355173Seric host = MyHostName; 48455173Seric syslog(LOG_NOTICE, 48555173Seric "from=%s unparseable, received from %s@%s", 48655173Seric from, realname, host); 48755173Seric } 48856795Seric # endif /* LOG */ 48957589Seric if (from != NULL) 49057589Seric SuprErrs = TRUE; 49157589Seric if (from == realname || 49257589Seric parseaddr(from = newstr(realname), &e->e_from, 1, '\0', e) == NULL) 49324944Seric { 49457589Seric SuprErrs = TRUE; 49557589Seric if (parseaddr("postmaster", &e->e_from, 1, '\0', e) == NULL) 49657589Seric syserr("setsender: can't even parse postmaster!"); 49724944Seric } 4989536Seric } 4999536Seric else 5009536Seric FromFlag = TRUE; 50153182Seric e->e_from.q_flags |= QDONTSEND; 50257731Seric if (tTd(45, 5)) 50357731Seric { 50457731Seric printf("setsender: QDONTSEND "); 50557731Seric printaddr(&e->e_from, FALSE); 50657731Seric } 50753182Seric loweraddr(&e->e_from); 5089536Seric SuprErrs = FALSE; 5099536Seric 51053736Seric pvp = NULL; 51153736Seric if (e->e_from.q_mailer == LocalMailer) 5129536Seric { 51353736Seric # ifdef USERDB 51453736Seric register char *p; 51553736Seric extern char *udbsender(); 51653736Seric # endif 51717472Seric 5189536Seric /* if the user has given fullname already, don't redefine */ 5199536Seric if (FullName == NULL) 52053182Seric FullName = macvalue('x', e); 52111932Seric if (FullName != NULL && FullName[0] == '\0') 5229536Seric FullName = NULL; 5239536Seric 52453736Seric # ifdef USERDB 52553736Seric p = udbsender(from); 52653736Seric 52753736Seric if (p != NULL) 5289536Seric { 52953736Seric /* 53053736Seric ** We have an alternate address for the sender 53153736Seric */ 53253736Seric 53353736Seric pvp = prescan(p, '\0', pvpbuf); 5349536Seric } 53553736Seric # endif /* USERDB */ 53653736Seric 53753736Seric if ((pw = getpwnam(e->e_from.q_user)) != NULL) 53853736Seric { 53953736Seric /* 54053736Seric ** Process passwd file entry. 54153736Seric */ 54253736Seric 54353736Seric 54453736Seric /* extract home directory */ 54553736Seric e->e_from.q_home = newstr(pw->pw_dir); 54653736Seric define('z', e->e_from.q_home, e); 54753736Seric 54853736Seric /* extract user and group id */ 54953736Seric e->e_from.q_uid = pw->pw_uid; 55053736Seric e->e_from.q_gid = pw->pw_gid; 55153736Seric 55253736Seric /* extract full name from passwd file */ 55353736Seric if (FullName == NULL && pw->pw_gecos != NULL && 55453736Seric strcmp(pw->pw_name, e->e_from.q_user) == 0) 55553736Seric { 55653736Seric buildfname(pw->pw_gecos, e->e_from.q_user, buf); 55753736Seric if (buf[0] != '\0') 55853736Seric FullName = newstr(buf); 55953736Seric } 56053736Seric } 5619536Seric if (FullName != NULL) 56253182Seric define('x', FullName, e); 5639536Seric } 56411625Seric else 56511625Seric { 56653182Seric if (e->e_from.q_home == NULL) 56753182Seric e->e_from.q_home = getenv("HOME"); 56853182Seric e->e_from.q_uid = getuid(); 56953182Seric e->e_from.q_gid = getgid(); 57011625Seric } 57111625Seric 5729536Seric /* 5739536Seric ** Rewrite the from person to dispose of possible implicit 5749536Seric ** links in the net. 5759536Seric */ 5769536Seric 5779536Seric if (pvp == NULL) 57853736Seric pvp = prescan(from, '\0', pvpbuf); 57953736Seric if (pvp == NULL) 5809536Seric { 58136233Skarels # ifdef LOG 58236233Skarels if (LogLevel >= 1) 58336233Skarels syslog(LOG_NOTICE, "cannot prescan from (%s)", from); 58436233Skarels # endif 58536230Skarels usrerr("cannot prescan from (%s)", from); 5869536Seric finis(); 5879536Seric } 5889536Seric rewrite(pvp, 3); 5899536Seric rewrite(pvp, 1); 59025032Seric rewrite(pvp, 4); 5919536Seric cataddr(pvp, buf, sizeof buf); 59253182Seric e->e_sender = e->e_returnpath = newstr(buf); 5939536Seric 59453182Seric define('f', e->e_sender, e); 59551951Seric 5969536Seric /* save the domain spec if this mailer wants it */ 59753182Seric if (e->e_from.q_mailer != NULL && 59853182Seric bitnset(M_CANONICAL, e->e_from.q_mailer->m_flags)) 5999536Seric { 6009536Seric extern char **copyplist(); 6019536Seric 6029536Seric while (*pvp != NULL && strcmp(*pvp, "@") != 0) 6039536Seric pvp++; 6049536Seric if (*pvp != NULL) 60553182Seric e->e_fromdomain = copyplist(pvp, TRUE); 6069536Seric } 6079536Seric } 6089536Seric /* 6099536Seric ** TRUSTEDUSER -- tell us if this user is to be trusted. 6109536Seric ** 6119536Seric ** Parameters: 6129536Seric ** user -- the user to be checked. 6139536Seric ** 6149536Seric ** Returns: 6159536Seric ** TRUE if the user is in an approved list. 6169536Seric ** FALSE otherwise. 6179536Seric ** 6189536Seric ** Side Effects: 6199536Seric ** none. 6209536Seric */ 6219536Seric 6229536Seric bool 6239536Seric trusteduser(user) 6249536Seric char *user; 6259536Seric { 6269536Seric register char **ulist; 6279536Seric extern char *TrustedUsers[]; 6289536Seric 6299536Seric for (ulist = TrustedUsers; *ulist != NULL; ulist++) 6309536Seric if (strcmp(*ulist, user) == 0) 6319536Seric return (TRUE); 6329536Seric return (FALSE); 6339536Seric } 634