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/folder_read.h"
10 #include "sbr/folder_free.h"
11 #include "sbr/context_find.h"
12 #include "sbr/brkstring.h"
13 #include "sbr/pidstatus.h"
14 #include "sbr/arglist.h"
15 #include "sbr/error.h"
16 #include "h/fmt_scan.h"
17 #include "h/fmt_compile.h"
18 #include "h/signals.h"
26 #ifdef HAVE_SYS_TIME_H
27 # include <sys/time.h>
35 #include "sbr/m_maildir.h"
36 #include "sbr/m_mktemp.h"
37 #include "sbr/message_id.h"
40 static int setup_oauth_params(char *[], int *, const char *, const char **);
41 #endif /* OAUTH_SUPPORT */
43 int debugsw
= 0; /* global */
51 char *altmsg
= NULL
; /* .. */
52 char *annotext
= NULL
;
53 char *distfile
= NULL
;
60 static void alert (char *, int);
61 static int tmp_fd (void);
62 static void anno (int, struct stat
*);
63 static void annoaux (int);
64 static int splitmsg (char **, int, char *, char *, struct stat
*, int);
65 static int sendaux (char **, int, char *, char *, struct stat
*);
66 static void handle_sendfrom(char **, int *, char *, const char *);
67 static int get_from_header_info(const char *, const char **, const char **, const char **);
68 static const char *get_message_header_info(FILE *, char *);
69 static void merge_profile_entry(const char *, const char *, char *[], int *);
70 static void armed_done (int) NORETURN
;
73 * Entry point into (back-end) routines to send message.
77 sendsbr (char **vec
, int vecp
, char *program
, char *draft
, struct stat
*st
,
78 int rename_drft
, const char *auth_svc
)
82 char buffer
[BUFSIZ
], file
[BUFSIZ
];
84 char **buildvec
, *buildprogram
;
85 char *volatile drft
= draft
;
86 /* nvecs is volatile to prevent warning from gcc about possible clobbering
88 volatile int nvecs
= vecp
;
89 int *nvecsp
= (int *) &nvecs
;
92 * Run the mimebuildproc (which is by default mhbuild) on the message
93 * with the addition of the "-auto" flag
96 switch (child
= fork()) {
98 adios("fork", "unable to");
102 buildvec
= argsplit(buildmimeproc
, &buildprogram
, &i
);
103 buildvec
[i
++] = "-auto";
105 buildvec
[i
++] = "-dist";
106 buildvec
[i
++] = (char *) drft
;
108 execvp(buildprogram
, buildvec
);
109 fprintf(stderr
, "unable to exec ");
110 perror(buildmimeproc
);
115 if (pidXwait(child
, buildmimeproc
))
120 set_done(armed_done
);
121 switch (setjmp (env
)) {
124 * If given -push and -unique (which is undocumented), then
125 * rename the draft file. I'm not quite sure why.
127 if (pushsw
&& unique
) {
128 char *cp
= m_mktemp2(drft
, invo_name
, NULL
, NULL
);
130 die("unable to create temporary file");
132 if (rename (drft
, strncpy(file
, cp
, sizeof(file
))) == NOTOK
)
133 adios (file
, "unable to rename %s to", drft
);
138 * Add in any necessary profile entries for xoauth
144 if (setup_oauth_params(vec
, nvecsp
, auth_svc
, &errmsg
) != OK
) {
148 die("send built without OAUTH_SUPPORT, "
149 "so auth_svc %s is not supported", auth_svc
);
150 #endif /* OAUTH_SUPPORT */
154 * Rework the vec based on From: header in draft, as specified
155 * by sendfrom-address entries in profile.
157 if (context_find_prefix("sendfrom-")) {
158 handle_sendfrom(vec
, nvecsp
, draft
, auth_svc
);
162 * Check if we need to split the message into
163 * multiple messages of type "message/partial".
165 if (splitsw
>= 0 && !distfile
&& stat ((char *) drft
, &sts
) != NOTOK
166 && sts
.st_size
>= CPERMSG
) {
167 status
= splitmsg (vec
, nvecs
, program
, drft
,
168 st
, splitsw
) ? NOTOK
: OK
;
170 status
= sendaux (vec
, nvecs
, program
, drft
, st
) ? NOTOK
: OK
;
173 /* rename the original draft */
174 if (rename_drft
&& status
== OK
&&
175 rename (drft
, strncpy (buffer
, m_backup (drft
),
176 sizeof(buffer
))) == NOTOK
)
177 advise (buffer
, "unable to rename %s to", drft
);
187 (void) m_unlink (distfile
);
193 * Split large message into several messages of
194 * type "message/partial" and send them.
198 splitmsg (char **vec
, int vecp
, char *program
, char *drft
,
199 struct stat
*st
, int delay
)
201 int compnum
, nparts
, partno
, state
, status
;
204 char *cp
, *dp
, buffer
[NMH_BUFSIZ
], msgid
[BUFSIZ
];
205 char subject
[BUFSIZ
];
206 char name
[NAMESZ
], partnum
[BUFSIZ
];
208 m_getfld_state_t gstate
;
210 if ((in
= fopen (drft
, "r")) == NULL
)
211 adios (drft
, "unable to open for reading");
217 * Scan through the message and examine the various header fields,
218 * as well as locate the beginning of the message body.
220 gstate
= m_getfld_state_init(in
);
221 m_getfld_track_filepos2(&gstate
);
222 for (compnum
= 1;;) {
223 int bufsz
= sizeof buffer
;
224 switch (state
= m_getfld2(&gstate
, name
, buffer
, &bufsz
)) {
230 * This header field is discarded.
232 if (!strcasecmp (name
, "Message-ID")) {
233 while (state
== FLDPLUS
) {
234 bufsz
= sizeof buffer
;
235 state
= m_getfld2(&gstate
, name
, buffer
, &bufsz
);
237 } else if (uprf (name
, XXX_FIELD_PRF
)
238 || !strcasecmp (name
, VRSN_FIELD
)
239 || !strcasecmp (name
, "Subject")
240 || !strcasecmp (name
, "Encrypted")) {
242 * These header fields are copied to the enclosed
243 * header of the first message in the collection
244 * of message/partials. For the "Subject" header
245 * field, we also record it, so that a modified
246 * version of it, can be copied to the header
247 * of each message/partial in the collection.
249 if (!strcasecmp (name
, "Subject")) {
252 strncpy (subject
, buffer
, BUFSIZ
);
253 sublen
= strlen (subject
);
254 if (sublen
> 0 && subject
[sublen
- 1] == '\n')
255 subject
[sublen
- 1] = '\0';
258 dp
= add (concat (name
, ":", buffer
, NULL
), dp
);
259 while (state
== FLDPLUS
) {
260 bufsz
= sizeof buffer
;
261 state
= m_getfld2(&gstate
, name
, buffer
, &bufsz
);
262 dp
= add (buffer
, dp
);
266 * These header fields are copied to the header of
267 * each message/partial in the collection.
269 cp
= add (concat (name
, ":", buffer
, NULL
), cp
);
270 while (state
== FLDPLUS
) {
271 bufsz
= sizeof buffer
;
272 state
= m_getfld2(&gstate
, name
, buffer
, &bufsz
);
273 cp
= add (buffer
, cp
);
277 start
= ftell (in
) + 1;
286 die("message format error in component #%d", compnum
);
289 die("getfld () returned %d", state
);
294 m_getfld_state_destroy (&gstate
);
296 die("headers missing from draft");
300 while (fgets (buffer
, sizeof buffer
, in
)) {
303 if ((pos
+= (len
= strlen (buffer
))) > CPERMSG
) {
309 /* Only one part, nothing to split */
315 return sendaux (vec
, vecp
, program
, drft
, st
);
319 printf ("Sending as %d Partial Messages\n", nparts
);
324 vec
[vecp
++] = "-partno";
325 vec
[vecp
++] = partnum
;
327 vec
[vecp
++] = "-queued";
330 snprintf (msgid
, sizeof(msgid
), "%s", message_id (clock
, 0));
332 fseek (in
, start
, SEEK_SET
);
333 for (partno
= 1; partno
<= nparts
; partno
++) {
337 char *cp
= m_mktemp2(drft
, invo_name
, NULL
, &out
);
339 die("unable to create temporary file");
341 strncpy(tmpdrf
, cp
, sizeof(tmpdrf
));
344 * Output the header fields
347 fprintf (out
, "Subject: %s (part %d of %d)\n", subject
, partno
, nparts
);
348 fprintf (out
, "%s: %s\n", VRSN_FIELD
, VRSN_VALUE
);
349 fprintf (out
, "%s: message/partial; id=\"%s\";\n", TYPE_FIELD
, msgid
);
350 fprintf (out
, "\tnumber=%d; total=%d\n", partno
, nparts
);
351 fprintf (out
, "%s: part %d of %d\n\n", DESCR_FIELD
, partno
, nparts
);
354 * If this is the first in the collection, output the
355 * header fields we are encapsulating at the beginning
356 * of the body of the first message.
361 fprintf (out
, "Message-ID: %s\n", msgid
);
369 if (!fgets (buffer
, sizeof buffer
, in
)) {
370 if (partno
== nparts
)
372 die("premature eof");
375 if ((pos
+= (len
= strlen (buffer
))) > CPERMSG
) {
376 fseek (in
, -len
, SEEK_CUR
);
384 adios (tmpdrf
, "error writing to");
388 if (!pushsw
&& verbsw
) {
393 /* Pause here, if a delay is specified */
394 if (delay
> 0 && 1 < partno
&& partno
<= nparts
) {
396 printf ("pausing %d seconds before sending part %d...\n",
400 sleep ((unsigned int) delay
);
403 snprintf (partnum
, sizeof(partnum
), "%d", partno
);
404 status
= sendaux (vec
, vecp
, program
, tmpdrf
, st
);
405 (void) m_unlink (tmpdrf
);
410 * This is so sendaux will only annotate
411 * the altmsg the first time it is called.
419 fclose (in
); /* close the draft */
425 * Annotate original message, and
426 * call `postproc' (which is passed down in "program") to send message.
430 sendaux (char **vec
, int vecp
, char *program
, char *drft
, struct stat
*st
)
434 char backup
[BUFSIZ
], buf
[BUFSIZ
];
436 fd
= pushsw
? tmp_fd () : NOTOK
;
440 if ((fd2
= tmp_fd ()) != NOTOK
) {
441 vec
[vecp
++] = "-idanno";
442 snprintf (buf
, sizeof(buf
), "%d", fd2
);
445 inform("unable to create temporary file in %s for "
446 "annotation list, continuing...", get_temp_dir());
450 if (distfile
&& distout (drft
, distfile
, backup
) == NOTOK
)
457 /* oops -- fork error */
458 adios ("fork", "unable to");
459 break; /* NOT REACHED */
463 * child process -- send it
465 * If fd is OK, then we are pushing and fd points to temp
466 * file, so capture anything on stdout and stderr there.
469 dup2 (fd
, fileno (stdout
));
470 dup2 (fd
, fileno (stderr
));
473 execvp (program
, vec
);
474 fprintf (stderr
, "unable to exec ");
480 * parent process -- wait for it
482 if ((status
= pidwait(child_id
, NOTOK
)) == OK
) {
483 if (annotext
&& fd2
!= NOTOK
)
487 * If postproc failed, and we have good fd (which means
488 * we pushed), then mail error message (and possibly the
489 * draft) back to the user.
495 inform("message not delivered to anyone");
497 if (annotext
&& fd2
!= NOTOK
)
500 (void) m_unlink (drft
);
501 if (rename (backup
, drft
) == NOTOK
)
502 advise (drft
, "unable to rename %s to", backup
);
513 * Mail error notification (and possibly a copy of the
514 * message) back to the user, using the mailproc
518 alert (char *file
, int out
)
529 /* oops -- fork error */
530 advise ("fork", "unable to");
534 /* child process -- send it */
535 SIGNAL (SIGHUP
, SIG_IGN
);
536 SIGNAL (SIGINT
, SIG_IGN
);
537 SIGNAL (SIGQUIT
, SIG_IGN
);
538 SIGNAL (SIGTERM
, SIG_IGN
);
540 if ((in
= open (file
, O_RDONLY
)) == NOTOK
) {
541 admonish (file
, "unable to re-open");
543 lseek(out
, 0, SEEK_END
);
544 strncpy (buf
, "\nMessage not delivered to anyone.\n", sizeof(buf
));
545 if (write (out
, buf
, strlen (buf
)) < 0) {
546 advise (file
, "write");
548 strncpy (buf
, "\n------- Unsent Draft\n\n", sizeof(buf
));
549 if (write (out
, buf
, strlen (buf
)) < 0) {
550 advise (file
, "write");
552 cpydgst (in
, out
, file
, "temporary file");
554 strncpy (buf
, "\n------- End of Unsent Draft\n", sizeof(buf
));
555 if (write (out
, buf
, strlen (buf
)) < 0) {
556 advise (file
, "write");
558 if (rename (file
, strncpy (buf
, m_backup (file
), sizeof(buf
))) == NOTOK
)
559 admonish (buf
, "unable to rename %s to", file
);
562 lseek(out
, 0, SEEK_SET
);
563 dup2 (out
, fileno (stdin
));
565 /* create subject for error notification */
566 snprintf (buf
, sizeof(buf
), "send failed on %s",
567 forwsw
? "enclosed draft" : file
);
569 arglist
= argsplit(mailproc
, &program
, &argp
);
571 arglist
[argp
++] = getusername();
572 arglist
[argp
++] = "-subject";
573 arglist
[argp
++] = buf
;
574 arglist
[argp
] = NULL
;
576 execvp (program
, arglist
);
577 fprintf (stderr
, "unable to exec ");
581 default: /* no waiting... */
593 if ((tfile
= m_mktemp2(NULL
, invo_name
, &fd
, NULL
)) == NULL
) return NOTOK
;
596 inform("temporary file %s selected", tfile
);
597 else if (m_unlink (tfile
) == NOTOK
)
598 advise (tfile
, "unable to remove");
605 anno (int fd
, struct stat
*st
)
609 static char *cwd
= NULL
;
613 (stat (altmsg
, &st2
) == NOTOK
614 || st
->st_mtime
!= st2
.st_mtime
615 || st
->st_dev
!= st2
.st_dev
616 || st
->st_ino
!= st2
.st_ino
)) {
618 inform("$mhaltmsg mismatch, continuing...");
622 child_id
= debugsw
? NOTOK
: fork ();
624 case NOTOK
: /* oops */
626 inform("unable to fork, so doing annotations by hand...");
628 cwd
= mh_xstrdup(pwd ());
632 /* block a few signals */
634 sigaddset (&set
, SIGHUP
);
635 sigaddset (&set
, SIGINT
);
636 sigaddset (&set
, SIGQUIT
);
637 sigaddset (&set
, SIGTERM
);
638 sigprocmask (SIG_BLOCK
, &set
, &oset
);
640 unregister_for_removal(0);
646 /* reset the signal mask */
647 sigprocmask (SIG_SETMASK
, &oset
, &set
);
649 if (chdir (cwd
) < 0) {
650 advise (cwd
, "chdir");
654 default: /* no waiting... */
664 int fd2
, fd3
, msgnum
;
665 char *cp
, *folder
, *maildir
;
666 char buffer
[BUFSIZ
], **ap
;
670 if ((folder
= getenv ("mhfolder")) == NULL
|| *folder
== 0) {
672 inform("$mhfolder not set, continuing...");
675 maildir
= m_maildir (folder
);
676 if (chdir (maildir
) == NOTOK
) {
678 admonish (maildir
, "unable to change directory to");
681 if (!(mp
= folder_read (folder
, 0))) {
683 inform("unable to read folder %s, continuing...", folder
);
687 /* check for empty folder */
688 if (mp
->nummsg
== 0) {
690 inform("no messages in %s, continuing...", folder
);
694 if ((cp
= getenv ("mhmessages")) == NULL
|| *cp
== 0) {
696 inform("$mhmessages not set, continuing...");
699 if (!debugsw
/* MOBY HACK... */
701 && (fd3
= open ("/dev/null", O_RDWR
)) != NOTOK
702 && (fd2
= dup (fileno (stderr
))) != NOTOK
) {
703 dup2 (fd3
, fileno (stderr
));
708 for (ap
= brkstring (cp
= mh_xstrdup(cp
), " ", NULL
); *ap
; ap
++)
712 dup2 (fd2
, fileno (stderr
));
713 if (mp
->numsel
== 0) {
715 inform("no messages to annotate, continuing...");
719 lseek(fd
, 0, SEEK_SET
);
720 if ((fp
= fdopen (fd
, "r")) == NULL
) {
722 inform("unable to fdopen annotation list, continuing...");
726 while (fgets (buffer
, sizeof(buffer
), fp
) != NULL
)
727 cp
= add (buffer
, cp
);
731 inform("annotate%s with %s: \"%s\"",
732 inplace
? " inplace" : "", annotext
, cp
);
733 for (msgnum
= mp
->lowsel
; msgnum
<= mp
->hghsel
; msgnum
++) {
734 if (is_selected(mp
, msgnum
)) {
736 inform("annotate message %d", msgnum
);
737 annotate (m_name (msgnum
), annotext
, cp
, inplace
, 1, -2, 0);
744 folder_free (mp
); /* free folder/message structure */
749 handle_sendfrom(char **vec
, int *vecp
, char *draft
, const char *auth_svc
)
751 const char *addr
, *host
;
754 /* Extract address and host from From: header line in draft. */
755 if (get_from_header_info(draft
, &addr
, &host
, &message
) != OK
) {
756 adios(draft
, "%s", message
);
759 /* Merge in any address or host specific switches to post(1) from profile. */
760 merge_profile_entry(addr
, host
, vec
, vecp
);
769 for (vp
= vec
; *vp
; ++vp
) {
770 if (strcmp(*vp
, "xoauth2") == 0) {
772 if (setup_oauth_params(vec
, vecp
, auth_svc
, &message
) != OK
) {
777 NMH_UNUSED(auth_svc
);
778 die("send built without OAUTH_SUPPORT, "
779 "so -saslmech xoauth2 is not supported");
780 #endif /* OAUTH_SUPPORT */
789 * For XOAUTH2, append profile entries so post can do the heavy lifting
792 setup_oauth_params(char *vec
[], int *vecp
, const char *auth_svc
,
793 const char **message
)
795 const char *saslmech
= NULL
, *user
= NULL
;
796 mh_oauth_service_info svc
;
800 /* Make sure we have all the information we need. */
801 for (i
= 1; i
< *vecp
; ++i
) {
802 /* Don't support abbreviated switches, to avoid collisions in the
803 future if new ones are added. */
804 if (! strcmp(vec
[i
-1], "-saslmech")) {
806 } else if (! strcmp(vec
[i
-1], "-user")) {
808 } else if (! strcmp(vec
[i
-1], "-authservice")) {
813 if (auth_svc
== NULL
) {
814 if (saslmech
&& ! strcasecmp(saslmech
, "xoauth2")) {
815 *message
= "must specify -authservice with -saslmech xoauth2";
820 *message
= "must specify -user with -saslmech xoauth2";
824 if (saslmech
&& ! strcasecmp(saslmech
, "xoauth2")) {
825 if (! mh_oauth_get_service_info(auth_svc
, &svc
, errbuf
,
827 die("Unable to retrieve oauth profile entries: %s",
830 vec
[(*vecp
)++] = mh_xstrdup("-authservice");
831 vec
[(*vecp
)++] = mh_xstrdup(auth_svc
);
832 vec
[(*vecp
)++] = mh_xstrdup("-oauthcredfile");
833 vec
[(*vecp
)++] = mh_oauth_cred_fn(auth_svc
);
834 vec
[(*vecp
)++] = mh_xstrdup("-oauthclientid");
835 vec
[(*vecp
)++] = getcpy(svc
.client_id
);
836 vec
[(*vecp
)++] = mh_xstrdup("-oauthclientsecret");
837 vec
[(*vecp
)++] = getcpy(svc
.client_secret
);
838 vec
[(*vecp
)++] = mh_xstrdup("-oauthauthendpoint");
839 vec
[(*vecp
)++] = getcpy(svc
.auth_endpoint
);
840 vec
[(*vecp
)++] = mh_xstrdup("-oauthredirect");
841 vec
[(*vecp
)++] = getcpy(svc
.redirect_uri
);
842 vec
[(*vecp
)++] = mh_xstrdup("-oauthtokenendpoint");
843 vec
[(*vecp
)++] = getcpy(svc
.token_endpoint
);
844 vec
[(*vecp
)++] = mh_xstrdup("-oauthscope");
845 vec
[(*vecp
)++] = getcpy(svc
.scope
);
851 #endif /* OAUTH_SUPPORT */
855 * Extract user and domain from From: header line in draft.
858 get_from_header_info(const char *filename
, const char **addr
, const char **host
, const char **message
)
863 if (stat (filename
, &st
) == NOTOK
) {
864 *message
= "unable to stat draft file";
868 if ((in
= fopen (filename
, "r")) != NULL
) {
869 /* There must be a non-blank Envelope-From or {Resent-}Sender or
870 {Resent-}From header. */
871 char *addrformat
= "%(addr{Envelope-From})";
872 char *hostformat
= "%(host{Envelope-From})";
874 if ((*addr
= get_message_header_info (in
, addrformat
)) == NULL
||
876 addrformat
= distfile
== NULL
? "%(addr{Sender})" : "%(addr{Resent-Sender})";
877 hostformat
= distfile
== NULL
? "%(host{Sender})" : "%(host{Resent-Sender})";
879 if ((*addr
= get_message_header_info (in
, addrformat
)) == NULL
) {
880 addrformat
= distfile
== NULL
? "%(addr{From})" : "%(addr{Resent-From})";
881 hostformat
= distfile
== NULL
? "%(host{From})" : "%(host{Resent-From})";
883 if ((*addr
= get_message_header_info (in
, addrformat
)) == NULL
) {
884 *message
= "unable to find sender address in";
891 /* Use the hostformat that corresponds to the successful addrformat. */
892 if ((*host
= get_message_header_info(in
, hostformat
)) == NULL
) {
893 *message
= "unable to find sender host";
902 *message
= "unable to open";
908 * Get formatted information from header of a message.
909 * Adapted from process_single_file() in uip/fmttest.c.
912 get_message_header_info(FILE *in
, char *format
)
918 m_getfld_state_t gstate
;
919 charstring_t buffer
= charstring_create(0);
922 dat
[0] = dat
[1] = dat
[4] = 0;
923 dat
[2] = fstat(fileno(in
), &st
) == 0 ? st
.st_size
: 0;
926 (void) fmt_compile(new_fs(NULL
, NULL
, format
), &fmt
, 1);
930 * Read in the message and process the header.
933 parsing_header
= true;
934 gstate
= m_getfld_state_init(in
);
936 char name
[NAMESZ
], rbuf
[NMH_BUFSIZ
];
937 int bufsz
= sizeof rbuf
;
938 int state
= m_getfld2(&gstate
, name
, rbuf
, &bufsz
);
943 int bucket
= fmt_addcomptext(name
, rbuf
);
946 while (state
== FLDPLUS
) {
948 state
= m_getfld2(&gstate
, name
, rbuf
, &bufsz
);
949 fmt_appendcomp(bucket
, name
, rbuf
);
953 while (state
== FLDPLUS
) {
955 state
= m_getfld2(&gstate
, name
, rbuf
, &bufsz
);
960 parsing_header
= false;
962 } while (parsing_header
);
963 m_getfld_state_destroy(&gstate
);
965 fmt_scan(fmt
, buffer
, INT_MAX
, dat
, NULL
);
968 /* Trim trailing newline, if any. */
969 retval
= rtrim(charstring_buffer_copy((buffer
)));
970 charstring_free(buffer
);
980 * Look in profile for entry corresponding to addr or host, and add its contents to vec.
982 * Could do some of this automatically, by looking for:
983 * 1) access-$(mbox{from}) in oauth-svc file using mh_oauth_cred_load(), which isn't
984 * static and doesn't have side effects; free the result with mh_oauth_cred_free())
985 * 2) machine $(mbox{from}) in creds
986 * If no -server passed in from profile or commandline, could use smtp.<svc>.com for gmail,
987 * but that might not generalize for other svcs.
990 merge_profile_entry(const char *addr
, const char *host
, char *vec
[], int *vecp
)
992 char *addr_entry
= concat("sendfrom-", addr
, NULL
);
993 char *profile_entry
= context_find(addr_entry
);
996 if (profile_entry
== NULL
) {
997 /* No entry for the user. Look for one for the host. */
998 char *host_entry
= concat("sendfrom-", host
, NULL
);
1000 profile_entry
= context_find(host_entry
);
1004 /* Use argsplit() to do the real work of splitting the args in the profile entry. */
1005 if (profile_entry
&& *profile_entry
) {
1008 char **profile_vec
= argsplit(profile_entry
, &file
, &profile_vecp
);
1011 for (i
= 0; i
< profile_vecp
; ++i
) {
1012 vec
[(*vecp
)++] = getcpy(profile_vec
[i
]);
1015 arglist_free(file
, profile_vec
);
1020 static void NORETURN
1021 armed_done (int status
)
1023 longjmp (env
, status
? status
: NOTOK
);