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_free.h"
10 #include "sbr/context_find.h"
11 #include "sbr/brkstring.h"
12 #include "sbr/pidstatus.h"
13 #include "sbr/arglist.h"
14 #include "sbr/error.h"
15 #include "h/fmt_scan.h"
16 #include "h/fmt_compile.h"
17 #include "h/signals.h"
25 #ifdef HAVE_SYS_TIME_H
26 # include <sys/time.h>
34 #include "sbr/m_maildir.h"
35 #include "sbr/m_mktemp.h"
36 #include "sbr/message_id.h"
39 static int setup_oauth_params(char *[], int *, const char *, const char **);
40 #endif /* OAUTH_SUPPORT */
42 int debugsw
= 0; /* global */
50 char *altmsg
= NULL
; /* .. */
51 char *annotext
= NULL
;
52 char *distfile
= NULL
;
59 static void alert (char *, int);
60 static int tmp_fd (void);
61 static void anno (int, struct stat
*);
62 static void annoaux (int);
63 static int splitmsg (char **, int, char *, char *, struct stat
*, int);
64 static int sendaux (char **, int, char *, char *, struct stat
*);
65 static void handle_sendfrom(char **, int *, char *, const char *);
66 static int get_from_header_info(const char *, const char **, const char **, const char **);
67 static const char *get_message_header_info(FILE *, char *);
68 static void merge_profile_entry(const char *, const char *, char *[], int *);
69 static void armed_done (int) NORETURN
;
72 * Entry point into (back-end) routines to send message.
76 sendsbr (char **vec
, int vecp
, char *program
, char *draft
, struct stat
*st
,
77 int rename_drft
, const char *auth_svc
)
81 char buffer
[BUFSIZ
], file
[BUFSIZ
];
83 char **buildvec
, *buildprogram
;
84 char *volatile drft
= draft
;
85 /* nvecs is volatile to prevent warning from gcc about possible clobbering
87 volatile int nvecs
= vecp
;
88 int *nvecsp
= (int *) &nvecs
;
91 * Run the mimebuildproc (which is by default mhbuild) on the message
92 * with the addition of the "-auto" flag
95 switch (child
= fork()) {
97 adios("fork", "unable to");
101 buildvec
= argsplit(buildmimeproc
, &buildprogram
, &i
);
102 buildvec
[i
++] = "-auto";
104 buildvec
[i
++] = "-dist";
105 buildvec
[i
++] = (char *) drft
;
107 execvp(buildprogram
, buildvec
);
108 fprintf(stderr
, "unable to exec ");
109 perror(buildmimeproc
);
114 if (pidXwait(child
, buildmimeproc
))
119 set_done(armed_done
);
120 switch (setjmp (env
)) {
123 * If given -push and -unique (which is undocumented), then
124 * rename the draft file. I'm not quite sure why.
126 if (pushsw
&& unique
) {
127 char *cp
= m_mktemp2(drft
, invo_name
, NULL
, NULL
);
129 die("unable to create temporary file");
131 if (rename (drft
, strncpy(file
, cp
, sizeof(file
))) == NOTOK
)
132 adios (file
, "unable to rename %s to", drft
);
137 * Add in any necessary profile entries for xoauth
143 if (setup_oauth_params(vec
, nvecsp
, auth_svc
, &errmsg
) != OK
) {
147 die("send built without OAUTH_SUPPORT, "
148 "so auth_svc %s is not supported", auth_svc
);
149 #endif /* OAUTH_SUPPORT */
153 * Rework the vec based on From: header in draft, as specified
154 * by sendfrom-address entries in profile.
156 if (context_find_prefix("sendfrom-")) {
157 handle_sendfrom(vec
, nvecsp
, draft
, auth_svc
);
161 * Check if we need to split the message into
162 * multiple messages of type "message/partial".
164 if (splitsw
>= 0 && !distfile
&& stat ((char *) drft
, &sts
) != NOTOK
165 && sts
.st_size
>= CPERMSG
) {
166 status
= splitmsg (vec
, nvecs
, program
, drft
,
167 st
, splitsw
) ? NOTOK
: OK
;
169 status
= sendaux (vec
, nvecs
, program
, drft
, st
) ? NOTOK
: OK
;
172 /* rename the original draft */
173 if (rename_drft
&& status
== OK
&&
174 rename (drft
, strncpy (buffer
, m_backup (drft
),
175 sizeof(buffer
))) == NOTOK
)
176 advise (buffer
, "unable to rename %s to", drft
);
186 (void) m_unlink (distfile
);
192 * Split large message into several messages of
193 * type "message/partial" and send them.
197 splitmsg (char **vec
, int vecp
, char *program
, char *drft
,
198 struct stat
*st
, int delay
)
200 int compnum
, nparts
, partno
, state
, status
;
203 char *cp
, *dp
, buffer
[NMH_BUFSIZ
], msgid
[BUFSIZ
];
204 char subject
[BUFSIZ
];
205 char name
[NAMESZ
], partnum
[BUFSIZ
];
207 m_getfld_state_t gstate
;
209 if ((in
= fopen (drft
, "r")) == NULL
)
210 adios (drft
, "unable to open for reading");
216 * Scan through the message and examine the various header fields,
217 * as well as locate the beginning of the message body.
219 gstate
= m_getfld_state_init(in
);
220 m_getfld_track_filepos2(&gstate
);
221 for (compnum
= 1;;) {
222 int bufsz
= sizeof buffer
;
223 switch (state
= m_getfld2(&gstate
, name
, buffer
, &bufsz
)) {
229 * This header field is discarded.
231 if (!strcasecmp (name
, "Message-ID")) {
232 while (state
== FLDPLUS
) {
233 bufsz
= sizeof buffer
;
234 state
= m_getfld2(&gstate
, name
, buffer
, &bufsz
);
236 } else if (uprf (name
, XXX_FIELD_PRF
)
237 || !strcasecmp (name
, VRSN_FIELD
)
238 || !strcasecmp (name
, "Subject")
239 || !strcasecmp (name
, "Encrypted")) {
241 * These header fields are copied to the enclosed
242 * header of the first message in the collection
243 * of message/partials. For the "Subject" header
244 * field, we also record it, so that a modified
245 * version of it, can be copied to the header
246 * of each message/partial in the collection.
248 if (!strcasecmp (name
, "Subject")) {
251 strncpy (subject
, buffer
, BUFSIZ
);
252 sublen
= strlen (subject
);
253 if (sublen
> 0 && subject
[sublen
- 1] == '\n')
254 subject
[sublen
- 1] = '\0';
257 dp
= add (concat (name
, ":", buffer
, NULL
), dp
);
258 while (state
== FLDPLUS
) {
259 bufsz
= sizeof buffer
;
260 state
= m_getfld2(&gstate
, name
, buffer
, &bufsz
);
261 dp
= add (buffer
, dp
);
265 * These header fields are copied to the header of
266 * each message/partial in the collection.
268 cp
= add (concat (name
, ":", buffer
, NULL
), cp
);
269 while (state
== FLDPLUS
) {
270 bufsz
= sizeof buffer
;
271 state
= m_getfld2(&gstate
, name
, buffer
, &bufsz
);
272 cp
= add (buffer
, cp
);
276 start
= ftell (in
) + 1;
285 die("message format error in component #%d", compnum
);
288 die("getfld () returned %d", state
);
293 m_getfld_state_destroy (&gstate
);
295 die("headers missing from draft");
299 while (fgets (buffer
, sizeof buffer
, in
)) {
302 if ((pos
+= (len
= strlen (buffer
))) > CPERMSG
) {
308 /* Only one part, nothing to split */
314 return sendaux (vec
, vecp
, program
, drft
, st
);
318 printf ("Sending as %d Partial Messages\n", nparts
);
323 vec
[vecp
++] = "-partno";
324 vec
[vecp
++] = partnum
;
326 vec
[vecp
++] = "-queued";
329 snprintf (msgid
, sizeof(msgid
), "%s", message_id (clock
, 0));
331 fseek (in
, start
, SEEK_SET
);
332 for (partno
= 1; partno
<= nparts
; partno
++) {
336 char *cp
= m_mktemp2(drft
, invo_name
, NULL
, &out
);
338 die("unable to create temporary file");
340 strncpy(tmpdrf
, cp
, sizeof(tmpdrf
));
343 * Output the header fields
346 fprintf (out
, "Subject: %s (part %d of %d)\n", subject
, partno
, nparts
);
347 fprintf (out
, "%s: %s\n", VRSN_FIELD
, VRSN_VALUE
);
348 fprintf (out
, "%s: message/partial; id=\"%s\";\n", TYPE_FIELD
, msgid
);
349 fprintf (out
, "\tnumber=%d; total=%d\n", partno
, nparts
);
350 fprintf (out
, "%s: part %d of %d\n\n", DESCR_FIELD
, partno
, nparts
);
353 * If this is the first in the collection, output the
354 * header fields we are encapsulating at the beginning
355 * of the body of the first message.
360 fprintf (out
, "Message-ID: %s\n", msgid
);
368 if (!fgets (buffer
, sizeof buffer
, in
)) {
369 if (partno
== nparts
)
371 die("premature eof");
374 if ((pos
+= (len
= strlen (buffer
))) > CPERMSG
) {
375 fseek (in
, -len
, SEEK_CUR
);
383 adios (tmpdrf
, "error writing to");
387 if (!pushsw
&& verbsw
) {
392 /* Pause here, if a delay is specified */
393 if (delay
> 0 && 1 < partno
&& partno
<= nparts
) {
395 printf ("pausing %d seconds before sending part %d...\n",
399 sleep ((unsigned int) delay
);
402 snprintf (partnum
, sizeof(partnum
), "%d", partno
);
403 status
= sendaux (vec
, vecp
, program
, tmpdrf
, st
);
404 (void) m_unlink (tmpdrf
);
409 * This is so sendaux will only annotate
410 * the altmsg the first time it is called.
418 fclose (in
); /* close the draft */
424 * Annotate original message, and
425 * call `postproc' (which is passed down in "program") to send message.
429 sendaux (char **vec
, int vecp
, char *program
, char *drft
, struct stat
*st
)
433 char backup
[BUFSIZ
], buf
[BUFSIZ
];
435 fd
= pushsw
? tmp_fd () : NOTOK
;
439 if ((fd2
= tmp_fd ()) != NOTOK
) {
440 vec
[vecp
++] = "-idanno";
441 snprintf (buf
, sizeof(buf
), "%d", fd2
);
444 inform("unable to create temporary file in %s for "
445 "annotation list, continuing...", get_temp_dir());
449 if (distfile
&& distout (drft
, distfile
, backup
) == NOTOK
)
456 /* oops -- fork error */
457 adios ("fork", "unable to");
458 break; /* NOT REACHED */
462 * child process -- send it
464 * If fd is OK, then we are pushing and fd points to temp
465 * file, so capture anything on stdout and stderr there.
468 dup2 (fd
, fileno (stdout
));
469 dup2 (fd
, fileno (stderr
));
472 execvp (program
, vec
);
473 fprintf (stderr
, "unable to exec ");
479 * parent process -- wait for it
481 if ((status
= pidwait(child_id
, NOTOK
)) == OK
) {
482 if (annotext
&& fd2
!= NOTOK
)
486 * If postproc failed, and we have good fd (which means
487 * we pushed), then mail error message (and possibly the
488 * draft) back to the user.
494 inform("message not delivered to anyone");
496 if (annotext
&& fd2
!= NOTOK
)
499 (void) m_unlink (drft
);
500 if (rename (backup
, drft
) == NOTOK
)
501 advise (drft
, "unable to rename %s to", backup
);
512 * Mail error notification (and possibly a copy of the
513 * message) back to the user, using the mailproc
517 alert (char *file
, int out
)
528 /* oops -- fork error */
529 advise ("fork", "unable to");
533 /* child process -- send it */
534 SIGNAL (SIGHUP
, SIG_IGN
);
535 SIGNAL (SIGINT
, SIG_IGN
);
536 SIGNAL (SIGQUIT
, SIG_IGN
);
537 SIGNAL (SIGTERM
, SIG_IGN
);
539 if ((in
= open (file
, O_RDONLY
)) == NOTOK
) {
540 admonish (file
, "unable to re-open");
542 lseek(out
, 0, SEEK_END
);
543 strncpy (buf
, "\nMessage not delivered to anyone.\n", sizeof(buf
));
544 if (write (out
, buf
, strlen (buf
)) < 0) {
545 advise (file
, "write");
547 strncpy (buf
, "\n------- Unsent Draft\n\n", sizeof(buf
));
548 if (write (out
, buf
, strlen (buf
)) < 0) {
549 advise (file
, "write");
551 cpydgst (in
, out
, file
, "temporary file");
553 strncpy (buf
, "\n------- End of Unsent Draft\n", sizeof(buf
));
554 if (write (out
, buf
, strlen (buf
)) < 0) {
555 advise (file
, "write");
557 if (rename (file
, strncpy (buf
, m_backup (file
), sizeof(buf
))) == NOTOK
)
558 admonish (buf
, "unable to rename %s to", file
);
561 lseek(out
, 0, SEEK_SET
);
562 dup2 (out
, fileno (stdin
));
564 /* create subject for error notification */
565 snprintf (buf
, sizeof(buf
), "send failed on %s",
566 forwsw
? "enclosed draft" : file
);
568 arglist
= argsplit(mailproc
, &program
, &argp
);
570 arglist
[argp
++] = getusername();
571 arglist
[argp
++] = "-subject";
572 arglist
[argp
++] = buf
;
573 arglist
[argp
] = NULL
;
575 execvp (program
, arglist
);
576 fprintf (stderr
, "unable to exec ");
580 default: /* no waiting... */
592 if ((tfile
= m_mktemp2(NULL
, invo_name
, &fd
, NULL
)) == NULL
) return NOTOK
;
595 inform("temporary file %s selected", tfile
);
596 else if (m_unlink (tfile
) == NOTOK
)
597 advise (tfile
, "unable to remove");
604 anno (int fd
, struct stat
*st
)
608 static char *cwd
= NULL
;
612 (stat (altmsg
, &st2
) == NOTOK
613 || st
->st_mtime
!= st2
.st_mtime
614 || st
->st_dev
!= st2
.st_dev
615 || st
->st_ino
!= st2
.st_ino
)) {
617 inform("$mhaltmsg mismatch, continuing...");
621 child_id
= debugsw
? NOTOK
: fork ();
623 case NOTOK
: /* oops */
625 inform("unable to fork, so doing annotations by hand...");
627 cwd
= mh_xstrdup(pwd ());
631 /* block a few signals */
633 sigaddset (&set
, SIGHUP
);
634 sigaddset (&set
, SIGINT
);
635 sigaddset (&set
, SIGQUIT
);
636 sigaddset (&set
, SIGTERM
);
637 sigprocmask (SIG_BLOCK
, &set
, &oset
);
639 unregister_for_removal(0);
645 /* reset the signal mask */
646 sigprocmask (SIG_SETMASK
, &oset
, &set
);
648 if (chdir (cwd
) < 0) {
649 advise (cwd
, "chdir");
653 default: /* no waiting... */
663 int fd2
, fd3
, msgnum
;
664 char *cp
, *folder
, *maildir
;
665 char buffer
[BUFSIZ
], **ap
;
669 if ((folder
= getenv ("mhfolder")) == NULL
|| *folder
== 0) {
671 inform("$mhfolder not set, continuing...");
674 maildir
= m_maildir (folder
);
675 if (chdir (maildir
) == NOTOK
) {
677 admonish (maildir
, "unable to change directory to");
680 if (!(mp
= folder_read (folder
, 0))) {
682 inform("unable to read folder %s, continuing...", folder
);
686 /* check for empty folder */
687 if (mp
->nummsg
== 0) {
689 inform("no messages in %s, continuing...", folder
);
693 if ((cp
= getenv ("mhmessages")) == NULL
|| *cp
== 0) {
695 inform("$mhmessages not set, continuing...");
698 if (!debugsw
/* MOBY HACK... */
700 && (fd3
= open ("/dev/null", O_RDWR
)) != NOTOK
701 && (fd2
= dup (fileno (stderr
))) != NOTOK
) {
702 dup2 (fd3
, fileno (stderr
));
707 for (ap
= brkstring (cp
= mh_xstrdup(cp
), " ", NULL
); *ap
; ap
++)
711 dup2 (fd2
, fileno (stderr
));
712 if (mp
->numsel
== 0) {
714 inform("no messages to annotate, continuing...");
718 lseek(fd
, 0, SEEK_SET
);
719 if ((fp
= fdopen (fd
, "r")) == NULL
) {
721 inform("unable to fdopen annotation list, continuing...");
725 while (fgets (buffer
, sizeof(buffer
), fp
) != NULL
)
726 cp
= add (buffer
, cp
);
730 inform("annotate%s with %s: \"%s\"",
731 inplace
? " inplace" : "", annotext
, cp
);
732 for (msgnum
= mp
->lowsel
; msgnum
<= mp
->hghsel
; msgnum
++) {
733 if (is_selected(mp
, msgnum
)) {
735 inform("annotate message %d", msgnum
);
736 annotate (m_name (msgnum
), annotext
, cp
, inplace
, 1, -2, 0);
743 folder_free (mp
); /* free folder/message structure */
748 handle_sendfrom(char **vec
, int *vecp
, char *draft
, const char *auth_svc
)
750 const char *addr
, *host
;
753 /* Extract address and host from From: header line in draft. */
754 if (get_from_header_info(draft
, &addr
, &host
, &message
) != OK
) {
755 adios(draft
, "%s", message
);
758 /* Merge in any address or host specific switches to post(1) from profile. */
759 merge_profile_entry(addr
, host
, vec
, vecp
);
768 for (vp
= vec
; *vp
; ++vp
) {
769 if (strcmp(*vp
, "xoauth2") == 0) {
771 if (setup_oauth_params(vec
, vecp
, auth_svc
, &message
) != OK
) {
776 NMH_UNUSED(auth_svc
);
777 die("send built without OAUTH_SUPPORT, "
778 "so -saslmech xoauth2 is not supported");
779 #endif /* OAUTH_SUPPORT */
788 * For XOAUTH2, append profile entries so post can do the heavy lifting
791 setup_oauth_params(char *vec
[], int *vecp
, const char *auth_svc
,
792 const char **message
)
794 const char *saslmech
= NULL
, *user
= NULL
;
795 mh_oauth_service_info svc
;
799 /* Make sure we have all the information we need. */
800 for (i
= 1; i
< *vecp
; ++i
) {
801 /* Don't support abbreviated switches, to avoid collisions in the
802 future if new ones are added. */
803 if (! strcmp(vec
[i
-1], "-saslmech")) {
805 } else if (! strcmp(vec
[i
-1], "-user")) {
807 } else if (! strcmp(vec
[i
-1], "-authservice")) {
812 if (auth_svc
== NULL
) {
813 if (saslmech
&& ! strcasecmp(saslmech
, "xoauth2")) {
814 *message
= "must specify -authservice with -saslmech xoauth2";
819 *message
= "must specify -user with -saslmech xoauth2";
823 if (saslmech
&& ! strcasecmp(saslmech
, "xoauth2")) {
824 if (! mh_oauth_get_service_info(auth_svc
, &svc
, errbuf
,
826 die("Unable to retrieve oauth profile entries: %s",
829 vec
[(*vecp
)++] = mh_xstrdup("-authservice");
830 vec
[(*vecp
)++] = mh_xstrdup(auth_svc
);
831 vec
[(*vecp
)++] = mh_xstrdup("-oauthcredfile");
832 vec
[(*vecp
)++] = mh_oauth_cred_fn(auth_svc
);
833 vec
[(*vecp
)++] = mh_xstrdup("-oauthclientid");
834 vec
[(*vecp
)++] = getcpy(svc
.client_id
);
835 vec
[(*vecp
)++] = mh_xstrdup("-oauthclientsecret");
836 vec
[(*vecp
)++] = getcpy(svc
.client_secret
);
837 vec
[(*vecp
)++] = mh_xstrdup("-oauthauthendpoint");
838 vec
[(*vecp
)++] = getcpy(svc
.auth_endpoint
);
839 vec
[(*vecp
)++] = mh_xstrdup("-oauthredirect");
840 vec
[(*vecp
)++] = getcpy(svc
.redirect_uri
);
841 vec
[(*vecp
)++] = mh_xstrdup("-oauthtokenendpoint");
842 vec
[(*vecp
)++] = getcpy(svc
.token_endpoint
);
843 vec
[(*vecp
)++] = mh_xstrdup("-oauthscope");
844 vec
[(*vecp
)++] = getcpy(svc
.scope
);
850 #endif /* OAUTH_SUPPORT */
854 * Extract user and domain from From: header line in draft.
857 get_from_header_info(const char *filename
, const char **addr
, const char **host
, const char **message
)
862 if (stat (filename
, &st
) == NOTOK
) {
863 *message
= "unable to stat draft file";
867 if ((in
= fopen (filename
, "r")) != NULL
) {
868 /* There must be a non-blank Envelope-From or {Resent-}Sender or
869 {Resent-}From header. */
870 char *addrformat
= "%(addr{Envelope-From})";
871 char *hostformat
= "%(host{Envelope-From})";
873 if ((*addr
= get_message_header_info (in
, addrformat
)) == NULL
||
875 addrformat
= distfile
== NULL
? "%(addr{Sender})" : "%(addr{Resent-Sender})";
876 hostformat
= distfile
== NULL
? "%(host{Sender})" : "%(host{Resent-Sender})";
878 if ((*addr
= get_message_header_info (in
, addrformat
)) == NULL
) {
879 addrformat
= distfile
== NULL
? "%(addr{From})" : "%(addr{Resent-From})";
880 hostformat
= distfile
== NULL
? "%(host{From})" : "%(host{Resent-From})";
882 if ((*addr
= get_message_header_info (in
, addrformat
)) == NULL
) {
883 *message
= "unable to find sender address in";
890 /* Use the hostformat that corresponds to the successful addrformat. */
891 if ((*host
= get_message_header_info(in
, hostformat
)) == NULL
) {
892 *message
= "unable to find sender host";
901 *message
= "unable to open";
907 * Get formatted information from header of a message.
908 * Adapted from process_single_file() in uip/fmttest.c.
911 get_message_header_info(FILE *in
, char *format
)
917 m_getfld_state_t gstate
;
918 charstring_t buffer
= charstring_create(0);
921 dat
[0] = dat
[1] = dat
[4] = 0;
922 dat
[2] = fstat(fileno(in
), &st
) == 0 ? st
.st_size
: 0;
925 (void) fmt_compile(new_fs(NULL
, NULL
, format
), &fmt
, 1);
929 * Read in the message and process the header.
932 parsing_header
= true;
933 gstate
= m_getfld_state_init(in
);
935 char name
[NAMESZ
], rbuf
[NMH_BUFSIZ
];
936 int bufsz
= sizeof rbuf
;
937 int state
= m_getfld2(&gstate
, name
, rbuf
, &bufsz
);
942 int bucket
= fmt_addcomptext(name
, rbuf
);
945 while (state
== FLDPLUS
) {
947 state
= m_getfld2(&gstate
, name
, rbuf
, &bufsz
);
948 fmt_appendcomp(bucket
, name
, rbuf
);
952 while (state
== FLDPLUS
) {
954 state
= m_getfld2(&gstate
, name
, rbuf
, &bufsz
);
959 parsing_header
= false;
961 } while (parsing_header
);
962 m_getfld_state_destroy(&gstate
);
964 fmt_scan(fmt
, buffer
, INT_MAX
, dat
, NULL
);
967 /* Trim trailing newline, if any. */
968 retval
= rtrim(charstring_buffer_copy((buffer
)));
969 charstring_free(buffer
);
979 * Look in profile for entry corresponding to addr or host, and add its contents to vec.
981 * Could do some of this automatically, by looking for:
982 * 1) access-$(mbox{from}) in oauth-svc file using mh_oauth_cred_load(), which isn't
983 * static and doesn't have side effects; free the result with mh_oauth_cred_free())
984 * 2) machine $(mbox{from}) in creds
985 * If no -server passed in from profile or commandline, could use smtp.<svc>.com for gmail,
986 * but that might not generalize for other svcs.
989 merge_profile_entry(const char *addr
, const char *host
, char *vec
[], int *vecp
)
991 char *addr_entry
= concat("sendfrom-", addr
, NULL
);
992 char *profile_entry
= context_find(addr_entry
);
995 if (profile_entry
== NULL
) {
996 /* No entry for the user. Look for one for the host. */
997 char *host_entry
= concat("sendfrom-", host
, NULL
);
999 profile_entry
= context_find(host_entry
);
1003 /* Use argsplit() to do the real work of splitting the args in the profile entry. */
1004 if (profile_entry
&& *profile_entry
) {
1007 char **profile_vec
= argsplit(profile_entry
, &file
, &profile_vecp
);
1010 for (i
= 0; i
< profile_vecp
; ++i
) {
1011 vec
[(*vecp
)++] = getcpy(profile_vec
[i
]);
1014 arglist_free(file
, profile_vec
);
1019 static void NORETURN
1020 armed_done (int status
)
1022 longjmp (env
, status
? status
: NOTOK
);