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/context_find.h"
10 #include "sbr/brkstring.h"
11 #include "sbr/pidstatus.h"
12 #include "sbr/arglist.h"
13 #include "sbr/error.h"
14 #include "h/fmt_scan.h"
15 #include "h/fmt_compile.h"
16 #include "h/signals.h"
24 #ifdef HAVE_SYS_TIME_H
25 # include <sys/time.h>
33 #include "sbr/m_maildir.h"
34 #include "sbr/m_mktemp.h"
35 #include "sbr/message_id.h"
38 static int setup_oauth_params(char *[], int *, const char *, const char **);
39 #endif /* OAUTH_SUPPORT */
41 int debugsw
= 0; /* global */
49 char *altmsg
= NULL
; /* .. */
50 char *annotext
= NULL
;
51 char *distfile
= NULL
;
58 static void alert (char *, int);
59 static int tmp_fd (void);
60 static void anno (int, struct stat
*);
61 static void annoaux (int);
62 static int splitmsg (char **, int, char *, char *, struct stat
*, int);
63 static int sendaux (char **, int, char *, char *, struct stat
*);
64 static void handle_sendfrom(char **, int *, char *, const char *);
65 static int get_from_header_info(const char *, const char **, const char **, const char **);
66 static const char *get_message_header_info(FILE *, char *);
67 static void merge_profile_entry(const char *, const char *, char *[], int *);
68 static void armed_done (int) NORETURN
;
71 * Entry point into (back-end) routines to send message.
75 sendsbr (char **vec
, int vecp
, char *program
, char *draft
, struct stat
*st
,
76 int rename_drft
, const char *auth_svc
)
80 char buffer
[BUFSIZ
], file
[BUFSIZ
];
82 char **buildvec
, *buildprogram
;
83 char *volatile drft
= draft
;
84 /* nvecs is volatile to prevent warning from gcc about possible clobbering
86 volatile int nvecs
= vecp
;
87 int *nvecsp
= (int *) &nvecs
;
90 * Run the mimebuildproc (which is by default mhbuild) on the message
91 * with the addition of the "-auto" flag
94 switch (child
= fork()) {
96 adios("fork", "unable to");
100 buildvec
= argsplit(buildmimeproc
, &buildprogram
, &i
);
101 buildvec
[i
++] = "-auto";
103 buildvec
[i
++] = "-dist";
104 buildvec
[i
++] = (char *) drft
;
106 execvp(buildprogram
, buildvec
);
107 fprintf(stderr
, "unable to exec ");
108 perror(buildmimeproc
);
113 if (pidXwait(child
, buildmimeproc
))
118 set_done(armed_done
);
119 switch (setjmp (env
)) {
122 * If given -push and -unique (which is undocumented), then
123 * rename the draft file. I'm not quite sure why.
125 if (pushsw
&& unique
) {
126 char *cp
= m_mktemp2(drft
, invo_name
, NULL
, NULL
);
128 die("unable to create temporary file");
130 if (rename (drft
, strncpy(file
, cp
, sizeof(file
))) == NOTOK
)
131 adios (file
, "unable to rename %s to", drft
);
136 * Add in any necessary profile entries for xoauth
142 if (setup_oauth_params(vec
, nvecsp
, auth_svc
, &errmsg
) != OK
) {
146 die("send built without OAUTH_SUPPORT, "
147 "so auth_svc %s is not supported", auth_svc
);
148 #endif /* OAUTH_SUPPORT */
152 * Rework the vec based on From: header in draft, as specified
153 * by sendfrom-address entries in profile.
155 if (context_find_prefix("sendfrom-")) {
156 handle_sendfrom(vec
, nvecsp
, draft
, auth_svc
);
160 * Check if we need to split the message into
161 * multiple messages of type "message/partial".
163 if (splitsw
>= 0 && !distfile
&& stat ((char *) drft
, &sts
) != NOTOK
164 && sts
.st_size
>= CPERMSG
) {
165 status
= splitmsg (vec
, nvecs
, program
, drft
,
166 st
, splitsw
) ? NOTOK
: OK
;
168 status
= sendaux (vec
, nvecs
, program
, drft
, st
) ? NOTOK
: OK
;
171 /* rename the original draft */
172 if (rename_drft
&& status
== OK
&&
173 rename (drft
, strncpy (buffer
, m_backup (drft
),
174 sizeof(buffer
))) == NOTOK
)
175 advise (buffer
, "unable to rename %s to", drft
);
185 (void) m_unlink (distfile
);
191 * Split large message into several messages of
192 * type "message/partial" and send them.
196 splitmsg (char **vec
, int vecp
, char *program
, char *drft
,
197 struct stat
*st
, int delay
)
199 int compnum
, nparts
, partno
, state
, status
;
202 char *cp
, *dp
, buffer
[NMH_BUFSIZ
], msgid
[BUFSIZ
];
203 char subject
[BUFSIZ
];
204 char name
[NAMESZ
], partnum
[BUFSIZ
];
206 m_getfld_state_t gstate
;
208 if ((in
= fopen (drft
, "r")) == NULL
)
209 adios (drft
, "unable to open for reading");
215 * Scan through the message and examine the various header fields,
216 * as well as locate the beginning of the message body.
218 gstate
= m_getfld_state_init(in
);
219 m_getfld_track_filepos2(&gstate
);
220 for (compnum
= 1;;) {
221 int bufsz
= sizeof buffer
;
222 switch (state
= m_getfld2(&gstate
, name
, buffer
, &bufsz
)) {
228 * This header field is discarded.
230 if (!strcasecmp (name
, "Message-ID")) {
231 while (state
== FLDPLUS
) {
232 bufsz
= sizeof buffer
;
233 state
= m_getfld2(&gstate
, name
, buffer
, &bufsz
);
235 } else if (uprf (name
, XXX_FIELD_PRF
)
236 || !strcasecmp (name
, VRSN_FIELD
)
237 || !strcasecmp (name
, "Subject")
238 || !strcasecmp (name
, "Encrypted")) {
240 * These header fields are copied to the enclosed
241 * header of the first message in the collection
242 * of message/partials. For the "Subject" header
243 * field, we also record it, so that a modified
244 * version of it, can be copied to the header
245 * of each message/partial in the collection.
247 if (!strcasecmp (name
, "Subject")) {
250 strncpy (subject
, buffer
, BUFSIZ
);
251 sublen
= strlen (subject
);
252 if (sublen
> 0 && subject
[sublen
- 1] == '\n')
253 subject
[sublen
- 1] = '\0';
256 dp
= add (concat (name
, ":", buffer
, NULL
), dp
);
257 while (state
== FLDPLUS
) {
258 bufsz
= sizeof buffer
;
259 state
= m_getfld2(&gstate
, name
, buffer
, &bufsz
);
260 dp
= add (buffer
, dp
);
264 * These header fields are copied to the header of
265 * each message/partial in the collection.
267 cp
= add (concat (name
, ":", buffer
, NULL
), cp
);
268 while (state
== FLDPLUS
) {
269 bufsz
= sizeof buffer
;
270 state
= m_getfld2(&gstate
, name
, buffer
, &bufsz
);
271 cp
= add (buffer
, cp
);
275 start
= ftell (in
) + 1;
284 die("message format error in component #%d", compnum
);
287 die("getfld () returned %d", state
);
292 m_getfld_state_destroy (&gstate
);
294 die("headers missing from draft");
298 while (fgets (buffer
, sizeof buffer
, in
)) {
301 if ((pos
+= (len
= strlen (buffer
))) > CPERMSG
) {
307 /* Only one part, nothing to split */
313 return sendaux (vec
, vecp
, program
, drft
, st
);
317 printf ("Sending as %d Partial Messages\n", nparts
);
322 vec
[vecp
++] = "-partno";
323 vec
[vecp
++] = partnum
;
325 vec
[vecp
++] = "-queued";
328 snprintf (msgid
, sizeof(msgid
), "%s", message_id (clock
, 0));
330 fseek (in
, start
, SEEK_SET
);
331 for (partno
= 1; partno
<= nparts
; partno
++) {
335 char *cp
= m_mktemp2(drft
, invo_name
, NULL
, &out
);
337 die("unable to create temporary file");
339 strncpy(tmpdrf
, cp
, sizeof(tmpdrf
));
342 * Output the header fields
345 fprintf (out
, "Subject: %s (part %d of %d)\n", subject
, partno
, nparts
);
346 fprintf (out
, "%s: %s\n", VRSN_FIELD
, VRSN_VALUE
);
347 fprintf (out
, "%s: message/partial; id=\"%s\";\n", TYPE_FIELD
, msgid
);
348 fprintf (out
, "\tnumber=%d; total=%d\n", partno
, nparts
);
349 fprintf (out
, "%s: part %d of %d\n\n", DESCR_FIELD
, partno
, nparts
);
352 * If this is the first in the collection, output the
353 * header fields we are encapsulating at the beginning
354 * of the body of the first message.
359 fprintf (out
, "Message-ID: %s\n", msgid
);
367 if (!fgets (buffer
, sizeof buffer
, in
)) {
368 if (partno
== nparts
)
370 die("premature eof");
373 if ((pos
+= (len
= strlen (buffer
))) > CPERMSG
) {
374 fseek (in
, -len
, SEEK_CUR
);
382 adios (tmpdrf
, "error writing to");
386 if (!pushsw
&& verbsw
) {
391 /* Pause here, if a delay is specified */
392 if (delay
> 0 && 1 < partno
&& partno
<= nparts
) {
394 printf ("pausing %d seconds before sending part %d...\n",
398 sleep ((unsigned int) delay
);
401 snprintf (partnum
, sizeof(partnum
), "%d", partno
);
402 status
= sendaux (vec
, vecp
, program
, tmpdrf
, st
);
403 (void) m_unlink (tmpdrf
);
408 * This is so sendaux will only annotate
409 * the altmsg the first time it is called.
417 fclose (in
); /* close the draft */
423 * Annotate original message, and
424 * call `postproc' (which is passed down in "program") to send message.
428 sendaux (char **vec
, int vecp
, char *program
, char *drft
, struct stat
*st
)
432 char backup
[BUFSIZ
], buf
[BUFSIZ
];
434 fd
= pushsw
? tmp_fd () : NOTOK
;
438 if ((fd2
= tmp_fd ()) != NOTOK
) {
439 vec
[vecp
++] = "-idanno";
440 snprintf (buf
, sizeof(buf
), "%d", fd2
);
443 inform("unable to create temporary file in %s for "
444 "annotation list, continuing...", get_temp_dir());
448 if (distfile
&& distout (drft
, distfile
, backup
) == NOTOK
)
455 /* oops -- fork error */
456 adios ("fork", "unable to");
457 break; /* NOT REACHED */
461 * child process -- send it
463 * If fd is OK, then we are pushing and fd points to temp
464 * file, so capture anything on stdout and stderr there.
467 dup2 (fd
, fileno (stdout
));
468 dup2 (fd
, fileno (stderr
));
471 execvp (program
, vec
);
472 fprintf (stderr
, "unable to exec ");
478 * parent process -- wait for it
480 if ((status
= pidwait(child_id
, NOTOK
)) == OK
) {
481 if (annotext
&& fd2
!= NOTOK
)
485 * If postproc failed, and we have good fd (which means
486 * we pushed), then mail error message (and possibly the
487 * draft) back to the user.
493 inform("message not delivered to anyone");
495 if (annotext
&& fd2
!= NOTOK
)
498 (void) m_unlink (drft
);
499 if (rename (backup
, drft
) == NOTOK
)
500 advise (drft
, "unable to rename %s to", backup
);
511 * Mail error notification (and possibly a copy of the
512 * message) back to the user, using the mailproc
516 alert (char *file
, int out
)
527 /* oops -- fork error */
528 advise ("fork", "unable to");
532 /* child process -- send it */
533 SIGNAL (SIGHUP
, SIG_IGN
);
534 SIGNAL (SIGINT
, SIG_IGN
);
535 SIGNAL (SIGQUIT
, SIG_IGN
);
536 SIGNAL (SIGTERM
, SIG_IGN
);
538 if ((in
= open (file
, O_RDONLY
)) == NOTOK
) {
539 admonish (file
, "unable to re-open");
541 lseek(out
, 0, SEEK_END
);
542 strncpy (buf
, "\nMessage not delivered to anyone.\n", sizeof(buf
));
543 if (write (out
, buf
, strlen (buf
)) < 0) {
544 advise (file
, "write");
546 strncpy (buf
, "\n------- Unsent Draft\n\n", sizeof(buf
));
547 if (write (out
, buf
, strlen (buf
)) < 0) {
548 advise (file
, "write");
550 cpydgst (in
, out
, file
, "temporary file");
552 strncpy (buf
, "\n------- End of Unsent Draft\n", sizeof(buf
));
553 if (write (out
, buf
, strlen (buf
)) < 0) {
554 advise (file
, "write");
556 if (rename (file
, strncpy (buf
, m_backup (file
), sizeof(buf
))) == NOTOK
)
557 admonish (buf
, "unable to rename %s to", file
);
560 lseek(out
, 0, SEEK_SET
);
561 dup2 (out
, fileno (stdin
));
563 /* create subject for error notification */
564 snprintf (buf
, sizeof(buf
), "send failed on %s",
565 forwsw
? "enclosed draft" : file
);
567 arglist
= argsplit(mailproc
, &program
, &argp
);
569 arglist
[argp
++] = getusername();
570 arglist
[argp
++] = "-subject";
571 arglist
[argp
++] = buf
;
572 arglist
[argp
] = NULL
;
574 execvp (program
, arglist
);
575 fprintf (stderr
, "unable to exec ");
579 default: /* no waiting... */
591 if ((tfile
= m_mktemp2(NULL
, invo_name
, &fd
, NULL
)) == NULL
) return NOTOK
;
594 inform("temporary file %s selected", tfile
);
595 else if (m_unlink (tfile
) == NOTOK
)
596 advise (tfile
, "unable to remove");
603 anno (int fd
, struct stat
*st
)
607 static char *cwd
= NULL
;
611 (stat (altmsg
, &st2
) == NOTOK
612 || st
->st_mtime
!= st2
.st_mtime
613 || st
->st_dev
!= st2
.st_dev
614 || st
->st_ino
!= st2
.st_ino
)) {
616 inform("$mhaltmsg mismatch, continuing...");
620 child_id
= debugsw
? NOTOK
: fork ();
622 case NOTOK
: /* oops */
624 inform("unable to fork, so doing annotations by hand...");
626 cwd
= mh_xstrdup(pwd ());
630 /* block a few signals */
632 sigaddset (&set
, SIGHUP
);
633 sigaddset (&set
, SIGINT
);
634 sigaddset (&set
, SIGQUIT
);
635 sigaddset (&set
, SIGTERM
);
636 sigprocmask (SIG_BLOCK
, &set
, &oset
);
638 unregister_for_removal(0);
644 /* reset the signal mask */
645 sigprocmask (SIG_SETMASK
, &oset
, &set
);
647 if (chdir (cwd
) < 0) {
648 advise (cwd
, "chdir");
652 default: /* no waiting... */
662 int fd2
, fd3
, msgnum
;
663 char *cp
, *folder
, *maildir
;
664 char buffer
[BUFSIZ
], **ap
;
668 if ((folder
= getenv ("mhfolder")) == NULL
|| *folder
== 0) {
670 inform("$mhfolder not set, continuing...");
673 maildir
= m_maildir (folder
);
674 if (chdir (maildir
) == NOTOK
) {
676 admonish (maildir
, "unable to change directory to");
679 if (!(mp
= folder_read (folder
, 0))) {
681 inform("unable to read folder %s, continuing...", folder
);
685 /* check for empty folder */
686 if (mp
->nummsg
== 0) {
688 inform("no messages in %s, continuing...", folder
);
692 if ((cp
= getenv ("mhmessages")) == NULL
|| *cp
== 0) {
694 inform("$mhmessages not set, continuing...");
697 if (!debugsw
/* MOBY HACK... */
699 && (fd3
= open ("/dev/null", O_RDWR
)) != NOTOK
700 && (fd2
= dup (fileno (stderr
))) != NOTOK
) {
701 dup2 (fd3
, fileno (stderr
));
706 for (ap
= brkstring (cp
= mh_xstrdup(cp
), " ", NULL
); *ap
; ap
++)
710 dup2 (fd2
, fileno (stderr
));
711 if (mp
->numsel
== 0) {
713 inform("no messages to annotate, continuing...");
717 lseek(fd
, 0, SEEK_SET
);
718 if ((fp
= fdopen (fd
, "r")) == NULL
) {
720 inform("unable to fdopen annotation list, continuing...");
724 while (fgets (buffer
, sizeof(buffer
), fp
) != NULL
)
725 cp
= add (buffer
, cp
);
729 inform("annotate%s with %s: \"%s\"",
730 inplace
? " inplace" : "", annotext
, cp
);
731 for (msgnum
= mp
->lowsel
; msgnum
<= mp
->hghsel
; msgnum
++) {
732 if (is_selected(mp
, msgnum
)) {
734 inform("annotate message %d", msgnum
);
735 annotate (m_name (msgnum
), annotext
, cp
, inplace
, 1, -2, 0);
742 folder_free (mp
); /* free folder/message structure */
747 handle_sendfrom(char **vec
, int *vecp
, char *draft
, const char *auth_svc
)
749 const char *addr
, *host
;
752 /* Extract address and host from From: header line in draft. */
753 if (get_from_header_info(draft
, &addr
, &host
, &message
) != OK
) {
754 adios(draft
, "%s", message
);
757 /* Merge in any address or host specific switches to post(1) from profile. */
758 merge_profile_entry(addr
, host
, vec
, vecp
);
767 for (vp
= vec
; *vp
; ++vp
) {
768 if (strcmp(*vp
, "xoauth2") == 0) {
770 if (setup_oauth_params(vec
, vecp
, auth_svc
, &message
) != OK
) {
775 NMH_UNUSED(auth_svc
);
776 die("send built without OAUTH_SUPPORT, "
777 "so -saslmech xoauth2 is not supported");
778 #endif /* OAUTH_SUPPORT */
787 * For XOAUTH2, append profile entries so post can do the heavy lifting
790 setup_oauth_params(char *vec
[], int *vecp
, const char *auth_svc
,
791 const char **message
)
793 const char *saslmech
= NULL
, *user
= NULL
;
794 mh_oauth_service_info svc
;
798 /* Make sure we have all the information we need. */
799 for (i
= 1; i
< *vecp
; ++i
) {
800 /* Don't support abbreviated switches, to avoid collisions in the
801 future if new ones are added. */
802 if (! strcmp(vec
[i
-1], "-saslmech")) {
804 } else if (! strcmp(vec
[i
-1], "-user")) {
806 } else if (! strcmp(vec
[i
-1], "-authservice")) {
811 if (auth_svc
== NULL
) {
812 if (saslmech
&& ! strcasecmp(saslmech
, "xoauth2")) {
813 *message
= "must specify -authservice with -saslmech xoauth2";
818 *message
= "must specify -user with -saslmech xoauth2";
822 if (saslmech
&& ! strcasecmp(saslmech
, "xoauth2")) {
823 if (! mh_oauth_get_service_info(auth_svc
, &svc
, errbuf
,
825 die("Unable to retrieve oauth profile entries: %s",
828 vec
[(*vecp
)++] = mh_xstrdup("-authservice");
829 vec
[(*vecp
)++] = mh_xstrdup(auth_svc
);
830 vec
[(*vecp
)++] = mh_xstrdup("-oauthcredfile");
831 vec
[(*vecp
)++] = mh_oauth_cred_fn(auth_svc
);
832 vec
[(*vecp
)++] = mh_xstrdup("-oauthclientid");
833 vec
[(*vecp
)++] = getcpy(svc
.client_id
);
834 vec
[(*vecp
)++] = mh_xstrdup("-oauthclientsecret");
835 vec
[(*vecp
)++] = getcpy(svc
.client_secret
);
836 vec
[(*vecp
)++] = mh_xstrdup("-oauthauthendpoint");
837 vec
[(*vecp
)++] = getcpy(svc
.auth_endpoint
);
838 vec
[(*vecp
)++] = mh_xstrdup("-oauthredirect");
839 vec
[(*vecp
)++] = getcpy(svc
.redirect_uri
);
840 vec
[(*vecp
)++] = mh_xstrdup("-oauthtokenendpoint");
841 vec
[(*vecp
)++] = getcpy(svc
.token_endpoint
);
842 vec
[(*vecp
)++] = mh_xstrdup("-oauthscope");
843 vec
[(*vecp
)++] = getcpy(svc
.scope
);
849 #endif /* OAUTH_SUPPORT */
853 * Extract user and domain from From: header line in draft.
856 get_from_header_info(const char *filename
, const char **addr
, const char **host
, const char **message
)
861 if (stat (filename
, &st
) == NOTOK
) {
862 *message
= "unable to stat draft file";
866 if ((in
= fopen (filename
, "r")) != NULL
) {
867 /* There must be a non-blank Envelope-From or {Resent-}Sender or
868 {Resent-}From header. */
869 char *addrformat
= "%(addr{Envelope-From})";
870 char *hostformat
= "%(host{Envelope-From})";
872 if ((*addr
= get_message_header_info (in
, addrformat
)) == NULL
||
874 addrformat
= distfile
== NULL
? "%(addr{Sender})" : "%(addr{Resent-Sender})";
875 hostformat
= distfile
== NULL
? "%(host{Sender})" : "%(host{Resent-Sender})";
877 if ((*addr
= get_message_header_info (in
, addrformat
)) == NULL
) {
878 addrformat
= distfile
== NULL
? "%(addr{From})" : "%(addr{Resent-From})";
879 hostformat
= distfile
== NULL
? "%(host{From})" : "%(host{Resent-From})";
881 if ((*addr
= get_message_header_info (in
, addrformat
)) == NULL
) {
882 *message
= "unable to find sender address in";
889 /* Use the hostformat that corresponds to the successful addrformat. */
890 if ((*host
= get_message_header_info(in
, hostformat
)) == NULL
) {
891 *message
= "unable to find sender host";
900 *message
= "unable to open";
906 * Get formatted information from header of a message.
907 * Adapted from process_single_file() in uip/fmttest.c.
910 get_message_header_info(FILE *in
, char *format
)
916 m_getfld_state_t gstate
;
917 charstring_t buffer
= charstring_create(0);
920 dat
[0] = dat
[1] = dat
[4] = 0;
921 dat
[2] = fstat(fileno(in
), &st
) == 0 ? st
.st_size
: 0;
924 (void) fmt_compile(new_fs(NULL
, NULL
, format
), &fmt
, 1);
928 * Read in the message and process the header.
931 parsing_header
= true;
932 gstate
= m_getfld_state_init(in
);
934 char name
[NAMESZ
], rbuf
[NMH_BUFSIZ
];
935 int bufsz
= sizeof rbuf
;
936 int state
= m_getfld2(&gstate
, name
, rbuf
, &bufsz
);
941 int bucket
= fmt_addcomptext(name
, rbuf
);
944 while (state
== FLDPLUS
) {
946 state
= m_getfld2(&gstate
, name
, rbuf
, &bufsz
);
947 fmt_appendcomp(bucket
, name
, rbuf
);
951 while (state
== FLDPLUS
) {
953 state
= m_getfld2(&gstate
, name
, rbuf
, &bufsz
);
958 parsing_header
= false;
960 } while (parsing_header
);
961 m_getfld_state_destroy(&gstate
);
963 fmt_scan(fmt
, buffer
, INT_MAX
, dat
, NULL
);
966 /* Trim trailing newline, if any. */
967 retval
= rtrim(charstring_buffer_copy((buffer
)));
968 charstring_free(buffer
);
978 * Look in profile for entry corresponding to addr or host, and add its contents to vec.
980 * Could do some of this automatically, by looking for:
981 * 1) access-$(mbox{from}) in oauth-svc file using mh_oauth_cred_load(), which isn't
982 * static and doesn't have side effects; free the result with mh_oauth_cred_free())
983 * 2) machine $(mbox{from}) in creds
984 * If no -server passed in from profile or commandline, could use smtp.<svc>.com for gmail,
985 * but that might not generalize for other svcs.
988 merge_profile_entry(const char *addr
, const char *host
, char *vec
[], int *vecp
)
990 char *addr_entry
= concat("sendfrom-", addr
, NULL
);
991 char *profile_entry
= context_find(addr_entry
);
994 if (profile_entry
== NULL
) {
995 /* No entry for the user. Look for one for the host. */
996 char *host_entry
= concat("sendfrom-", host
, NULL
);
998 profile_entry
= context_find(host_entry
);
1002 /* Use argsplit() to do the real work of splitting the args in the profile entry. */
1003 if (profile_entry
&& *profile_entry
) {
1006 char **profile_vec
= argsplit(profile_entry
, &file
, &profile_vecp
);
1009 for (i
= 0; i
< profile_vecp
; ++i
) {
1010 vec
[(*vecp
)++] = getcpy(profile_vec
[i
]);
1013 arglist_free(file
, profile_vec
);
1018 static void NORETURN
1019 armed_done (int status
)
1021 longjmp (env
, status
? status
: NOTOK
);