]> diplodocus.org Git - nmh/blob - docs/historical/mh-6.8.5/zotnet/bboards/RCS/getbbent.c,v
Convert whatnow over to using the new Attach header.
[nmh] / docs / historical / mh-6.8.5 / zotnet / bboards / RCS / getbbent.c,v
1 head 1.14;
2 access;
3 symbols;
4 locks; strict;
5 comment @ * @;
6
7
8 1.14
9 date 92.12.15.00.20.22; author jromine; state Exp;
10 branches;
11 next 1.13;
12
13 1.13
14 date 92.12.11.22.12.13; author jromine; state Exp;
15 branches;
16 next 1.12;
17
18 1.12
19 date 92.12.10.23.57.12; author jromine; state Exp;
20 branches;
21 next 1.11;
22
23 1.11
24 date 92.11.24.18.45.37; author jromine; state Exp;
25 branches;
26 next 1.10;
27
28 1.10
29 date 92.05.19.21.14.18; author jromine; state Exp;
30 branches;
31 next 1.9;
32
33 1.9
34 date 92.02.03.17.58.04; author jromine; state Exp;
35 branches;
36 next 1.8;
37
38 1.8
39 date 92.02.03.16.37.17; author jromine; state Exp;
40 branches;
41 next 1.7;
42
43 1.7
44 date 92.01.31.22.30.56; author jromine; state Exp;
45 branches;
46 next 1.6;
47
48 1.6
49 date 92.01.31.22.30.44; author jromine; state Exp;
50 branches;
51 next 1.5;
52
53 1.5
54 date 90.04.09.10.11.57; author sources; state Exp;
55 branches;
56 next 1.4;
57
58 1.4
59 date 90.04.05.15.04.11; author sources; state Exp;
60 branches;
61 next 1.3;
62
63 1.3
64 date 90.02.08.14.11.33; author sources; state Exp;
65 branches;
66 next 1.2;
67
68 1.2
69 date 90.02.06.13.39.12; author sources; state Exp;
70 branches;
71 next 1.1;
72
73 1.1
74 date 90.02.06.13.38.24; author sources; state Exp;
75 branches;
76 next ;
77
78
79 desc
80 @@
81
82
83 1.14
84 log
85 @endif sugar
86 @
87 text
88 @/* getbbent.c - subroutines for accessing the BBoards file */
89 #ifndef lint
90 static char ident[] = "@@(#)$Id: getbbent.c,v 1.13 1992/12/11 22:12:13 jromine Exp jromine $";
91 #endif /* lint */
92
93 /* LINTLIBRARY */
94
95 #include "bboards.h"
96 #ifndef MMDFONLY
97 #include "../h/strings.h"
98 #include <sys/types.h>
99 #else /* MMDFONLY */
100 #include "util.h"
101 #include "mmdf.h"
102 #include "strings.h"
103 #endif /* MMDFONLY */
104 #include <ctype.h>
105 #include <pwd.h>
106 #include <grp.h>
107 #include <stdio.h>
108 #include <sys/stat.h>
109
110
111 #ifndef MMDFONLY
112 #define NOTOK (-1)
113 #define OK 0
114 #endif /* not MMDFONLY */
115
116
117 #define MaxBBAka 100
118 #define MaxBBLdr 100
119 #define MaxBBDist 100
120
121
122 #define NCOLON 9 /* currently 10 fields per entry */
123
124 #define COLON ':'
125 #define COMMA ','
126 #define NEWLINE '\n'
127
128
129 #define ARCHIVE "archive"
130 #define CNTFILE ".cnt"
131 #define DSTFILE ".dist"
132 #define MAPFILE ".map"
133
134 /* \f */
135
136 static int BBuid = -1;
137
138 static unsigned int BBflags = SB_NULL;
139
140 static char BBName[BUFSIZ] = BBOARDS;
141 static char BBDir[BUFSIZ] = "";
142 static char BBData[BUFSIZ] = "";
143
144 static FILE *BBfile = NULL;
145
146
147 static struct bboard BB;
148 static struct bboard *bb = &BB;
149
150 static int BBload = 1;
151
152 static char BBFile[BUFSIZ];
153 static char BBArchive[BUFSIZ];
154 static char BBInfo[BUFSIZ];
155 static char BBMap[BUFSIZ];
156 static char *BBAkas[MaxBBAka];
157 static char *BBLeaders[MaxBBLdr];
158 static char *BBDists[MaxBBDist];
159 static char BBAddr[BUFSIZ];
160 static char BBRequest[BUFSIZ];
161 static char BBDate[BUFSIZ];
162 static char BBErrors[BUFSIZ];
163
164 #ifdef MMDFONLY
165 extern LLog *logptr;
166 #endif /* MMDFONLY */
167
168 static char *bbskip (), *getcpy ();
169
170 #if defined(__STDC__) && defined(SVR4)
171 #include <crypt.h>
172 #endif
173 #if defined(UNISTD) || defined(_AIX)
174 #include <unistd.h>
175 #else
176 #ifndef __STDC__
177 char *crypt (), *getpass ();
178 struct group *getgrnam ();
179 #ifdef SYS5
180 struct passwd *getpwnam (), *getpwuid ();
181 #endif
182 #endif /* !__STDC__ */
183 #endif /* _AIX */
184 static int setpwaux(), getbbitem(), bblose();
185 static void BBread();
186
187 #ifdef UCL
188 int called_bbc = 0;
189 char *bbs[101];
190 #endif
191 /* \f */
192
193 int setbbfile (file, f)
194 register char *file;
195 register int f;
196 {
197 if (BBuid == -1)
198 return setbbinfo (BBOARDS, file, f);
199
200 (void) strcpy (BBData, file);
201
202 BBflags = SB_NULL;
203 (void) endbbent ();
204
205 return setbbent (f);
206 }
207
208 /* \f */
209
210 int setbbinfo (user, file, f)
211 register char *user,
212 *file;
213 register int f;
214 {
215 register struct passwd *pw;
216
217 if ((pw = getpwnam (user)) == NULL) {
218 (void) sprintf (BBErrors, "unknown user: %s", user);
219 return 0;
220 }
221
222 return setpwinfo (pw, file, f);
223 }
224
225
226 int setpwinfo (pw, file, f)
227 register struct passwd *pw;
228 register char *file;
229 register int f;
230 {
231 if (!setpwaux (pw, file))
232 return 0;
233
234 BBflags = SB_NULL;
235 (void) endbbent ();
236
237 return setbbent (f);
238 }
239
240 /* \f */
241
242 static int setbbaux (name, file)
243 register char *name,
244 *file;
245 {
246 register struct passwd *pw;
247
248 if ((pw = getpwnam (name)) == NULL) {
249 (void) sprintf (BBErrors, "unknown user: %s", name);
250 return 0;
251 }
252
253 return setpwaux (pw, file);
254 }
255
256
257 static int setpwaux (pw, file)
258 register struct passwd *pw;
259 register char *file;
260 {
261 (void) strcpy (BBName, pw -> pw_name);
262 BBuid = pw -> pw_uid;
263 (void) strcpy (BBDir, pw -> pw_dir);
264 (void) sprintf (BBData, "%s/%s",
265 *file != '/' ? BBDir : "",
266 *file != '/' ? file : file + 1);
267
268 BBflags = SB_NULL;
269
270 return 1;
271 }
272
273 /* \f */
274
275 int setbbent (f)
276 register int f;
277 {
278 if (BBfile == NULL) {
279 if (BBuid == -1 && !setbbaux (BBOARDS, BBDB))
280 return 0;
281
282 if ((BBfile = fopen (BBData, "r")) == NULL) {
283 (void) sprintf (BBErrors, "unable to open: %s", BBData);
284 return 0;
285 }
286 }
287 else
288 rewind (BBfile);
289
290 BBflags |= f;
291 return (BBfile != NULL);
292 }
293
294
295 int endbbent () {
296 if (BBfile != NULL && !(BBflags & SB_STAY)) {
297 (void) fclose (BBfile);
298 BBfile = NULL;
299 }
300
301 return 1;
302 }
303
304
305 long getbbtime () {
306 struct stat st;
307
308 if (BBfile == NULL) {
309 if (BBuid == -1 && !setbbaux (BBOARDS, BBDB))
310 return 0;
311
312 if (stat (BBData, &st) == NOTOK) {
313 (void) sprintf (BBErrors, "unable to stat: %s", BBData);
314 return 0;
315 }
316 }
317 else
318 if (fstat (fileno (BBfile), &st) == NOTOK) {
319 (void) sprintf (BBErrors, "unable to fstat: %s", BBData);
320 return 0;
321 }
322
323 return ((long) st.st_mtime);
324 }
325
326 /* \f */
327
328 struct bboard *getbbent () {
329 register int count;
330 register char *p,
331 *q,
332 *r,
333 *d,
334 *f,
335 **s;
336 static char line[BUFSIZ];
337
338 if (BBfile == NULL && !setbbent (SB_NULL))
339 return NULL;
340
341 retry: ;
342 if ((p = fgets (line, sizeof line, BBfile)) == NULL)
343 return NULL;
344
345 for (q = p, count = 0; *q != 0 && *q != NEWLINE; q++)
346 if (*q == COLON)
347 count++;
348
349 if (count != NCOLON) {
350 #ifdef MMDFONLY
351 if (q = index (p, NEWLINE))
352 *q = 0;
353 ll_log (logptr, LLOGTMP, "bad entry in %s: %s", BBData, p);
354 #endif /* MMDFONLY */
355 goto retry;
356 }
357
358 bb -> bb_name = p;
359 p = q = bbskip (p, COLON);
360 p = bb -> bb_file = bbskip (p, COLON);
361 bb -> bb_archive = bb -> bb_info = bb -> bb_map = "";
362 p = bb -> bb_passwd = bbskip (p, COLON);
363 p = r = bbskip (p, COLON);
364 p = bb -> bb_addr = bbskip (p, COLON);
365 p = bb -> bb_request = bbskip (p, COLON);
366 p = bb -> bb_relay = bbskip (p, COLON);
367 p = d = bbskip (p, COLON);
368 p = f = bbskip (p, COLON);
369 (void) bbskip (p, NEWLINE);
370
371 s = bb -> bb_aka = BBAkas;
372 while (*q) {
373 *s++ = q;
374 q = bbskip (q, COMMA);
375 }
376 *s = 0;
377
378 s = bb -> bb_leader = BBLeaders;
379 if (*r == 0) {
380 if (!(BBflags & SB_FAST)) {
381 *s++ = BBName;
382 *s = 0;
383 }
384 }
385 else {
386 while (*r) {
387 *s++ = r;
388 r = bbskip (r, COMMA);
389 }
390 *s = 0;
391 }
392
393 s = bb -> bb_dist = BBDists;
394 while (*d) {
395 *s++ = d;
396 d = bbskip (d, COMMA);
397 }
398 *s = 0;
399
400 if (*f)
401 (void) sscanf (f, "%o", &bb -> bb_flags);
402 else
403 bb -> bb_flags = BB_NULL;
404 bb -> bb_count = bb -> bb_maxima = 0;
405 bb -> bb_date = NULL;
406 bb -> bb_next = bb -> bb_link = bb -> bb_chain = NULL;
407
408 #ifdef UCL
409 /*
410 * Only do a BBread on bboards that the user has expressed an
411 * interest in, if we were called by bbc.
412 */
413 if (BBload) {
414 register char **ap, *cp;
415 register int bbp;
416
417 if (called_bbc == 0)
418 BBread();
419 else {
420 for (bbp = 0; cp = bbs[bbp]; bbp++) {
421 if (!strcmp(bb->bb_name, cp)) {
422 BBread();
423 break;
424 }
425 for (ap = bb->bb_aka; *ap; ap++)
426 if (!strcmp(*ap, cp)) {
427 BBread();
428 break;
429 }
430 }
431 }
432 }
433 #else
434 if (BBload)
435 BBread ();
436 #endif
437
438 return bb;
439 }
440
441 /* \f */
442
443 struct bboard *getbbnam (name)
444 register char *name;
445 {
446 register struct bboard *b = NULL;
447
448 if (!setbbent (SB_NULL))
449 return NULL;
450 BBload = 0;
451 while ((b = getbbent ()) && strcmp (name, b -> bb_name))
452 continue;
453 BBload = 1;
454 (void) endbbent ();
455
456 if (b != NULL)
457 BBread ();
458
459 return b;
460 }
461
462
463 struct bboard *getbbaka (aka)
464 register char *aka;
465 {
466 register char **ap;
467 register struct bboard *b = NULL;
468
469 if (!setbbent (SB_NULL))
470 return NULL;
471 BBload = 0;
472 while ((b = getbbent ()) != NULL)
473 for (ap = b -> bb_aka; *ap; ap++)
474 if (strcmp (aka, *ap) == 0)
475 goto hit;
476 hit: ;
477 BBload = 1;
478 (void) endbbent ();
479
480 if (b != NULL)
481 BBread ();
482
483 return b;
484 }
485
486 /* \f */
487
488 static void BBread ()
489 {
490 register int i;
491 register char *cp,
492 *dp,
493 *p,
494 *r;
495 char prf[BUFSIZ];
496 static char line[BUFSIZ];
497 register FILE * info;
498
499 if (BBflags & SB_FAST)
500 return;
501
502 p = index (bb -> bb_request, '@@');
503 r = index (bb -> bb_addr, '@@');
504 BBRequest[0] = 0;
505
506 if (*bb -> bb_request == '-')
507 if (p == NULL && r && *r == '@@')
508 (void) sprintf (BBRequest, "%s%s%s",
509 bb -> bb_name, bb -> bb_request, r);
510 else
511 (void) sprintf (BBRequest, "%s%s",
512 bb -> bb_name, bb -> bb_request);
513 else
514 if (p == NULL && r && *r == '@@' && *bb -> bb_request)
515 (void) sprintf (BBRequest, "%s%s", bb -> bb_request, r);
516
517 if (BBRequest[0])
518 bb -> bb_request = BBRequest;
519 else
520 if (*bb -> bb_request == 0)
521 bb -> bb_request = *bb -> bb_addr ? bb -> bb_addr
522 : bb -> bb_leader[0];
523
524 if (*bb -> bb_addr == '@@') {
525 (void) sprintf (BBAddr, "%s%s", bb -> bb_name, bb -> bb_addr);
526 bb -> bb_addr = BBAddr;
527 }
528 else
529 if (*bb -> bb_addr == 0)
530 bb -> bb_addr = bb -> bb_name;
531
532 if (*bb -> bb_file == 0)
533 return;
534 if (*bb -> bb_file != '/') {
535 (void) sprintf (BBFile, "%s/%s", BBDir, bb -> bb_file);
536 bb -> bb_file = BBFile;
537 }
538
539 if ((cp = rindex (bb -> bb_file, '/')) == NULL || *++cp == 0)
540 (void) strcpy (prf, ""), cp = bb -> bb_file;
541 else
542 (void) sprintf (prf, "%.*s", cp - bb -> bb_file, bb -> bb_file);
543 if ((dp = index (cp, '.')) == NULL)
544 dp = cp + strlen (cp);
545
546 (void) sprintf (BBArchive, "%s%s/%s", prf, ARCHIVE, cp);
547 bb -> bb_archive = BBArchive;
548 (void) sprintf (BBInfo, "%s.%.*s%s", prf, dp - cp, cp, CNTFILE);
549 bb -> bb_info = BBInfo;
550 (void) sprintf (BBMap, "%s.%.*s%s", prf, dp - cp, cp, MAPFILE);
551 bb -> bb_map = BBMap;
552
553 if ((info = fopen (bb -> bb_info, "r")) == NULL)
554 return;
555
556 if (fgets (line, sizeof line, info) && (i = atoi (line)) > 0)
557 bb -> bb_maxima = (unsigned) i;
558 if (!feof (info) && fgets (line, sizeof line, info)) {
559 (void) strcpy (BBDate, line);
560 if (cp = index (BBDate, NEWLINE))
561 *cp = 0;
562 bb -> bb_date = BBDate;
563 }
564
565 (void) fclose (info);
566 }
567
568 /* \f */
569
570 int ldrbb (b)
571 register struct bboard *b;
572 {
573 register char *p,
574 **q,
575 **r;
576 static int uid = 0,
577 gid = 0;
578 static char username[10] = "";
579 register struct passwd *pw;
580 register struct group *gr;
581
582 if (b == NULL)
583 return 0;
584 if (BBuid == -1 && !setbbaux (BBOARDS, BBDB))
585 return 0;
586
587 if (username[0] == 0) {
588 if ((pw = getpwuid (uid = getuid ())) == NULL)
589 return 0;
590 gid = getgid ();
591 (void) strcpy (username, pw -> pw_name);
592 }
593
594 if (uid == BBuid)
595 return 1;
596
597 q = b -> bb_leader;
598 while (p = *q++)
599 if (*p == '=') {
600 if ((gr = getgrnam (++p)) == NULL)
601 continue;
602 if (gid == gr -> gr_gid)
603 return 1;
604 r = gr -> gr_mem;
605 while (p = *r++)
606 if (strcmp (username, p) == 0)
607 return 1;
608 }
609 else
610 if (strcmp (username, p) == 0)
611 return 1;
612
613 return 0;
614 }
615
616 /* \f */
617
618 int ldrchk (b)
619 register struct bboard *b;
620 {
621 if (b == NULL)
622 return 0;
623
624 if (*b -> bb_passwd == 0)
625 return 1;
626
627 if (strcmp (b -> bb_passwd,
628 crypt (getpass ("Password: "), b -> bb_passwd)) == 0)
629 return 1;
630
631 fprintf (stderr, "Sorry\n");
632 return 0;
633 }
634
635 /* \f */
636
637 struct bboard *getbbcpy (bp)
638 register struct bboard *bp;
639 {
640 register char **p,
641 **q;
642 register struct bboard *b;
643
644 if (bp == NULL)
645 return NULL;
646
647 b = (struct bboard *) malloc ((unsigned) sizeof *b);
648 if (b == NULL)
649 return NULL;
650
651 b -> bb_name = getcpy (bp -> bb_name);
652 b -> bb_file = getcpy (bp -> bb_file);
653 b -> bb_archive = getcpy (bp -> bb_archive);
654 b -> bb_info = getcpy (bp -> bb_info);
655 b -> bb_map = getcpy (bp -> bb_map);
656 b -> bb_passwd = getcpy (bp -> bb_passwd);
657 b -> bb_flags = bp -> bb_flags;
658 b -> bb_count = bp -> bb_count;
659 b -> bb_maxima = bp -> bb_maxima;
660 b -> bb_date = getcpy (bp -> bb_date);
661 b -> bb_addr = getcpy (bp -> bb_addr);
662 b -> bb_request = getcpy (bp -> bb_request);
663 b -> bb_relay = getcpy (bp -> bb_relay);
664
665 for (p = bp -> bb_aka; *p; p++)
666 continue;
667 b -> bb_aka =
668 q = (char **) calloc ((unsigned) (p - bp -> bb_aka + 1), sizeof *q);
669 if (q == NULL)
670 return NULL;
671 for (p = bp -> bb_aka; *p; *q++ = getcpy (*p++))
672 continue;
673 *q = NULL;
674
675 for (p = bp -> bb_leader; *p; p++)
676 continue;
677 b -> bb_leader =
678 q = (char **) calloc ((unsigned) (p - bp -> bb_leader + 1), sizeof *q);
679 if (q == NULL)
680 return NULL;
681 for (p = bp -> bb_leader; *p; *q++ = getcpy (*p++))
682 continue;
683 *q = NULL;
684
685 for (p = bp -> bb_dist; *p; p++)
686 continue;
687 b -> bb_dist =
688 q = (char **) calloc ((unsigned) (p - bp -> bb_dist + 1), sizeof *q);
689 if (q == NULL)
690 return NULL;
691 for (p = bp -> bb_dist; *p; *q++ = getcpy (*p++))
692 continue;
693 *q = NULL;
694
695 b -> bb_next = bp -> bb_next;
696 b -> bb_link = bp -> bb_link;
697 b -> bb_chain = bp -> bb_chain;
698
699 return b;
700 }
701
702 /* \f */
703
704 int getbbdist (bb, action)
705 register struct bboard *bb;
706 register int (*action) ();
707 {
708 register int result;
709 register char **dp;
710
711 BBErrors[0] = 0;
712 for (dp = bb -> bb_dist; *dp; dp++)
713 if (result = getbbitem (bb, *dp, action))
714 return result;
715
716 return result;
717 }
718
719 char *getbberr () {
720 return (BBErrors[0] ? BBErrors : NULL);
721 }
722
723 /* \f */
724
725 static int getbbitem (bb, item, action)
726 register struct bboard *bb;
727 register char *item;
728 register int (*action) ();
729 {
730 register int result;
731 register char *cp,
732 *dp,
733 *hp,
734 *np;
735 char mbox[BUFSIZ],
736 buffer[BUFSIZ],
737 file[BUFSIZ],
738 host[BUFSIZ],
739 prf[BUFSIZ];
740 register FILE *fp;
741
742 switch (*item) {
743 case '*':
744 switch (*++item) {
745 case '/':
746 hp = item;
747 break;
748
749 case 0:
750 if ((cp = rindex (bb -> bb_file, '/')) == NULL || *++cp == 0)
751 (void) strcpy (prf, ""), cp = bb -> bb_file;
752 else
753 (void) sprintf (prf, "%.*s", cp - bb -> bb_file, bb -> bb_file);
754 if ((dp = index (cp, '.')) == NULL)
755 dp = cp + strlen (cp);
756 (void) sprintf (file, "%s.%.*s%s", prf, dp - cp, cp, DSTFILE);
757 hp = file;
758 break;
759
760 default:
761 (void) sprintf (file, "%s/%s", BBDir, item);
762 hp = file;
763 break;
764 }
765
766 if ((fp = fopen (hp, "r")) == NULL)
767 return bblose ("unable to read file %s", hp);
768 while (fgets (buffer, sizeof buffer, fp)) {
769 if (np = index (buffer, '\n'))
770 *np = 0;
771 if (result = getbbitem (bb, buffer, action)) {
772 (void) fclose (fp);
773 (void) bblose ("error with file %s, item %s", hp, buffer);
774 return result;
775 }
776 }
777 (void) fclose (fp);
778 return OK;
779
780 default:
781 if (hp = rindex (item, '@@')) {
782 *hp++ = 0;
783 (void) strcpy (mbox, item);
784 (void) strcpy (host, hp);
785 *--hp = '@@';
786 }
787 else {
788 (void) sprintf (mbox, "%s%s", DISTADR, bb -> bb_name);
789 (void) strcpy (host, item);
790 }
791 if (result = (*action) (mbox, host))
792 (void) bblose ("action (%s, %s) returned 0%o", mbox, host, result);
793 return result;
794 }
795 }
796
797 /* \f */
798
799 /* VARARGS1 */
800
801 static int bblose (fmt, a, b, c)
802 char *fmt,
803 *a,
804 *b,
805 *c;
806 {
807 if (BBErrors[0] == 0)
808 (void) sprintf (BBErrors, fmt, a, b, c);
809
810 return NOTOK;
811 }
812
813 /* \f */
814
815 void make_lower (s1, s2)
816 register char *s1,
817 *s2;
818 {
819 if (s1 == NULL || s2 == NULL)
820 return;
821
822 for (; *s2; s2++)
823 *s1++ = isupper (*s2) ? tolower (*s2) : *s2;
824 *s1 = 0;
825 }
826
827 /* \f */
828
829 static char *bbskip (p, c)
830 register char *p,
831 c;
832 {
833 if (p == NULL)
834 return NULL;
835
836 while (*p && *p != c)
837 p++;
838 if (*p)
839 *p++ = 0;
840
841 return p;
842 }
843
844
845 static char *getcpy (s)
846 register char *s;
847 {
848 register char *p;
849
850 if (s == NULL)
851 return NULL;
852
853 if (p = malloc ((unsigned) (strlen (s) + 1)))
854 (void) strcpy (p, s);
855 return p;
856 }
857 @
858
859
860 1.13
861 log
862 @int/void fixup
863 @
864 text
865 @d3 2
866 a4 2
867 static char ident[] = "@@(#)$Id: getbbent.c,v 1.12 1992/12/10 23:57:12 jromine Exp jromine $";
868 #endif lint
869 d12 1
870 a12 1
871 #else MMDFONLY
872 d16 1
873 a16 1
874 #endif MMDFONLY
875 d27 1
876 a27 1
877 #endif not MMDFONLY
878 d79 1
879 a79 1
880 #endif MMDFONLY
881 d267 1
882 a267 1
883 #endif MMDFONLY
884 @
885
886
887 1.12
888 log
889 @add #include <crypt.h>
890 @
891 text
892 @d3 1
893 a3 1
894 static char ident[] = "@@(#)$Id: getbbent.c,v 1.11 1992/11/24 18:45:37 jromine Exp jromine $";
895 d97 2
896 a98 1
897 static int setpwaux(), BBread(), getbbitem(), bblose();
898 d401 2
899 a402 1
900 static int BBread () {
901 @
902
903
904 1.11
905 log
906 @fix ifdef
907 @
908 text
909 @d3 1
910 a3 1
911 static char ident[] = "@@(#)$Id: getbbent.c,v 1.10 1992/05/19 21:14:18 jromine Exp jromine $";
912 d83 3
913 @
914
915
916 1.10
917 log
918 @AIX
919 @
920 text
921 @d3 1
922 a3 1
923 static char ident[] = "@@(#)$Id: getbbent.c,v 1.9 1992/02/03 17:58:04 jromine Exp jromine $";
924 d83 1
925 a83 1
926 #ifdef _AIX
927 d85 1
928 a85 1
929 #else /* _AIX */
930 @
931
932
933 1.9
934 log
935 @STDC/SYS5/getpw
936 @
937 text
938 @d3 1
939 a3 1
940 static char ident[] = "@@(#)$Id: getbbent.c,v 1.8 1992/02/03 16:37:17 jromine Exp jromine $";
941 d83 3
942 d93 1
943 @
944
945
946 1.8
947 log
948 @fix
949 @
950 text
951 @d3 1
952 a3 1
953 static char ident[] = "@@(#)$Id: getbbent.c,v 1.7 1992/01/31 22:30:56 jromine Exp jromine $";
954 d86 1
955 d88 1
956 @
957
958
959 1.7
960 log
961 @kerberos
962 @
963 text
964 @d3 1
965 a3 1
966 static char ident[] = "@@(#)$Id: getbbent.c,v 1.6 1992/01/31 22:30:44 jromine Exp jromine $";
967 d83 1
968 d87 1
969 @
970
971
972 1.6
973 log
974 @typo
975 @
976 text
977 @d3 1
978 a3 1
979 static char ident[] = "@@(#)$Id: getbbent.c,v 1.5 1990/04/09 10:11:57 sources Exp jromine $";
980 d246 1
981 a246 1
982 for (q = p, count = 0; *q != NULL && *q != NEWLINE; q++)
983 d253 1
984 a253 1
985 *q = NULL;
986 d277 1
987 a277 1
988 *s = NULL;
989 d280 1
990 a280 1
991 if (*r == NULL) {
992 d283 1
993 a283 1
994 *s = NULL;
995 d291 1
996 a291 1
997 *s = NULL;
998 d299 1
999 a299 1
1000 *s = NULL;
1001 d404 1
1002 a404 1
1003 BBRequest[0] = NULL;
1004 d420 1
1005 a420 1
1006 if (*bb -> bb_request == NULL)
1007 d429 1
1008 a429 1
1009 if (*bb -> bb_addr == NULL)
1010 d432 1
1011 a432 1
1012 if (*bb -> bb_file == NULL)
1013 d439 1
1014 a439 1
1015 if ((cp = rindex (bb -> bb_file, '/')) == NULL || *++cp == NULL)
1016 d461 1
1017 a461 1
1018 *cp = NULL;
1019 d487 1
1020 a487 1
1021 if (username[0] == NULL) {
1022 d524 1
1023 a524 1
1024 if (*b -> bb_passwd == NULL)
1025 d611 1
1026 a611 1
1027 BBErrors[0] = NULL;
1028 d649 2
1029 a650 2
1030 case NULL:
1031 if ((cp = rindex (bb -> bb_file, '/')) == NULL || *++cp == NULL)
1032 d670 1
1033 a670 1
1034 *np = NULL;
1035 d682 1
1036 a682 1
1037 *hp++ = NULL;
1038 d707 1
1039 a707 1
1040 if (BBErrors[0] == NULL)
1041 d724 1
1042 a724 1
1043 *s1 = NULL;
1044 d739 1
1045 a739 1
1046 *p++ = NULL;
1047 @
1048
1049
1050 1.5
1051 log
1052 @nil pointer fix
1053 @
1054 text
1055 @d3 1
1056 a3 1
1057 static char ident[] = "@@(#)$Id: getbbent.c,v 1.4 90/04/05 15:04:11 sources Exp Locker: sources $";
1058 d621 1
1059 a621 1
1060 };
1061 @
1062
1063
1064 1.4
1065 log
1066 @add ID
1067 @
1068 text
1069 @d3 1
1070 a3 1
1071 static char ident[] = "@@(#)$Id:$";
1072 d281 1
1073 a281 1
1074 if (!(BBflags & SB_FAST))
1075 d283 2
1076 d286 1
1077 a286 1
1078 else
1079 d291 2
1080 a292 1
1081 *s = NULL;
1082 @
1083
1084
1085 1.3
1086 log
1087 @UCL ifdefs
1088 @
1089 text
1090 @d2 3
1091 @
1092
1093
1094 1.2
1095 log
1096 @ANSI Compilance
1097 @
1098 text
1099 @d85 4
1100 d303 26
1101 d331 1
1102 @
1103
1104
1105 1.1
1106 log
1107 @Initial revision
1108 @
1109 text
1110 @d78 1
1111 a78 1
1112 char *bbskip (), *getcpy ();
1113 d83 1
1114 @