Added all of the MH sources, including RCS files, in
[mmh] / docs / historical / mh-6.8.5 / support / bboards / mmdfII / bboards / RCS / bb_wtmail.c,v
1 head    1.3;
2 access;
3 symbols;
4 locks; strict;
5 comment @ * @;
6
7
8 1.3
9 date    93.08.25.17.43.26;      author jromine; state Exp;
10 branches;
11 next    1.2;
12
13 1.2
14 date    93.08.25.17.22.29;      author jromine; state Exp;
15 branches;
16 next    1.1;
17
18 1.1
19 date    93.08.25.17.22.22;      author jromine; state Exp;
20 branches;
21 next    ;
22
23
24 desc
25 @@
26
27
28 1.3
29 log
30 @add id
31 @
32 text
33 @#ifndef        POP
34 /* bb_wtmail.c - write mail to a BBoard */
35 #else   POP
36 /* po_wtmail.c - write mail for a POP subscriber */
37 #endif  POP
38 #ifndef lint
39 static char Id[] = "@@(#)$Id:$";
40 #endif
41
42
43 #include "util.h"
44 #include "mmdf.h"
45 #include "bboards.h"
46 #include "cnvtdate.h"
47 #include "ch.h"
48 #include "phs.h"
49 #include <pwd.h>
50 #include <sys/stat.h>
51
52 /* \f */
53
54 #ifndef RP_DOK
55 #define submitopts      "vmth%s*"
56 #else   RP_DOK
57 #define submitopts      "vkmth%s*"
58 #endif  RP_DOK
59
60 #ifndef POP
61 #define RP_NOPE RP_AOK
62
63 #define MBXMODE BBMODE
64 #else   POP
65 #define RP_NOPE RP_USER
66
67 #define MBXMODE sentprotect
68
69 extern int   sentprotect;
70 #endif  POP
71
72
73 int     err_fd = NOTOK;
74
75 int     ds_address ();
76
77 extern int  errno;
78
79 int    bbrduid, bbrdgid;
80
81 char   *chnlname,
82         chnlinfo[LINESIZE];
83 #ifndef POP
84 char    bbrdaddr[LINESIZE],
85         bbrdfrom[LINESIZE],
86         bbrdheader[LINESIZE],
87         bbrdhome[LINESIZE],
88         bbrdtime[LINESIZE];
89 #endif  not POP
90
91 extern char *qu_msgfile,
92             *delim1,
93             *delim2,
94             *lckdfldir,
95             *locdomain,
96             *locmachine,
97             *locname,
98             *sitesignature,
99             *supportaddr;
100
101 struct bboard  *curbb;
102
103 extern LLog *logptr;
104
105 FILE *lk_fopen();
106
107 off_t    lseek ();
108 char   *index (), *rindex (), *sprintf ();
109 struct passwd  *getpwnam ();
110
111 /* \f */
112
113 bb_init (chanptr)
114 Chan * chanptr;
115 {
116     int     uid,
117             eid;
118     struct passwd *pw;
119
120 #ifdef DEBUG
121     ll_log (logptr, LLOGBTR, "bb_init(chanptr=%s)", chanptr -> ch_name);
122 #endif
123
124     chnlname = chanptr -> ch_name;
125 #ifndef notdef
126     sprintf (chnlinfo, submitopts, chnlname);
127 #else   notdef                  /* the following is probably a BAD idea */
128     if (chanptr -> ch_host == NULL)
129         chnlinfo[0] = NULL;     /* local delivery ONLY */
130     else
131         sprintf (chnlinfo, submitopts, chanptr -> ch_host);
132 #endif  notdef
133
134 #ifndef POP
135     if ((pw = getpwnam (BBOARDS)) == NULL)
136         err_abrt (RP_BHST, "no passwd entry for '%s'", BBOARDS);
137 #else   POP
138     if ((pw = getpwnam (POPUID)) == NULL)
139         err_abrt (RP_BHST, "no passwd entry for '%s'", POPUID);
140 #endif  POP
141
142     bbrduid = pw -> pw_uid;
143     bbrdgid = pw -> pw_gid;
144 #ifndef POP
145     if (isstr (locmachine))
146         sprintf (bbrdfrom, "%s@@%s.%s.%s", pw -> pw_name, locmachine, locname,
147                 locdomain);
148     else
149         sprintf (bbrdfrom, "%s@@%s.%s", pw -> pw_name, locname, locdomain);
150 #ifdef DEBUG
151     ll_log (logptr, LLOGGEN, "distributing as '%s'", bbrdfrom);
152 #endif
153     sprintf (bbrdhome, pw -> pw_dir);
154 #endif  not POP
155
156 #ifndef POP
157     if (!setbbent ())
158         err_abrt (RP_BHST, "setbbent() failed");
159 #else   POP
160     if (!setpwinfo (pw, POPDB, 1))
161         err_abrt (RP_BHST, "setbbinfo(%s, %s, 1) failed",
162                 pw -> pw_name, POPDB);
163 #endif  POP
164
165     getwho (&uid, &eid);
166     if (eid != 0)
167         err_abrt (RP_BHST, "not running as root");
168
169     return RP_OK;
170 }
171
172
173 bb_end (result)
174 short   result;
175 {
176 #ifdef DEBUG
177     ll_log (logptr, LLOGBTR, "bb_end(result=0%o)", result);
178 #endif
179
180     return RP_OK;
181 }
182
183 /* \f */
184
185 bb_sbinit () {
186 #ifdef DEBUG
187     ll_log (logptr, LLOGBTR, "bb_sbinit()");
188 #endif
189
190     return RP_OK;
191 }
192
193
194 bb_sbend () {
195 #ifdef DEBUG
196     ll_log (logptr, LLOGBTR, "bb_sbend()");
197 #endif
198
199     return RP_OK;
200 }
201
202 /* \f */
203
204 bb_winit (info, sender)
205 char   *info,
206        *sender;
207 {
208 #ifdef DEBUG
209     ll_log (logptr, LLOGBTR, "bb_winit(info='%s',sender='%s')",
210             info, sender);
211 #endif
212
213     return RP_OK;
214 }
215
216 /* \f */
217
218 bb_wtadr (host, adr)
219 char   *host,
220        *adr;
221 {
222     short   count,
223             result;
224     int     len,
225             md,
226             offset,
227             size;
228     long    start,
229             stop,
230             pos;
231     char   *cp,
232             buffer[BUFSIZ];
233
234 #ifdef DEBUG
235     ll_log (logptr, LLOGBTR, "bb_wtadr(host=%s,adr=%s)", host, adr);
236 #endif
237
238     if ((cp = index (adr, '@@')) != NULL)
239         *cp = NULL;
240     make_lower (adr, adr);
241     if ((curbb = getbbnam (adr)) == NULL)
242         return RP_USER;
243 #ifndef POP
244     if (isstr (locmachine))
245         sprintf (bbrdaddr, "local-%s-request@@%s.%s.%s", curbb -> bb_name,
246                 locmachine, locname, locdomain);
247     else
248         sprintf (bbrdaddr, "local-%s-request@@%s.%s", curbb -> bb_name, locname,
249                 locdomain);
250 #endif  not POP
251 #ifdef DEBUG
252     ll_log (logptr, LLOGGEN, "=> BBoard %s: file='%s' info='%s'",
253             curbb -> bb_name, curbb -> bb_file, curbb -> bb_info);
254 #endif
255
256     if (curbb -> bb_file == NULL || *curbb -> bb_file == NULL)
257         return RP_NOPE;
258 #ifdef DEBUG
259     ll_log (logptr, LLOGGEN, "begin local delivery...");
260 #endif
261     printx ("\r\nperforming local delivery to file %s...\n",
262             curbb -> bb_file);
263
264     qu_rtinit (0L);
265
266     if ((md = mbx_open (curbb -> bb_file, bbrduid, bbrdgid, MBXMODE)) == NOTOK)
267         return RP_FIO;
268
269 #ifndef POP
270     if (rp_isbad (result = mbx_init ())) {
271         mbx_close (curbb -> bb_file, md);
272         return result;
273     }
274 #endif  not POP
275
276     pos = (long) lseek (md, (off_t)0, 1);
277     count = strlen (delim1);
278     if (write (md, delim1, count) != count) {
279         ll_log (logptr, LLOGTMP, "error writing delim1");
280         result = NOTOK;
281         goto clean_up;
282     }
283     start = (long) lseek (md, (off_t)0, 1);
284     size = 0;
285
286 #ifndef POP
287     count = strlen (bbrdheader);
288     if (write (md, bbrdheader, count) != count) {
289         ll_log (logptr, LLOGTMP, "error writing BBoard information");
290         result = NOTOK;
291         goto clean_up;
292     }
293     for (cp = bbrdheader; *cp; cp++, size++)
294         if (*cp == '\n')
295             size++;
296 #endif  not POP
297
298     for (len = BUFSIZ;
299             rp_gval (result = qu_rtxt (buffer, &len)) == RP_OK;
300             len = BUFSIZ) {
301         for (offset = 0;
302                 (offset = strindex (delim1, buffer)) >= 0;
303                 buffer[offset]++)
304             continue;
305         for (offset = 0;
306                 (offset = strindex (delim2, buffer)) >= 0;
307                 buffer[offset]++)
308             continue;
309         if (write (md, buffer, len) != len) {
310             ll_log (logptr, LLOGTMP, "error writing to file '%s'",
311                     curbb -> bb_file);
312             result = NOTOK;
313             goto clean_up;
314         }
315         for (offset = 0, cp = buffer; offset < len; offset++, size++)
316             if (*cp++ == '\n')
317                 size++;
318     }
319
320     if (result < 0)
321         ll_log (logptr, LLOGTMP, "error reading from message file '%s'",
322                 qu_msgfile);
323 clean_up: ;
324
325     stop = (long) lseek (md, (off_t)0, 1);
326     count = strlen (delim2);
327     if (write (md, delim2, count) != count)
328         ll_log (logptr, LLOGTMP, "error writing delim2");
329     map_write (curbb -> bb_file, md, curbb -> bb_maxima, start, stop, pos,
330         size, 0);
331 #ifdef DEBUG
332     ll_log (logptr, LLOGGEN, "end local delivery...");
333 #endif
334
335     if (result < 0)
336         mbx_close (curbb -> bb_file, md);
337     else
338         result = mbx_close (curbb -> bb_file, md);
339
340     return (result != NOTOK ? RP_OK : RP_FIO);
341 }
342
343 /* \f */
344
345 bb_txtcpy () {
346 #ifndef POP
347     short   result;
348
349 #ifdef  DEBUG
350     ll_log (logptr, LLOGBTR, "bb_txtcpy()");
351 #endif
352
353     if (curbb -> bb_dist == NULL
354             || *curbb -> bb_dist == NULL
355             || chnlinfo[0] == NULL)
356         return RP_MOK;
357 #ifdef DEBUG
358     ll_log (logptr, LLOGGEN, "begin distribution...");
359 #endif
360     if (curbb -> bb_file == NULL || *curbb -> bb_file == NULL)
361         printx ("\r\n");
362     printx("\rperforming remote distribution\n");
363
364     if (rp_isbad (result = dist_init ())
365             || rp_isbad (result = dist_adrs ())
366             || rp_isbad (result = dist_text ())
367             || rp_isbad (result = dist_end ()))
368         return dist_lose (result);
369 #ifdef DEBUG
370     ll_log (logptr, LLOGGEN, "end distribution...");
371 #endif
372
373     if (err_fd != NOTOK)
374         dist_lose (RP_MOK);
375     else
376         printx ("\rmessage distributed\n");
377 #endif  not POP
378
379     return RP_MOK;
380 }
381
382 /* \f */
383
384 #ifndef POP
385 /* **************** (dist_)  BBOARD DISTRIBUTION **************** */
386
387 dist_init () {
388     short   result;
389 #ifdef  RP_NS
390     int     len;
391     struct rp_bufstruct reply;
392 #endif  RP_NS
393
394 #ifdef DEBUG
395     ll_log (logptr, LLOGBTR, "dist_init()");
396 #endif
397
398     if (rp_isbad (result = mm_init ()))
399         return ds_log (result, LLOGFAT, "mm_init() failed [%s]",
400                 rp_valstr (result));
401     if (rp_isbad (result = mm_sbinit ()))
402         return ds_log (result, LLOGFAT, "mm_sbinit() failed [%s]",
403                 rp_valstr (result));
404     if (rp_isbad (result = mm_winit (chnlname, chnlinfo, bbrdaddr)))
405         return ds_log (result, LLOGFAT,
406                 "mm_winit('%s','%s','%s') failed [%s]",
407                 chnlname, chnlinfo, bbrdaddr, rp_valstr (result));
408 #ifdef  RP_NS
409         if (rp_isbad (result = mm_rrply (&reply, &len)))
410             return ds_log (result, LLOGFAT, "problem with sender address [%s]",
411                     rp_valstr (result));
412 #endif  RP_NS
413
414     return result;
415 }
416
417 /* \f */
418
419 dist_adrs ()
420 {
421     short   result;
422
423 #ifdef DEBUG
424     ll_log (logptr, LLOGBTR, "dist_adrs()");
425 #endif
426
427     if (getbbdist (curbb, ds_address))
428         return ds_log (RP_NO, LLOGTMP, "getbbdist failed: %s", getbberr ());
429
430     if (rp_isbad (result = mm_waend ()))
431         return ds_log (result, LLOGFAT, "mm_waend() failed [%s]",
432                 rp_valstr (result));
433
434     return result;
435 }
436
437 /* \f */
438
439 ds_address (addr, host)
440 char *addr,                     /* local part */
441      *host;                     /* rest */
442 {
443     short   result;
444     int     len;
445     struct rp_bufstruct reply;
446
447 #ifdef DEBUG
448     ll_log (logptr, LLOGBTR, "ds_address(addr='%s',host='%s')", addr, host);
449 #endif
450
451     printx ("\rperforming distribution to %s@@%s...\n", addr, host);
452     if (rp_isbad (result = mm_wadr (host, addr))) {
453         ds_log (result, LLOGFAT, "mm_wadr('%s','%s') failed [%s]",
454                 host, addr, rp_valstr (result));
455         return NOTOK;
456     }
457     if (rp_isbad (result = mm_rrply (&reply, &len))) {
458         ds_log (result, LLOGFAT,
459                 "mm_rrply() failed [%s] getting status of '%s@@%s'",
460                 rp_valstr (result), addr, host);
461         return NOTOK;
462     }
463
464     switch (rp_gval (reply.rp_val)) {
465         case RP_AOK:
466 #ifdef  RP_DOK
467         case RP_DOK:
468 #endif  RP_DOK
469 #ifdef DEBUG
470             ll_log (logptr, LLOGGEN, "address '%s@@%s' [%s] -- %s",
471                     addr, host, rp_valstr (reply.rp_val), reply.rp_line);
472 #endif
473             return OK;
474
475         case RP_NO:
476 #ifdef  RP_NS
477         case RP_NS:
478 #endif  RP_NS
479         case RP_USER:
480         case RP_NDEL:
481         case RP_AGN:
482         case RP_NOOP:
483             ds_log (reply.rp_val, LLOGTMP, "address '%s@@%s' [%s] -- %s",
484                     addr, host, rp_valstr (reply.rp_val), reply.rp_line);
485             return OK;          /* fail-soft */
486
487         default:
488             ds_log (reply.rp_val, LLOGFAT, "unexpected reply [%s] -- %s",
489                     rp_valstr (reply.rp_val), reply.rp_line);
490             return NOTOK;
491     }
492 }
493
494 /* \f */
495
496 dist_text ()
497 {
498     short   result;
499     int     len;
500     char    buffer[BUFSIZ];
501
502 #ifdef DEBUG
503     ll_log (logptr, LLOGBTR, "dist_text()");
504 #endif
505
506     qu_rtinit (0L);
507     for (len = BUFSIZ;
508             rp_gval (result = qu_rtxt (buffer, &len)) == RP_OK;
509             len = BUFSIZ)
510         if (rp_isbad (result = mm_wtxt (buffer, len)))
511             return ds_log (result, LLOGFAT, "mm_wtxt() failed [%s]",
512                     rp_valstr (result));
513
514     if (result < 0)
515         return ds_log (RP_FIO, LLOGTMP,
516                 "error reading from message file '%s'", qu_msgfile);
517
518     if (rp_isbad (result = mm_wtend ()))
519         return ds_log (result, LLOGFAT, "mm_wtend() failed [%s]",
520                 rp_valstr (result));
521
522     return result;
523 }
524
525 /* \f */
526
527 dist_end ()
528 {
529     short   result;
530     int     len;
531     struct rp_bufstruct reply;
532
533 #ifdef DEBUG
534     ll_log (logptr, LLOGBTR, "dist_end()");
535 #endif
536
537     if (rp_isbad (result = mm_rrply (&reply, &len)))
538         return ds_log (result, LLOGFAT,
539                 "mm_rrply() failed [%s] getting final status",
540                 rp_valstr (result));
541
542     switch (rp_gval (reply.rp_val)) {
543         case RP_OK:
544         case RP_MOK:
545 #ifdef DEBUG
546             ll_log (logptr, LLOGGEN, "message [%s] -- %s",
547                     rp_valstr (reply.rp_val), reply.rp_line);
548 #endif
549             mm_sbend ();
550             mm_end (OK);
551             return result;
552
553         case RP_NO:
554         case RP_NDEL:
555         case RP_AGN:
556         case RP_NOOP:
557             return ds_log (RP_NO, LLOGTMP, "not delivered [%s] -- %s",
558                     rp_valstr (reply.rp_val), reply.rp_line);
559
560         default:
561             return ds_log (RP_RPLY, LLOGFAT,
562                     "unexpected final reply [%s] -- %s",
563                     rp_valstr (reply.rp_val), reply.rp_line);
564     }
565 }
566
567 /* \f */
568
569 dist_lose (result)
570 short   result;
571 {
572     int     i;
573     char   *cp,
574             intro[BUFSIZ],
575             buffer[BUFSIZ];
576
577 #ifdef  DEBUG
578     ll_log (logptr, LLOGBTR, "dist_lose(result=0%o)", result);
579 #endif  DEBUG
580
581     mm_end (NOTOK);
582
583     printx ("\rerrors during distribution: ");
584     if (domsg)
585         (void) fflush (stdout);
586     (void) sprintf (intro, "bboards%d distribution for %s failed [%s]\n",
587             getpid (), curbb -> bb_name, rp_valstr (result));
588     if (loseaux (bbrdaddr, bbrdfrom, intro) != OK
589             && loseaux (bbrdfrom, (char *) 0, intro) != OK) {
590         printx ("unable to post advisory.\n");
591         ll_log (logptr, LLOGFAT, "unable to post failure notice");
592         if (err_fd != NOTOK) {
593             (void) lseek (err_fd, (off_t)0, 0);
594             if ((i = read (err_fd, buffer, sizeof buffer)) > 0) {
595                 buffer[i] = NULL;
596                 if (cp = index (buffer, '\n'))
597                     *cp = NULL;
598                 ll_log (logptr, LLOGFAT, "info: %s", buffer);
599             }
600         }
601         if (loseaux (supportaddr, (char *) 0, intro) != NOTOK)
602             ll_log (logptr, LLOGFAT, "unable to advise %s of failure!",
603                     supportaddr);
604     }
605     else
606         printx ("advisory posted.\n");
607     if (domsg)
608         (void) fflush (stdout);
609
610     if (err_fd != NOTOK) {
611         close (err_fd);
612         err_fd = NOTOK;
613     }
614     return RP_MOK;
615 }
616
617 /* \f */
618
619 int     loseaux (to, cc, intro)
620 char   *to,
621        *cc,
622        *intro;
623 {
624     int     i;
625     char    buffer[BUFSIZ];
626
627     if (ml_init (NO, NO, sitesignature, "Re-distribution Failure") != OK
628             || ml_adr (to) != OK)
629         return NOTOK;
630     if (cc && (ml_cc () != OK || ml_adr (cc) != OK))
631         return NOTOK;
632     if (ml_aend () != OK || ml_tinit () != OK)
633         return NOTOK;
634
635     ml_txt (intro);
636     if (err_fd != NOTOK) {
637         lseek (err_fd, (off_t)0, 0);
638         while ((i = read (err_fd, buffer, sizeof buffer)) > 0) {
639             buffer[i] = NULL;
640             ml_txt (buffer);
641         }
642     }
643     encap ();
644
645     return ml_end (OK);
646 }
647
648 /* \f */
649
650 /* very similar to sbr/cpydgst.c */
651
652 #define S1      0
653 #define S2      1
654
655 #define output(c)       if (bp >= dp) {flush (); *bp++ = c;} else *bp++ = c
656 #define flush()         if (bp - outbuf) \
657                             *bp = NULL, ml_txt (outbuf), bp = outbuf
658
659 static  encap () {
660     register int    state;
661     short   result;
662     int     len,
663             init;
664     register char  *cp,
665                    *ep;
666     char    buffer[BUFSIZ];
667     register char  *bp,
668                    *dp;
669     char    outbuf[BUFSIZ];
670
671     qu_rtinit (0L);
672
673     dp = (bp = outbuf) + sizeof outbuf;
674     init = 0;
675     for (state = S1, len = BUFSIZ;
676             rp_gval (result = qu_rtxt (buffer, &len)) == RP_OK;
677             len = BUFSIZ)
678         for (ep = (cp = buffer) + len; cp < ep; cp++) {
679             if (*cp == NULL)
680                 continue;
681             switch (state) {
682                 case S1: 
683                     if (*cp == '-') {
684                         if (init == 0) {
685                             ml_txt ("\n------- Forwarded Message\n\n");
686                             init++;
687                         }
688                         output ('-');
689                         output (' ');
690                     }
691                     state = S2; /* fall */
692
693                 case S2: 
694                     if (init == 0) {
695                         ml_txt ("\n------- Forwarded Message\n\n");
696                         init++;
697                     }
698                     output (*cp);
699                     if (*cp == '\n')
700                         state = S1;
701                     break;
702             }
703         }
704
705     flush ();
706
707     if (result < 0) {
708         ll_log (logptr, LLOGTMP, "error reading message when noting failure");
709         if (init)
710             ml_txt ("\n------- End of Forwarded Message\n\n");
711         ml_txt ("[ error reading message ]\n");
712     }
713     else
714         if (init)
715             ml_txt ("\n------- End of Forwarded Message\n\n");
716         else {
717             ll_log (logptr, LLOGTMP, "message empty when noting failure");
718             ml_txt ("[ message empty ]\n");
719         }
720 }
721
722 /* \f */
723
724 /* VARARGS3 */
725
726 ds_log (result, level, fmt, a, b, c, d, e)
727 short   result;
728 int     level;
729 char   *fmt,
730        *a,
731        *b,
732        *c,
733        *d,
734        *e;
735 {
736     int     i;
737     char    buffer[BUFSIZ],
738             tmpfil[BUFSIZ];
739
740     ll_log (logptr, level, fmt, a, b, c, d, e);
741
742     sprintf (buffer, fmt, a, b, c, d, e);
743     strcat (buffer, "\n");
744
745     printx ("\rerror: %s", buffer);
746
747     if (err_fd == NOTOK) {
748         unlink (mktemp (strcpy (tmpfil, "/tmp/bboardsXXXXXX")));
749         if ((err_fd = creat (tmpfil, 0600)) == NOTOK)
750             return result;
751         close (err_fd);
752         if ((err_fd = open (tmpfil, 2)) == NOTOK)
753             return result;
754         unlink (tmpfil);
755         lseek (err_fd, (off_t)0, 0);
756     }
757     i = strlen (buffer);
758     write (err_fd, buffer, i);
759
760     return result;
761 }
762 #endif  not POP
763
764 /* \f */
765
766 /* mbx_     local mailbox routines */
767
768 #ifndef POP
769 mbx_init () {
770     int     fd,
771             clear;
772     char    name[BUFSIZ];
773     FILE * fp;
774
775     if ((fd = mbx_Xopen (curbb -> bb_info, bbrduid, bbrdgid, MBXMODE, &clear))
776             == NOTOK) {
777         if (errno == ETXTBSY) {
778             printx ("\runable to lock %s\n", curbb -> bb_info);
779             ll_err (logptr, LLOGTMP, "unable to lock %s",
780                     curbb -> bb_info);
781             return RP_LOCK;
782         }
783         printx ("\runable to open '%s'", curbb -> bb_info);
784         ll_log (logptr, LLOGTMP, "unable to open '%s'", curbb -> bb_info);
785         return RP_FOPN;
786     }
787     if ((fp = fdopen (fd, "w")) == (FILE *) NULL) {
788         printx ("\runable to fdopen '%s'", curbb -> bb_info);
789         ll_err (logptr, LLOGTMP, "unable to fdopen '%s'", curbb -> bb_info);
790         mbx_close (curbb -> bb_info, fd);
791         return RP_LIO;
792     }
793
794     strcpy (name, curbb -> bb_name);
795     if ((curbb = getbbnam (name)) == (struct bboard *) NULL) {
796         printx ("\runable to get information on BBoard %s\n", name);
797         ll_err (logptr, LLOGFAT, "unable to get info on %s", name);
798         lkfclose (fp, curbb -> bb_info);
799         return RP_LIO;
800     }
801     sprintf (bbrdheader, "BBoard-ID: %d\nBB-Posted: %s\n",
802             ++curbb -> bb_maxima, cnvtdate (TIMREG, bbrdtime));
803     fprintf (fp, "%d\n%s\n", curbb -> bb_maxima, bbrdtime);
804
805     lkfclose (fp, curbb -> bb_info);
806
807     return RP_OK;
808 }
809 #endif  not POP
810 @
811
812
813 1.2
814 log
815 @off_t fixes for BSD44
816 @
817 text
818 @d6 3
819 @
820
821
822 1.1
823 log
824 @Initial revision
825 @
826 text
827 @d72 1
828 a72 1
829 long    lseek ();
830 d241 1
831 a241 1
832     pos = lseek (md, 0L, 1);
833 d248 1
834 a248 1
835     start = lseek (md, 0L, 1);
836 d290 1
837 a290 1
838     stop = lseek (md, 0L, 1);
839 d558 1
840 a558 1
841             (void) lseek (err_fd, 0L, 0);
842 d602 1
843 a602 1
844         lseek (err_fd, 0L, 0);
845 d720 1
846 a720 1
847         lseek (err_fd, 0L, 0);
848 @