1 /* sendsbr.c -- routines to help WhatNow/Send along
3 * This code is Copyright (c) 2002, by the authors of nmh. See the
4 * COPYRIGHT file in the root directory of the nmh distribution for
5 * complete copyright information.
9 #include "sbr/pidstatus.h"
10 #include "sbr/arglist.h"
11 #include "sbr/error.h"
12 #include "h/fmt_scan.h"
13 #include "h/fmt_compile.h"
14 #include "h/signals.h"
22 #ifdef HAVE_SYS_TIME_H
23 # include <sys/time.h>
31 #include "sbr/m_maildir.h"
32 #include "sbr/m_mktemp.h"
33 #include "sbr/message_id.h"
36 static int setup_oauth_params(char *[], int *, const char *, const char **);
37 #endif /* OAUTH_SUPPORT */
39 int debugsw
= 0; /* global */
47 char *altmsg
= NULL
; /* .. */
48 char *annotext
= NULL
;
49 char *distfile
= NULL
;
56 static void alert (char *, int);
57 static int tmp_fd (void);
58 static void anno (int, struct stat
*);
59 static void annoaux (int);
60 static int splitmsg (char **, int, char *, char *, struct stat
*, int);
61 static int sendaux (char **, int, char *, char *, struct stat
*);
62 static void handle_sendfrom(char **, int *, char *, const char *);
63 static int get_from_header_info(const char *, const char **, const char **, const char **);
64 static const char *get_message_header_info(FILE *, char *);
65 static void merge_profile_entry(const char *, const char *, char *[], int *);
66 static void armed_done (int) NORETURN
;
69 * Entry point into (back-end) routines to send message.
73 sendsbr (char **vec
, int vecp
, char *program
, char *draft
, struct stat
*st
,
74 int rename_drft
, const char *auth_svc
)
78 char buffer
[BUFSIZ
], file
[BUFSIZ
];
80 char **buildvec
, *buildprogram
;
81 char *volatile drft
= draft
;
82 /* nvecs is volatile to prevent warning from gcc about possible clobbering
84 volatile int nvecs
= vecp
;
85 int *nvecsp
= (int *) &nvecs
;
88 * Run the mimebuildproc (which is by default mhbuild) on the message
89 * with the addition of the "-auto" flag
92 switch (child
= fork()) {
94 adios("fork", "unable to");
98 buildvec
= argsplit(buildmimeproc
, &buildprogram
, &i
);
99 buildvec
[i
++] = "-auto";
101 buildvec
[i
++] = "-dist";
102 buildvec
[i
++] = (char *) drft
;
104 execvp(buildprogram
, buildvec
);
105 fprintf(stderr
, "unable to exec ");
106 perror(buildmimeproc
);
111 if (pidXwait(child
, buildmimeproc
))
116 set_done(armed_done
);
117 switch (setjmp (env
)) {
120 * If given -push and -unique (which is undocumented), then
121 * rename the draft file. I'm not quite sure why.
123 if (pushsw
&& unique
) {
124 char *cp
= m_mktemp2(drft
, invo_name
, NULL
, NULL
);
126 die("unable to create temporary file");
128 if (rename (drft
, strncpy(file
, cp
, sizeof(file
))) == NOTOK
)
129 adios (file
, "unable to rename %s to", drft
);
134 * Add in any necessary profile entries for xoauth
140 if (setup_oauth_params(vec
, nvecsp
, auth_svc
, &errmsg
) != OK
) {
144 die("send built without OAUTH_SUPPORT, "
145 "so auth_svc %s is not supported", auth_svc
);
146 #endif /* OAUTH_SUPPORT */
150 * Rework the vec based on From: header in draft, as specified
151 * by sendfrom-address entries in profile.
153 if (context_find_prefix("sendfrom-")) {
154 handle_sendfrom(vec
, nvecsp
, draft
, auth_svc
);
158 * Check if we need to split the message into
159 * multiple messages of type "message/partial".
161 if (splitsw
>= 0 && !distfile
&& stat ((char *) drft
, &sts
) != NOTOK
162 && sts
.st_size
>= CPERMSG
) {
163 status
= splitmsg (vec
, nvecs
, program
, drft
,
164 st
, splitsw
) ? NOTOK
: OK
;
166 status
= sendaux (vec
, nvecs
, program
, drft
, st
) ? NOTOK
: OK
;
169 /* rename the original draft */
170 if (rename_drft
&& status
== OK
&&
171 rename (drft
, strncpy (buffer
, m_backup (drft
),
172 sizeof(buffer
))) == NOTOK
)
173 advise (buffer
, "unable to rename %s to", drft
);
183 (void) m_unlink (distfile
);
189 * Split large message into several messages of
190 * type "message/partial" and send them.
194 splitmsg (char **vec
, int vecp
, char *program
, char *drft
,
195 struct stat
*st
, int delay
)
197 int compnum
, nparts
, partno
, state
, status
;
200 char *cp
, *dp
, buffer
[NMH_BUFSIZ
], msgid
[BUFSIZ
];
201 char subject
[BUFSIZ
];
202 char name
[NAMESZ
], partnum
[BUFSIZ
];
204 m_getfld_state_t gstate
;
206 if ((in
= fopen (drft
, "r")) == NULL
)
207 adios (drft
, "unable to open for reading");
213 * Scan through the message and examine the various header fields,
214 * as well as locate the beginning of the message body.
216 gstate
= m_getfld_state_init(in
);
217 m_getfld_track_filepos2(&gstate
);
218 for (compnum
= 1;;) {
219 int bufsz
= sizeof buffer
;
220 switch (state
= m_getfld2(&gstate
, name
, buffer
, &bufsz
)) {
226 * This header field is discarded.
228 if (!strcasecmp (name
, "Message-ID")) {
229 while (state
== FLDPLUS
) {
230 bufsz
= sizeof buffer
;
231 state
= m_getfld2(&gstate
, name
, buffer
, &bufsz
);
233 } else if (uprf (name
, XXX_FIELD_PRF
)
234 || !strcasecmp (name
, VRSN_FIELD
)
235 || !strcasecmp (name
, "Subject")
236 || !strcasecmp (name
, "Encrypted")) {
238 * These header fields are copied to the enclosed
239 * header of the first message in the collection
240 * of message/partials. For the "Subject" header
241 * field, we also record it, so that a modified
242 * version of it, can be copied to the header
243 * of each message/partial in the collection.
245 if (!strcasecmp (name
, "Subject")) {
248 strncpy (subject
, buffer
, BUFSIZ
);
249 sublen
= strlen (subject
);
250 if (sublen
> 0 && subject
[sublen
- 1] == '\n')
251 subject
[sublen
- 1] = '\0';
254 dp
= add (concat (name
, ":", buffer
, NULL
), dp
);
255 while (state
== FLDPLUS
) {
256 bufsz
= sizeof buffer
;
257 state
= m_getfld2(&gstate
, name
, buffer
, &bufsz
);
258 dp
= add (buffer
, dp
);
262 * These header fields are copied to the header of
263 * each message/partial in the collection.
265 cp
= add (concat (name
, ":", buffer
, NULL
), cp
);
266 while (state
== FLDPLUS
) {
267 bufsz
= sizeof buffer
;
268 state
= m_getfld2(&gstate
, name
, buffer
, &bufsz
);
269 cp
= add (buffer
, cp
);
273 start
= ftell (in
) + 1;
282 die("message format error in component #%d", compnum
);
285 die("getfld () returned %d", state
);
290 m_getfld_state_destroy (&gstate
);
292 die("headers missing from draft");
296 while (fgets (buffer
, sizeof buffer
, in
)) {
299 if ((pos
+= (len
= strlen (buffer
))) > CPERMSG
) {
305 /* Only one part, nothing to split */
311 return sendaux (vec
, vecp
, program
, drft
, st
);
315 printf ("Sending as %d Partial Messages\n", nparts
);
320 vec
[vecp
++] = "-partno";
321 vec
[vecp
++] = partnum
;
323 vec
[vecp
++] = "-queued";
326 snprintf (msgid
, sizeof(msgid
), "%s", message_id (clock
, 0));
328 fseek (in
, start
, SEEK_SET
);
329 for (partno
= 1; partno
<= nparts
; partno
++) {
333 char *cp
= m_mktemp2(drft
, invo_name
, NULL
, &out
);
335 die("unable to create temporary file");
337 strncpy(tmpdrf
, cp
, sizeof(tmpdrf
));
340 * Output the header fields
343 fprintf (out
, "Subject: %s (part %d of %d)\n", subject
, partno
, nparts
);
344 fprintf (out
, "%s: %s\n", VRSN_FIELD
, VRSN_VALUE
);
345 fprintf (out
, "%s: message/partial; id=\"%s\";\n", TYPE_FIELD
, msgid
);
346 fprintf (out
, "\tnumber=%d; total=%d\n", partno
, nparts
);
347 fprintf (out
, "%s: part %d of %d\n\n", DESCR_FIELD
, partno
, nparts
);
350 * If this is the first in the collection, output the
351 * header fields we are encapsulating at the beginning
352 * of the body of the first message.
357 fprintf (out
, "Message-ID: %s\n", msgid
);
365 if (!fgets (buffer
, sizeof buffer
, in
)) {
366 if (partno
== nparts
)
368 die("premature eof");
371 if ((pos
+= (len
= strlen (buffer
))) > CPERMSG
) {
372 fseek (in
, -len
, SEEK_CUR
);
380 adios (tmpdrf
, "error writing to");
384 if (!pushsw
&& verbsw
) {
389 /* Pause here, if a delay is specified */
390 if (delay
> 0 && 1 < partno
&& partno
<= nparts
) {
392 printf ("pausing %d seconds before sending part %d...\n",
396 sleep ((unsigned int) delay
);
399 snprintf (partnum
, sizeof(partnum
), "%d", partno
);
400 status
= sendaux (vec
, vecp
, program
, tmpdrf
, st
);
401 (void) m_unlink (tmpdrf
);
406 * This is so sendaux will only annotate
407 * the altmsg the first time it is called.
415 fclose (in
); /* close the draft */
421 * Annotate original message, and
422 * call `postproc' (which is passed down in "program") to send message.
426 sendaux (char **vec
, int vecp
, char *program
, char *drft
, struct stat
*st
)
430 char backup
[BUFSIZ
], buf
[BUFSIZ
];
432 fd
= pushsw
? tmp_fd () : NOTOK
;
436 if ((fd2
= tmp_fd ()) != NOTOK
) {
437 vec
[vecp
++] = "-idanno";
438 snprintf (buf
, sizeof(buf
), "%d", fd2
);
441 inform("unable to create temporary file in %s for "
442 "annotation list, continuing...", get_temp_dir());
446 if (distfile
&& distout (drft
, distfile
, backup
) == NOTOK
)
453 /* oops -- fork error */
454 adios ("fork", "unable to");
455 break; /* NOT REACHED */
459 * child process -- send it
461 * If fd is OK, then we are pushing and fd points to temp
462 * file, so capture anything on stdout and stderr there.
465 dup2 (fd
, fileno (stdout
));
466 dup2 (fd
, fileno (stderr
));
469 execvp (program
, vec
);
470 fprintf (stderr
, "unable to exec ");
476 * parent process -- wait for it
478 if ((status
= pidwait(child_id
, NOTOK
)) == OK
) {
479 if (annotext
&& fd2
!= NOTOK
)
483 * If postproc failed, and we have good fd (which means
484 * we pushed), then mail error message (and possibly the
485 * draft) back to the user.
491 inform("message not delivered to anyone");
493 if (annotext
&& fd2
!= NOTOK
)
496 (void) m_unlink (drft
);
497 if (rename (backup
, drft
) == NOTOK
)
498 advise (drft
, "unable to rename %s to", backup
);
509 * Mail error notification (and possibly a copy of the
510 * message) back to the user, using the mailproc
514 alert (char *file
, int out
)
525 /* oops -- fork error */
526 advise ("fork", "unable to");
530 /* child process -- send it */
531 SIGNAL (SIGHUP
, SIG_IGN
);
532 SIGNAL (SIGINT
, SIG_IGN
);
533 SIGNAL (SIGQUIT
, SIG_IGN
);
534 SIGNAL (SIGTERM
, SIG_IGN
);
536 if ((in
= open (file
, O_RDONLY
)) == NOTOK
) {
537 admonish (file
, "unable to re-open");
539 lseek(out
, 0, SEEK_END
);
540 strncpy (buf
, "\nMessage not delivered to anyone.\n", sizeof(buf
));
541 if (write (out
, buf
, strlen (buf
)) < 0) {
542 advise (file
, "write");
544 strncpy (buf
, "\n------- Unsent Draft\n\n", sizeof(buf
));
545 if (write (out
, buf
, strlen (buf
)) < 0) {
546 advise (file
, "write");
548 cpydgst (in
, out
, file
, "temporary file");
550 strncpy (buf
, "\n------- End of Unsent Draft\n", sizeof(buf
));
551 if (write (out
, buf
, strlen (buf
)) < 0) {
552 advise (file
, "write");
554 if (rename (file
, strncpy (buf
, m_backup (file
), sizeof(buf
))) == NOTOK
)
555 admonish (buf
, "unable to rename %s to", file
);
558 lseek(out
, 0, SEEK_SET
);
559 dup2 (out
, fileno (stdin
));
561 /* create subject for error notification */
562 snprintf (buf
, sizeof(buf
), "send failed on %s",
563 forwsw
? "enclosed draft" : file
);
565 arglist
= argsplit(mailproc
, &program
, &argp
);
567 arglist
[argp
++] = getusername();
568 arglist
[argp
++] = "-subject";
569 arglist
[argp
++] = buf
;
570 arglist
[argp
] = NULL
;
572 execvp (program
, arglist
);
573 fprintf (stderr
, "unable to exec ");
577 default: /* no waiting... */
589 if ((tfile
= m_mktemp2(NULL
, invo_name
, &fd
, NULL
)) == NULL
) return NOTOK
;
592 inform("temporary file %s selected", tfile
);
593 else if (m_unlink (tfile
) == NOTOK
)
594 advise (tfile
, "unable to remove");
601 anno (int fd
, struct stat
*st
)
605 static char *cwd
= NULL
;
609 (stat (altmsg
, &st2
) == NOTOK
610 || st
->st_mtime
!= st2
.st_mtime
611 || st
->st_dev
!= st2
.st_dev
612 || st
->st_ino
!= st2
.st_ino
)) {
614 inform("$mhaltmsg mismatch, continuing...");
618 child_id
= debugsw
? NOTOK
: fork ();
620 case NOTOK
: /* oops */
622 inform("unable to fork, so doing annotations by hand...");
624 cwd
= mh_xstrdup(pwd ());
628 /* block a few signals */
630 sigaddset (&set
, SIGHUP
);
631 sigaddset (&set
, SIGINT
);
632 sigaddset (&set
, SIGQUIT
);
633 sigaddset (&set
, SIGTERM
);
634 sigprocmask (SIG_BLOCK
, &set
, &oset
);
636 unregister_for_removal(0);
642 /* reset the signal mask */
643 sigprocmask (SIG_SETMASK
, &oset
, &set
);
645 if (chdir (cwd
) < 0) {
646 advise (cwd
, "chdir");
650 default: /* no waiting... */
660 int fd2
, fd3
, msgnum
;
661 char *cp
, *folder
, *maildir
;
662 char buffer
[BUFSIZ
], **ap
;
666 if ((folder
= getenv ("mhfolder")) == NULL
|| *folder
== 0) {
668 inform("$mhfolder not set, continuing...");
671 maildir
= m_maildir (folder
);
672 if (chdir (maildir
) == NOTOK
) {
674 admonish (maildir
, "unable to change directory to");
677 if (!(mp
= folder_read (folder
, 0))) {
679 inform("unable to read folder %s, continuing...", folder
);
683 /* check for empty folder */
684 if (mp
->nummsg
== 0) {
686 inform("no messages in %s, continuing...", folder
);
690 if ((cp
= getenv ("mhmessages")) == NULL
|| *cp
== 0) {
692 inform("$mhmessages not set, continuing...");
695 if (!debugsw
/* MOBY HACK... */
697 && (fd3
= open ("/dev/null", O_RDWR
)) != NOTOK
698 && (fd2
= dup (fileno (stderr
))) != NOTOK
) {
699 dup2 (fd3
, fileno (stderr
));
704 for (ap
= brkstring (cp
= mh_xstrdup(cp
), " ", NULL
); *ap
; ap
++)
708 dup2 (fd2
, fileno (stderr
));
709 if (mp
->numsel
== 0) {
711 inform("no messages to annotate, continuing...");
715 lseek(fd
, 0, SEEK_SET
);
716 if ((fp
= fdopen (fd
, "r")) == NULL
) {
718 inform("unable to fdopen annotation list, continuing...");
722 while (fgets (buffer
, sizeof(buffer
), fp
) != NULL
)
723 cp
= add (buffer
, cp
);
727 inform("annotate%s with %s: \"%s\"",
728 inplace
? " inplace" : "", annotext
, cp
);
729 for (msgnum
= mp
->lowsel
; msgnum
<= mp
->hghsel
; msgnum
++) {
730 if (is_selected(mp
, msgnum
)) {
732 inform("annotate message %d", msgnum
);
733 annotate (m_name (msgnum
), annotext
, cp
, inplace
, 1, -2, 0);
740 folder_free (mp
); /* free folder/message structure */
745 handle_sendfrom(char **vec
, int *vecp
, char *draft
, const char *auth_svc
)
747 const char *addr
, *host
;
750 /* Extract address and host from From: header line in draft. */
751 if (get_from_header_info(draft
, &addr
, &host
, &message
) != OK
) {
752 adios(draft
, "%s", message
);
755 /* Merge in any address or host specific switches to post(1) from profile. */
756 merge_profile_entry(addr
, host
, vec
, vecp
);
765 for (vp
= vec
; *vp
; ++vp
) {
766 if (strcmp(*vp
, "xoauth2") == 0) {
768 if (setup_oauth_params(vec
, vecp
, auth_svc
, &message
) != OK
) {
773 NMH_UNUSED(auth_svc
);
774 die("send built without OAUTH_SUPPORT, "
775 "so -saslmech xoauth2 is not supported");
776 #endif /* OAUTH_SUPPORT */
785 * For XOAUTH2, append profile entries so post can do the heavy lifting
788 setup_oauth_params(char *vec
[], int *vecp
, const char *auth_svc
,
789 const char **message
)
791 const char *saslmech
= NULL
, *user
= NULL
;
792 mh_oauth_service_info svc
;
796 /* Make sure we have all the information we need. */
797 for (i
= 1; i
< *vecp
; ++i
) {
798 /* Don't support abbreviated switches, to avoid collisions in the
799 future if new ones are added. */
800 if (! strcmp(vec
[i
-1], "-saslmech")) {
802 } else if (! strcmp(vec
[i
-1], "-user")) {
804 } else if (! strcmp(vec
[i
-1], "-authservice")) {
809 if (auth_svc
== NULL
) {
810 if (saslmech
&& ! strcasecmp(saslmech
, "xoauth2")) {
811 *message
= "must specify -authservice with -saslmech xoauth2";
816 *message
= "must specify -user with -saslmech xoauth2";
820 if (saslmech
&& ! strcasecmp(saslmech
, "xoauth2")) {
821 if (! mh_oauth_get_service_info(auth_svc
, &svc
, errbuf
,
823 die("Unable to retrieve oauth profile entries: %s",
826 vec
[(*vecp
)++] = mh_xstrdup("-authservice");
827 vec
[(*vecp
)++] = mh_xstrdup(auth_svc
);
828 vec
[(*vecp
)++] = mh_xstrdup("-oauthcredfile");
829 vec
[(*vecp
)++] = mh_oauth_cred_fn(auth_svc
);
830 vec
[(*vecp
)++] = mh_xstrdup("-oauthclientid");
831 vec
[(*vecp
)++] = getcpy(svc
.client_id
);
832 vec
[(*vecp
)++] = mh_xstrdup("-oauthclientsecret");
833 vec
[(*vecp
)++] = getcpy(svc
.client_secret
);
834 vec
[(*vecp
)++] = mh_xstrdup("-oauthauthendpoint");
835 vec
[(*vecp
)++] = getcpy(svc
.auth_endpoint
);
836 vec
[(*vecp
)++] = mh_xstrdup("-oauthredirect");
837 vec
[(*vecp
)++] = getcpy(svc
.redirect_uri
);
838 vec
[(*vecp
)++] = mh_xstrdup("-oauthtokenendpoint");
839 vec
[(*vecp
)++] = getcpy(svc
.token_endpoint
);
840 vec
[(*vecp
)++] = mh_xstrdup("-oauthscope");
841 vec
[(*vecp
)++] = getcpy(svc
.scope
);
847 #endif /* OAUTH_SUPPORT */
851 * Extract user and domain from From: header line in draft.
854 get_from_header_info(const char *filename
, const char **addr
, const char **host
, const char **message
)
859 if (stat (filename
, &st
) == NOTOK
) {
860 *message
= "unable to stat draft file";
864 if ((in
= fopen (filename
, "r")) != NULL
) {
865 /* There must be a non-blank Envelope-From or {Resent-}Sender or
866 {Resent-}From header. */
867 char *addrformat
= "%(addr{Envelope-From})";
868 char *hostformat
= "%(host{Envelope-From})";
870 if ((*addr
= get_message_header_info (in
, addrformat
)) == NULL
||
872 addrformat
= distfile
== NULL
? "%(addr{Sender})" : "%(addr{Resent-Sender})";
873 hostformat
= distfile
== NULL
? "%(host{Sender})" : "%(host{Resent-Sender})";
875 if ((*addr
= get_message_header_info (in
, addrformat
)) == NULL
) {
876 addrformat
= distfile
== NULL
? "%(addr{From})" : "%(addr{Resent-From})";
877 hostformat
= distfile
== NULL
? "%(host{From})" : "%(host{Resent-From})";
879 if ((*addr
= get_message_header_info (in
, addrformat
)) == NULL
) {
880 *message
= "unable to find sender address in";
887 /* Use the hostformat that corresponds to the successful addrformat. */
888 if ((*host
= get_message_header_info(in
, hostformat
)) == NULL
) {
889 *message
= "unable to find sender host";
898 *message
= "unable to open";
904 * Get formatted information from header of a message.
905 * Adapted from process_single_file() in uip/fmttest.c.
908 get_message_header_info(FILE *in
, char *format
)
914 m_getfld_state_t gstate
;
915 charstring_t buffer
= charstring_create(0);
918 dat
[0] = dat
[1] = dat
[4] = 0;
919 dat
[2] = fstat(fileno(in
), &st
) == 0 ? st
.st_size
: 0;
922 (void) fmt_compile(new_fs(NULL
, NULL
, format
), &fmt
, 1);
926 * Read in the message and process the header.
929 parsing_header
= true;
930 gstate
= m_getfld_state_init(in
);
932 char name
[NAMESZ
], rbuf
[NMH_BUFSIZ
];
933 int bufsz
= sizeof rbuf
;
934 int state
= m_getfld2(&gstate
, name
, rbuf
, &bufsz
);
939 int bucket
= fmt_addcomptext(name
, rbuf
);
942 while (state
== FLDPLUS
) {
944 state
= m_getfld2(&gstate
, name
, rbuf
, &bufsz
);
945 fmt_appendcomp(bucket
, name
, rbuf
);
949 while (state
== FLDPLUS
) {
951 state
= m_getfld2(&gstate
, name
, rbuf
, &bufsz
);
956 parsing_header
= false;
958 } while (parsing_header
);
959 m_getfld_state_destroy(&gstate
);
961 fmt_scan(fmt
, buffer
, INT_MAX
, dat
, NULL
);
964 /* Trim trailing newline, if any. */
965 retval
= rtrim(charstring_buffer_copy((buffer
)));
966 charstring_free(buffer
);
976 * Look in profile for entry corresponding to addr or host, and add its contents to vec.
978 * Could do some of this automatically, by looking for:
979 * 1) access-$(mbox{from}) in oauth-svc file using mh_oauth_cred_load(), which isn't
980 * static and doesn't have side effects; free the result with mh_oauth_cred_free())
981 * 2) machine $(mbox{from}) in creds
982 * If no -server passed in from profile or commandline, could use smtp.<svc>.com for gmail,
983 * but that might not generalize for other svcs.
986 merge_profile_entry(const char *addr
, const char *host
, char *vec
[], int *vecp
)
988 char *addr_entry
= concat("sendfrom-", addr
, NULL
);
989 char *profile_entry
= context_find(addr_entry
);
992 if (profile_entry
== NULL
) {
993 /* No entry for the user. Look for one for the host. */
994 char *host_entry
= concat("sendfrom-", host
, NULL
);
996 profile_entry
= context_find(host_entry
);
1000 /* Use argsplit() to do the real work of splitting the args in the profile entry. */
1001 if (profile_entry
&& *profile_entry
) {
1004 char **profile_vec
= argsplit(profile_entry
, &file
, &profile_vecp
);
1007 for (i
= 0; i
< profile_vecp
; ++i
) {
1008 vec
[(*vecp
)++] = getcpy(profile_vec
[i
]);
1011 arglist_free(file
, profile_vec
);
1016 static void NORETURN
1017 armed_done (int status
)
1019 longjmp (env
, status
? status
: NOTOK
);