1 /* 2 * Copyright (c) 1983 Eric P. Allman 3 * Copyright (c) 1988 Regents of the University of California. 4 * All rights reserved. 5 * 6 * %sccs.include.redist.c% 7 */ 8 9 #ifndef lint 10 static char sccsid[] = "@(#)readcf.c 5.31 (Berkeley) 01/04/92"; 11 #endif /* not lint */ 12 13 # include "sendmail.h" 14 15 /* 16 ** READCF -- read control file. 17 ** 18 ** This routine reads the control file and builds the internal 19 ** form. 20 ** 21 ** The file is formatted as a sequence of lines, each taken 22 ** atomically. The first character of each line describes how 23 ** the line is to be interpreted. The lines are: 24 ** Dxval Define macro x to have value val. 25 ** Cxword Put word into class x. 26 ** Fxfile [fmt] Read file for lines to put into 27 ** class x. Use scanf string 'fmt' 28 ** or "%s" if not present. Fmt should 29 ** only produce one string-valued result. 30 ** Hname: value Define header with field-name 'name' 31 ** and value as specified; this will be 32 ** macro expanded immediately before 33 ** use. 34 ** Sn Use rewriting set n. 35 ** Rlhs rhs Rewrite addresses that match lhs to 36 ** be rhs. 37 ** Mn arg=val... Define mailer. n is the internal name. 38 ** Args specify mailer parameters. 39 ** Oxvalue Set option x to value. 40 ** Pname=value Set precedence name to value. 41 ** 42 ** Parameters: 43 ** cfname -- control file name. 44 ** 45 ** Returns: 46 ** none. 47 ** 48 ** Side Effects: 49 ** Builds several internal tables. 50 */ 51 52 readcf(cfname) 53 char *cfname; 54 { 55 FILE *cf; 56 int ruleset = 0; 57 char *q; 58 char **pv; 59 struct rewrite *rwp = NULL; 60 char buf[MAXLINE]; 61 register char *p; 62 extern char **prescan(); 63 extern char **copyplist(); 64 char exbuf[MAXLINE]; 65 char pvpbuf[PSBUFSIZE]; 66 extern char *fgetfolded(); 67 extern char *munchstring(); 68 69 cf = fopen(cfname, "r"); 70 if (cf == NULL) 71 { 72 syserr("cannot open %s", cfname); 73 exit(EX_OSFILE); 74 } 75 76 FileName = cfname; 77 LineNumber = 0; 78 while (fgetfolded(buf, sizeof buf, cf) != NULL) 79 { 80 /* map $ into \001 (ASCII SOH) for macro expansion */ 81 for (p = buf; *p != '\0'; p++) 82 { 83 if (*p != '$') 84 continue; 85 86 if (p[1] == '$') 87 { 88 /* actual dollar sign.... */ 89 (void) strcpy(p, p + 1); 90 continue; 91 } 92 93 /* convert to macro expansion character */ 94 *p = '\001'; 95 } 96 97 /* interpret this line */ 98 switch (buf[0]) 99 { 100 case '\0': 101 case '#': /* comment */ 102 break; 103 104 case 'R': /* rewriting rule */ 105 for (p = &buf[1]; *p != '\0' && *p != '\t'; p++) 106 continue; 107 108 if (*p == '\0') 109 { 110 syserr("invalid rewrite line \"%s\"", buf); 111 break; 112 } 113 114 /* allocate space for the rule header */ 115 if (rwp == NULL) 116 { 117 RewriteRules[ruleset] = rwp = 118 (struct rewrite *) xalloc(sizeof *rwp); 119 } 120 else 121 { 122 rwp->r_next = (struct rewrite *) xalloc(sizeof *rwp); 123 rwp = rwp->r_next; 124 } 125 rwp->r_next = NULL; 126 127 /* expand and save the LHS */ 128 *p = '\0'; 129 expand(&buf[1], exbuf, &exbuf[sizeof exbuf], CurEnv); 130 rwp->r_lhs = prescan(exbuf, '\t', pvpbuf); 131 if (rwp->r_lhs != NULL) 132 rwp->r_lhs = copyplist(rwp->r_lhs, TRUE); 133 134 /* expand and save the RHS */ 135 while (*++p == '\t') 136 continue; 137 q = p; 138 while (*p != '\0' && *p != '\t') 139 p++; 140 *p = '\0'; 141 expand(q, exbuf, &exbuf[sizeof exbuf], CurEnv); 142 rwp->r_rhs = prescan(exbuf, '\t', pvpbuf); 143 if (rwp->r_rhs != NULL) 144 rwp->r_rhs = copyplist(rwp->r_rhs, TRUE); 145 break; 146 147 case 'S': /* select rewriting set */ 148 ruleset = atoi(&buf[1]); 149 if (ruleset >= MAXRWSETS || ruleset < 0) 150 { 151 syserr("bad ruleset %d (%d max)", ruleset, MAXRWSETS); 152 ruleset = 0; 153 } 154 rwp = NULL; 155 break; 156 157 case 'D': /* macro definition */ 158 define(buf[1], newstr(munchstring(&buf[2])), CurEnv); 159 break; 160 161 case 'H': /* required header line */ 162 (void) chompheader(&buf[1], TRUE); 163 break; 164 165 case 'C': /* word class */ 166 case 'F': /* word class from file */ 167 /* read list of words from argument or file */ 168 if (buf[0] == 'F') 169 { 170 /* read from file */ 171 for (p = &buf[2]; *p != '\0' && !isspace(*p); p++) 172 continue; 173 if (*p == '\0') 174 p = "%s"; 175 else 176 { 177 *p = '\0'; 178 while (isspace(*++p)) 179 continue; 180 } 181 fileclass(buf[1], &buf[2], p); 182 break; 183 } 184 185 /* scan the list of words and set class for all */ 186 for (p = &buf[2]; *p != '\0'; ) 187 { 188 register char *wd; 189 char delim; 190 191 while (*p != '\0' && isspace(*p)) 192 p++; 193 wd = p; 194 while (*p != '\0' && !isspace(*p)) 195 p++; 196 delim = *p; 197 *p = '\0'; 198 if (wd[0] != '\0') 199 setclass(buf[1], wd); 200 *p = delim; 201 } 202 break; 203 204 case 'M': /* define mailer */ 205 makemailer(&buf[1]); 206 break; 207 208 case 'O': /* set option */ 209 setoption(buf[1], &buf[2], TRUE, FALSE); 210 break; 211 212 case 'P': /* set precedence */ 213 if (NumPriorities >= MAXPRIORITIES) 214 { 215 toomany('P', MAXPRIORITIES); 216 break; 217 } 218 for (p = &buf[1]; *p != '\0' && *p != '=' && *p != '\t'; p++) 219 continue; 220 if (*p == '\0') 221 goto badline; 222 *p = '\0'; 223 Priorities[NumPriorities].pri_name = newstr(&buf[1]); 224 Priorities[NumPriorities].pri_val = atoi(++p); 225 NumPriorities++; 226 break; 227 228 case 'T': /* trusted user(s) */ 229 p = &buf[1]; 230 while (*p != '\0') 231 { 232 while (isspace(*p)) 233 p++; 234 q = p; 235 while (*p != '\0' && !isspace(*p)) 236 p++; 237 if (*p != '\0') 238 *p++ = '\0'; 239 if (*q == '\0') 240 continue; 241 for (pv = TrustedUsers; *pv != NULL; pv++) 242 continue; 243 if (pv >= &TrustedUsers[MAXTRUST]) 244 { 245 toomany('T', MAXTRUST); 246 break; 247 } 248 *pv = newstr(q); 249 } 250 break; 251 252 default: 253 badline: 254 syserr("unknown control line \"%s\"", buf); 255 } 256 } 257 FileName = NULL; 258 } 259 /* 260 ** TOOMANY -- signal too many of some option 261 ** 262 ** Parameters: 263 ** id -- the id of the error line 264 ** maxcnt -- the maximum possible values 265 ** 266 ** Returns: 267 ** none. 268 ** 269 ** Side Effects: 270 ** gives a syserr. 271 */ 272 273 toomany(id, maxcnt) 274 char id; 275 int maxcnt; 276 { 277 syserr("too many %c lines, %d max", id, maxcnt); 278 } 279 /* 280 ** FILECLASS -- read members of a class from a file 281 ** 282 ** Parameters: 283 ** class -- class to define. 284 ** filename -- name of file to read. 285 ** fmt -- scanf string to use for match. 286 ** 287 ** Returns: 288 ** none 289 ** 290 ** Side Effects: 291 ** 292 ** puts all lines in filename that match a scanf into 293 ** the named class. 294 */ 295 296 fileclass(class, filename, fmt) 297 int class; 298 char *filename; 299 char *fmt; 300 { 301 FILE *f; 302 char buf[MAXLINE]; 303 304 if (filename[0] == '|') 305 f = popen(filename + 1, "r"); 306 else 307 f = fopen(filename, "r"); 308 if (f == NULL) 309 { 310 syserr("cannot open %s", filename); 311 return; 312 } 313 314 while (fgets(buf, sizeof buf, f) != NULL) 315 { 316 register STAB *s; 317 register char *p; 318 # ifdef SCANF 319 char wordbuf[MAXNAME+1]; 320 321 if (sscanf(buf, fmt, wordbuf) != 1) 322 continue; 323 p = wordbuf; 324 # else SCANF 325 p = buf; 326 # endif SCANF 327 328 /* 329 ** Break up the match into words. 330 */ 331 332 while (*p != '\0') 333 { 334 register char *q; 335 336 /* strip leading spaces */ 337 while (isspace(*p)) 338 p++; 339 if (*p == '\0') 340 break; 341 342 /* find the end of the word */ 343 q = p; 344 while (*p != '\0' && !isspace(*p)) 345 p++; 346 if (*p != '\0') 347 *p++ = '\0'; 348 349 /* enter the word in the symbol table */ 350 s = stab(q, ST_CLASS, ST_ENTER); 351 setbitn(class, s->s_class); 352 } 353 } 354 355 if (filename[0] == '|') 356 (void) pclose(f); 357 else 358 (void) fclose(f); 359 } 360 /* 361 ** MAKEMAILER -- define a new mailer. 362 ** 363 ** Parameters: 364 ** line -- description of mailer. This is in labeled 365 ** fields. The fields are: 366 ** P -- the path to the mailer 367 ** F -- the flags associated with the mailer 368 ** A -- the argv for this mailer 369 ** S -- the sender rewriting set 370 ** R -- the recipient rewriting set 371 ** E -- the eol string 372 ** The first word is the canonical name of the mailer. 373 ** 374 ** Returns: 375 ** none. 376 ** 377 ** Side Effects: 378 ** enters the mailer into the mailer table. 379 */ 380 381 makemailer(line) 382 char *line; 383 { 384 register char *p; 385 register struct mailer *m; 386 register STAB *s; 387 int i; 388 char fcode; 389 extern int NextMailer; 390 extern char **makeargv(); 391 extern char *munchstring(); 392 extern char *DelimChar; 393 extern long atol(); 394 395 /* allocate a mailer and set up defaults */ 396 m = (struct mailer *) xalloc(sizeof *m); 397 bzero((char *) m, sizeof *m); 398 m->m_mno = NextMailer; 399 m->m_eol = "\n"; 400 401 /* collect the mailer name */ 402 for (p = line; *p != '\0' && *p != ',' && !isspace(*p); p++) 403 continue; 404 if (*p != '\0') 405 *p++ = '\0'; 406 m->m_name = newstr(line); 407 408 /* now scan through and assign info from the fields */ 409 while (*p != '\0') 410 { 411 while (*p != '\0' && (*p == ',' || isspace(*p))) 412 p++; 413 414 /* p now points to field code */ 415 fcode = *p; 416 while (*p != '\0' && *p != '=' && *p != ',') 417 p++; 418 if (*p++ != '=') 419 { 420 syserr("`=' expected"); 421 return; 422 } 423 while (isspace(*p)) 424 p++; 425 426 /* p now points to the field body */ 427 p = munchstring(p); 428 429 /* install the field into the mailer struct */ 430 switch (fcode) 431 { 432 case 'P': /* pathname */ 433 m->m_mailer = newstr(p); 434 break; 435 436 case 'F': /* flags */ 437 for (; *p != '\0'; p++) 438 setbitn(*p, m->m_flags); 439 break; 440 441 case 'S': /* sender rewriting ruleset */ 442 case 'R': /* recipient rewriting ruleset */ 443 i = atoi(p); 444 if (i < 0 || i >= MAXRWSETS) 445 { 446 syserr("invalid rewrite set, %d max", MAXRWSETS); 447 return; 448 } 449 if (fcode == 'S') 450 m->m_s_rwset = i; 451 else 452 m->m_r_rwset = i; 453 break; 454 455 case 'E': /* end of line string */ 456 m->m_eol = newstr(p); 457 break; 458 459 case 'A': /* argument vector */ 460 m->m_argv = makeargv(p); 461 break; 462 463 case 'M': /* maximum message size */ 464 m->m_maxsize = atol(p); 465 break; 466 467 case 'L': /* maximum line length */ 468 m->m_linelimit = atoi(p); 469 break; 470 } 471 472 p = DelimChar; 473 } 474 475 /* do some heuristic cleanup for back compatibility */ 476 if (bitnset(M_LIMITS, m->m_flags)) 477 { 478 if (m->m_linelimit == 0) 479 m->m_linelimit = SMTPLINELIM; 480 if (!bitnset(M_8BITS, m->m_flags)) 481 setbitn(M_7BITS, m->m_flags); 482 } 483 484 /* now store the mailer away */ 485 if (NextMailer >= MAXMAILERS) 486 { 487 syserr("too many mailers defined (%d max)", MAXMAILERS); 488 return; 489 } 490 Mailer[NextMailer++] = m; 491 s = stab(m->m_name, ST_MAILER, ST_ENTER); 492 s->s_mailer = m; 493 } 494 /* 495 ** MUNCHSTRING -- translate a string into internal form. 496 ** 497 ** Parameters: 498 ** p -- the string to munch. 499 ** 500 ** Returns: 501 ** the munched string. 502 ** 503 ** Side Effects: 504 ** Sets "DelimChar" to point to the string that caused us 505 ** to stop. 506 */ 507 508 char * 509 munchstring(p) 510 register char *p; 511 { 512 register char *q; 513 bool backslash = FALSE; 514 bool quotemode = FALSE; 515 static char buf[MAXLINE]; 516 extern char *DelimChar; 517 518 for (q = buf; *p != '\0'; p++) 519 { 520 if (backslash) 521 { 522 /* everything is roughly literal */ 523 backslash = FALSE; 524 switch (*p) 525 { 526 case 'r': /* carriage return */ 527 *q++ = '\r'; 528 continue; 529 530 case 'n': /* newline */ 531 *q++ = '\n'; 532 continue; 533 534 case 'f': /* form feed */ 535 *q++ = '\f'; 536 continue; 537 538 case 'b': /* backspace */ 539 *q++ = '\b'; 540 continue; 541 } 542 *q++ = *p; 543 } 544 else 545 { 546 if (*p == '\\') 547 backslash = TRUE; 548 else if (*p == '"') 549 quotemode = !quotemode; 550 else if (quotemode || *p != ',') 551 *q++ = *p; 552 else 553 break; 554 } 555 } 556 557 DelimChar = p; 558 *q++ = '\0'; 559 return (buf); 560 } 561 /* 562 ** MAKEARGV -- break up a string into words 563 ** 564 ** Parameters: 565 ** p -- the string to break up. 566 ** 567 ** Returns: 568 ** a char **argv (dynamically allocated) 569 ** 570 ** Side Effects: 571 ** munges p. 572 */ 573 574 char ** 575 makeargv(p) 576 register char *p; 577 { 578 char *q; 579 int i; 580 char **avp; 581 char *argv[MAXPV + 1]; 582 583 /* take apart the words */ 584 i = 0; 585 while (*p != '\0' && i < MAXPV) 586 { 587 q = p; 588 while (*p != '\0' && !isspace(*p)) 589 p++; 590 while (isspace(*p)) 591 *p++ = '\0'; 592 argv[i++] = newstr(q); 593 } 594 argv[i++] = NULL; 595 596 /* now make a copy of the argv */ 597 avp = (char **) xalloc(sizeof *avp * i); 598 bcopy((char *) argv, (char *) avp, sizeof *avp * i); 599 600 return (avp); 601 } 602 /* 603 ** PRINTRULES -- print rewrite rules (for debugging) 604 ** 605 ** Parameters: 606 ** none. 607 ** 608 ** Returns: 609 ** none. 610 ** 611 ** Side Effects: 612 ** prints rewrite rules. 613 */ 614 615 printrules() 616 { 617 register struct rewrite *rwp; 618 register int ruleset; 619 620 for (ruleset = 0; ruleset < 10; ruleset++) 621 { 622 if (RewriteRules[ruleset] == NULL) 623 continue; 624 printf("\n----Rule Set %d:", ruleset); 625 626 for (rwp = RewriteRules[ruleset]; rwp != NULL; rwp = rwp->r_next) 627 { 628 printf("\nLHS:"); 629 printav(rwp->r_lhs); 630 printf("RHS:"); 631 printav(rwp->r_rhs); 632 } 633 } 634 } 635 636 /* 637 ** SETOPTION -- set global processing option 638 ** 639 ** Parameters: 640 ** opt -- option name. 641 ** val -- option value (as a text string). 642 ** safe -- set if this came from a configuration file. 643 ** Some options (if set from the command line) will 644 ** reset the user id to avoid security problems. 645 ** sticky -- if set, don't let other setoptions override 646 ** this value. 647 ** 648 ** Returns: 649 ** none. 650 ** 651 ** Side Effects: 652 ** Sets options as implied by the arguments. 653 */ 654 655 static BITMAP StickyOpt; /* set if option is stuck */ 656 657 setoption(opt, val, safe, sticky) 658 char opt; 659 char *val; 660 bool safe; 661 bool sticky; 662 { 663 extern bool atobool(); 664 extern time_t convtime(); 665 extern int QueueLA; 666 extern int RefuseLA; 667 extern bool trusteduser(); 668 extern char *username(); 669 670 if (tTd(37, 1)) 671 printf("setoption %c=%s", opt, val); 672 673 /* 674 ** See if this option is preset for us. 675 */ 676 677 if (bitnset(opt, StickyOpt)) 678 { 679 if (tTd(37, 1)) 680 printf(" (ignored)\n"); 681 return; 682 } 683 684 /* 685 ** Check to see if this option can be specified by this user. 686 */ 687 688 if (!safe && getuid() == 0) 689 safe = TRUE; 690 if (!safe && index("deiLmorsv", opt) == NULL) 691 { 692 if (opt != 'M' || (val[0] != 'r' && val[0] != 's')) 693 { 694 if (tTd(37, 1)) 695 printf(" (unsafe)"); 696 if (getuid() != geteuid()) 697 { 698 if (tTd(37, 1)) 699 printf("(Resetting uid)"); 700 (void) setgid(getgid()); 701 (void) setuid(getuid()); 702 } 703 } 704 } 705 if (tTd(37, 1)) 706 printf("\n"); 707 708 switch (opt) 709 { 710 case '=': /* config file generation level */ 711 ConfigLevel = atoi(val); 712 break; 713 714 case '8': /* allow eight-bit input */ 715 EightBit = atobool(val); 716 break; 717 718 case 'A': /* set default alias file */ 719 if (val[0] == '\0') 720 AliasFile = "aliases"; 721 else 722 AliasFile = newstr(val); 723 break; 724 725 case 'a': /* look N minutes for "@:@" in alias file */ 726 if (val[0] == '\0') 727 SafeAlias = 5; 728 else 729 SafeAlias = atoi(val); 730 break; 731 732 case 'B': /* substitution for blank character */ 733 SpaceSub = val[0]; 734 if (SpaceSub == '\0') 735 SpaceSub = ' '; 736 break; 737 738 case 'c': /* don't connect to "expensive" mailers */ 739 NoConnect = atobool(val); 740 break; 741 742 case 'C': /* checkpoint every N addresses */ 743 CheckpointInterval = atoi(val); 744 break; 745 746 case 'd': /* delivery mode */ 747 switch (*val) 748 { 749 case '\0': 750 SendMode = SM_DELIVER; 751 break; 752 753 case SM_QUEUE: /* queue only */ 754 #ifndef QUEUE 755 syserr("need QUEUE to set -odqueue"); 756 #endif QUEUE 757 /* fall through..... */ 758 759 case SM_DELIVER: /* do everything */ 760 case SM_FORK: /* fork after verification */ 761 SendMode = *val; 762 break; 763 764 default: 765 syserr("Unknown delivery mode %c", *val); 766 exit(EX_USAGE); 767 } 768 break; 769 770 case 'D': /* rebuild alias database as needed */ 771 AutoRebuild = atobool(val); 772 break; 773 774 case 'e': /* set error processing mode */ 775 switch (*val) 776 { 777 case EM_QUIET: /* be silent about it */ 778 case EM_MAIL: /* mail back */ 779 case EM_BERKNET: /* do berknet error processing */ 780 case EM_WRITE: /* write back (or mail) */ 781 HoldErrs = TRUE; 782 /* fall through... */ 783 784 case EM_PRINT: /* print errors normally (default) */ 785 ErrorMode = *val; 786 break; 787 } 788 break; 789 790 case 'F': /* file mode */ 791 FileMode = atooct(val) & 0777; 792 break; 793 794 case 'f': /* save Unix-style From lines on front */ 795 SaveFrom = atobool(val); 796 break; 797 798 case 'g': /* default gid */ 799 DefGid = atoi(val); 800 break; 801 802 case 'H': /* help file */ 803 if (val[0] == '\0') 804 HelpFile = "sendmail.hf"; 805 else 806 HelpFile = newstr(val); 807 break; 808 809 case 'h': /* maximum hop count */ 810 MaxHopCount = atoi(val); 811 break; 812 813 case 'I': /* use internet domain name server */ 814 UseNameServer = atobool(val); 815 break; 816 817 case 'i': /* ignore dot lines in message */ 818 IgnrDot = atobool(val); 819 break; 820 821 case 'L': /* log level */ 822 LogLevel = atoi(val); 823 break; 824 825 case 'M': /* define macro */ 826 define(val[0], newstr(&val[1]), CurEnv); 827 sticky = FALSE; 828 break; 829 830 case 'm': /* send to me too */ 831 MeToo = atobool(val); 832 break; 833 834 case 'n': /* validate RHS in newaliases */ 835 CheckAliases = atobool(val); 836 break; 837 838 case 'o': /* assume old style headers */ 839 if (atobool(val)) 840 CurEnv->e_flags |= EF_OLDSTYLE; 841 else 842 CurEnv->e_flags &= ~EF_OLDSTYLE; 843 break; 844 845 case 'P': /* postmaster copy address for returned mail */ 846 PostMasterCopy = newstr(val); 847 break; 848 849 case 'q': /* slope of queue only function */ 850 QueueFactor = atoi(val); 851 break; 852 853 case 'Q': /* queue directory */ 854 if (val[0] == '\0') 855 QueueDir = "mqueue"; 856 else 857 QueueDir = newstr(val); 858 break; 859 860 case 'r': /* read timeout */ 861 ReadTimeout = convtime(val); 862 break; 863 864 case 'S': /* status file */ 865 if (val[0] == '\0') 866 StatFile = "sendmail.st"; 867 else 868 StatFile = newstr(val); 869 break; 870 871 case 's': /* be super safe, even if expensive */ 872 SuperSafe = atobool(val); 873 break; 874 875 case 'T': /* queue timeout */ 876 TimeOut = convtime(val); 877 /*FALLTHROUGH*/ 878 879 case 't': /* time zone name */ 880 TimeZoneSpec = newstr(val); 881 break; 882 883 case 'U': /* location of user database */ 884 UdbSpec = newstr(val); 885 break; 886 887 case 'u': /* set default uid */ 888 DefUid = atoi(val); 889 setdefuser(); 890 break; 891 892 case 'v': /* run in verbose mode */ 893 Verbose = atobool(val); 894 break; 895 896 case 'w': /* we don't have wildcard MX records */ 897 NoWildcardMX = atobool(val); 898 break; 899 900 case 'x': /* load avg at which to auto-queue msgs */ 901 QueueLA = atoi(val); 902 break; 903 904 case 'X': /* load avg at which to auto-reject connections */ 905 RefuseLA = atoi(val); 906 break; 907 908 case 'y': /* work recipient factor */ 909 WkRecipFact = atoi(val); 910 break; 911 912 case 'Y': /* fork jobs during queue runs */ 913 ForkQueueRuns = atobool(val); 914 break; 915 916 case 'z': /* work message class factor */ 917 WkClassFact = atoi(val); 918 break; 919 920 case 'Z': /* work time factor */ 921 WkTimeFact = atoi(val); 922 break; 923 924 default: 925 break; 926 } 927 if (sticky) 928 setbitn(opt, StickyOpt); 929 return; 930 } 931 /* 932 ** SETCLASS -- set a word into a class 933 ** 934 ** Parameters: 935 ** class -- the class to put the word in. 936 ** word -- the word to enter 937 ** 938 ** Returns: 939 ** none. 940 ** 941 ** Side Effects: 942 ** puts the word into the symbol table. 943 */ 944 945 setclass(class, word) 946 int class; 947 char *word; 948 { 949 register STAB *s; 950 951 s = stab(word, ST_CLASS, ST_ENTER); 952 setbitn(class, s->s_class); 953 } 954