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 <h/fmt_scan.h>
10 #include <h/fmt_compile.h>
11 #include <h/signals.h>
19 #ifdef HAVE_SYS_TIME_H
20 # include <sys/time.h>
27 static int setup_oauth_params(char *[], int *, const char *, const char **);
28 #endif /* OAUTH_SUPPORT */
30 int debugsw
= 0; /* global */
38 char *altmsg
= NULL
; /* .. */
39 char *annotext
= NULL
;
40 char *distfile
= NULL
;
47 static void alert (char *, int);
48 static int tmp_fd (void);
49 static void anno (int, struct stat
*);
50 static void annoaux (int);
51 static int splitmsg (char **, int, char *, char *, struct stat
*, int);
52 static int sendaux (char **, int, char *, char *, struct stat
*);
53 static void handle_sendfrom(char **, int *, char *, const char *);
54 static int get_from_header_info(const char *, const char **, const char **, const char **);
55 static const char *get_message_header_info(FILE *, char *);
56 static void merge_profile_entry(const char *, const char *, char *[], int *);
57 static void armed_done (int) NORETURN
;
60 * Entry point into (back-end) routines to send message.
64 sendsbr (char **vec
, int vecp
, char *program
, char *draft
, struct stat
*st
,
65 int rename_drft
, const char *auth_svc
)
69 char buffer
[BUFSIZ
], file
[BUFSIZ
];
71 char **buildvec
, *buildprogram
;
72 char *volatile drft
= draft
;
73 /* nvecs is volatile to prevent warning from gcc about possible clobbering
75 volatile int nvecs
= vecp
;
76 int *nvecsp
= (int *) &nvecs
;
79 * Run the mimebuildproc (which is by default mhbuild) on the message
80 * with the addition of the "-auto" flag
83 switch (child
= fork()) {
85 adios("fork", "unable to");
89 buildvec
= argsplit(buildmimeproc
, &buildprogram
, &i
);
90 buildvec
[i
++] = "-auto";
92 buildvec
[i
++] = "-dist";
93 buildvec
[i
++] = (char *) drft
;
95 execvp(buildprogram
, buildvec
);
96 fprintf(stderr
, "unable to exec ");
97 perror(buildmimeproc
);
102 if (pidXwait(child
, buildmimeproc
))
108 switch (setjmp (env
)) {
111 * If given -push and -unique (which is undocumented), then
112 * rename the draft file. I'm not quite sure why.
114 if (pushsw
&& unique
) {
115 char *cp
= m_mktemp2(drft
, invo_name
, NULL
, NULL
);
117 adios(NULL
, "unable to create temporary file in %s",
120 if (rename (drft
, strncpy(file
, cp
, sizeof(file
))) == NOTOK
)
121 adios (file
, "unable to rename %s to", drft
);
126 * Add in any necessary profile entries for xoauth
132 if (setup_oauth_params(vec
, nvecsp
, auth_svc
, &errmsg
) != OK
) {
136 adios(NULL
, "send built without OAUTH_SUPPORT, "
137 "so auth_svc %s is not supported", auth_svc
);
138 #endif /* OAUTH_SUPPORT */
142 * Rework the vec based on From: header in draft, as specified
143 * by sendfrom-address entries in profile.
145 if (context_find_prefix("sendfrom-")) {
146 handle_sendfrom(vec
, nvecsp
, draft
, auth_svc
);
150 * Check if we need to split the message into
151 * multiple messages of type "message/partial".
153 if (splitsw
>= 0 && !distfile
&& stat ((char *) drft
, &sts
) != NOTOK
154 && sts
.st_size
>= CPERMSG
) {
155 status
= splitmsg (vec
, nvecs
, program
, drft
,
156 st
, splitsw
) ? NOTOK
: OK
;
158 status
= sendaux (vec
, nvecs
, program
, drft
, st
) ? NOTOK
: OK
;
161 /* rename the original draft */
162 if (rename_drft
&& status
== OK
&&
163 rename (drft
, strncpy (buffer
, m_backup (drft
),
164 sizeof(buffer
))) == NOTOK
)
165 advise (buffer
, "unable to rename %s to", drft
);
175 (void) m_unlink (distfile
);
181 * Split large message into several messages of
182 * type "message/partial" and send them.
186 splitmsg (char **vec
, int vecp
, char *program
, char *drft
,
187 struct stat
*st
, int delay
)
189 int compnum
, nparts
, partno
, state
, status
;
192 char *cp
, *dp
, buffer
[NMH_BUFSIZ
], msgid
[BUFSIZ
];
193 char subject
[BUFSIZ
];
194 char name
[NAMESZ
], partnum
[BUFSIZ
];
196 m_getfld_state_t gstate
= 0;
198 if ((in
= fopen (drft
, "r")) == NULL
)
199 adios (drft
, "unable to open for reading");
205 * Scan through the message and examine the various header fields,
206 * as well as locate the beginning of the message body.
208 m_getfld_track_filepos (&gstate
, in
);
209 for (compnum
= 1;;) {
210 int bufsz
= sizeof buffer
;
211 switch (state
= m_getfld (&gstate
, name
, buffer
, &bufsz
, in
)) {
217 * This header field is discarded.
219 if (!strcasecmp (name
, "Message-ID")) {
220 while (state
== FLDPLUS
) {
221 bufsz
= sizeof buffer
;
222 state
= m_getfld (&gstate
, name
, buffer
, &bufsz
, in
);
224 } else if (uprf (name
, XXX_FIELD_PRF
)
225 || !strcasecmp (name
, VRSN_FIELD
)
226 || !strcasecmp (name
, "Subject")
227 || !strcasecmp (name
, "Encrypted")) {
229 * These header fields are copied to the enclosed
230 * header of the first message in the collection
231 * of message/partials. For the "Subject" header
232 * field, we also record it, so that a modified
233 * version of it, can be copied to the header
234 * of each message/partial in the collection.
236 if (!strcasecmp (name
, "Subject")) {
239 strncpy (subject
, buffer
, BUFSIZ
);
240 sublen
= strlen (subject
);
241 if (sublen
> 0 && subject
[sublen
- 1] == '\n')
242 subject
[sublen
- 1] = '\0';
245 dp
= add (concat (name
, ":", buffer
, NULL
), dp
);
246 while (state
== FLDPLUS
) {
247 bufsz
= sizeof buffer
;
248 state
= m_getfld (&gstate
, name
, buffer
, &bufsz
, in
);
249 dp
= add (buffer
, dp
);
253 * These header fields are copied to the header of
254 * each message/partial in the collection.
256 cp
= add (concat (name
, ":", buffer
, NULL
), cp
);
257 while (state
== FLDPLUS
) {
258 bufsz
= sizeof buffer
;
259 state
= m_getfld (&gstate
, name
, buffer
, &bufsz
, in
);
260 cp
= add (buffer
, cp
);
264 start
= ftell (in
) + 1;
273 adios (NULL
, "message format error in component #%d", compnum
);
276 adios (NULL
, "getfld () returned %d", state
);
281 m_getfld_state_destroy (&gstate
);
283 adios (NULL
, "headers missing from draft");
287 while (fgets (buffer
, sizeof buffer
, in
)) {
290 if ((pos
+= (len
= strlen (buffer
))) > CPERMSG
) {
296 /* Only one part, nothing to split */
302 return sendaux (vec
, vecp
, program
, drft
, st
);
306 printf ("Sending as %d Partial Messages\n", nparts
);
311 vec
[vecp
++] = "-partno";
312 vec
[vecp
++] = partnum
;
314 vec
[vecp
++] = "-queued";
317 snprintf (msgid
, sizeof(msgid
), "%s", message_id (clock
, 0));
319 fseek (in
, start
, SEEK_SET
);
320 for (partno
= 1; partno
<= nparts
; partno
++) {
324 char *cp
= m_mktemp2(drft
, invo_name
, NULL
, &out
);
326 adios(NULL
, "unable to create temporary file in %s",
329 strncpy(tmpdrf
, cp
, sizeof(tmpdrf
));
332 * Output the header fields
335 fprintf (out
, "Subject: %s (part %d of %d)\n", subject
, partno
, nparts
);
336 fprintf (out
, "%s: %s\n", VRSN_FIELD
, VRSN_VALUE
);
337 fprintf (out
, "%s: message/partial; id=\"%s\";\n", TYPE_FIELD
, msgid
);
338 fprintf (out
, "\tnumber=%d; total=%d\n", partno
, nparts
);
339 fprintf (out
, "%s: part %d of %d\n\n", DESCR_FIELD
, partno
, nparts
);
342 * If this is the first in the collection, output the
343 * header fields we are encapsulating at the beginning
344 * of the body of the first message.
349 fprintf (out
, "Message-ID: %s\n", msgid
);
357 if (!fgets (buffer
, sizeof buffer
, in
)) {
358 if (partno
== nparts
)
360 adios (NULL
, "premature eof");
363 if ((pos
+= (len
= strlen (buffer
))) > CPERMSG
) {
364 fseek (in
, -len
, SEEK_CUR
);
372 adios (tmpdrf
, "error writing to");
376 if (!pushsw
&& verbsw
) {
381 /* Pause here, if a delay is specified */
382 if (delay
> 0 && 1 < partno
&& partno
<= nparts
) {
384 printf ("pausing %d seconds before sending part %d...\n",
388 sleep ((unsigned int) delay
);
391 snprintf (partnum
, sizeof(partnum
), "%d", partno
);
392 status
= sendaux (vec
, vecp
, program
, tmpdrf
, st
);
393 (void) m_unlink (tmpdrf
);
398 * This is so sendaux will only annotate
399 * the altmsg the first time it is called.
407 fclose (in
); /* close the draft */
413 * Annotate original message, and
414 * call `postproc' (which is passed down in "program") to send message.
418 sendaux (char **vec
, int vecp
, char *program
, char *drft
, struct stat
*st
)
421 int i
, status
, fd
, fd2
;
422 char backup
[BUFSIZ
], buf
[BUFSIZ
];
424 fd
= pushsw
? tmp_fd () : NOTOK
;
428 if ((fd2
= tmp_fd ()) != NOTOK
) {
429 vec
[vecp
++] = "-idanno";
430 snprintf (buf
, sizeof(buf
), "%d", fd2
);
433 inform("unable to create temporary file in %s for "
434 "annotation list, continuing...", get_temp_dir());
438 if (distfile
&& distout (drft
, distfile
, backup
) == NOTOK
)
442 for (i
= 0; (child_id
= fork()) == NOTOK
&& i
< 5; i
++)
447 /* oops -- fork error */
448 adios ("fork", "unable to");
449 break; /* NOT REACHED */
453 * child process -- send it
455 * If fd is OK, then we are pushing and fd points to temp
456 * file, so capture anything on stdout and stderr there.
459 dup2 (fd
, fileno (stdout
));
460 dup2 (fd
, fileno (stderr
));
463 execvp (program
, vec
);
464 fprintf (stderr
, "unable to exec ");
470 * parent process -- wait for it
472 if ((status
= pidwait(child_id
, NOTOK
)) == OK
) {
473 if (annotext
&& fd2
!= NOTOK
)
477 * If postproc failed, and we have good fd (which means
478 * we pushed), then mail error message (and possibly the
479 * draft) back to the user.
485 inform("message not delivered to anyone");
487 if (annotext
&& fd2
!= NOTOK
)
490 (void) m_unlink (drft
);
491 if (rename (backup
, drft
) == NOTOK
)
492 advise (drft
, "unable to rename %s to", backup
);
503 * Mail error notification (and possibly a copy of the
504 * message) back to the user, using the mailproc
508 alert (char *file
, int out
)
516 for (i
= 0; (child_id
= fork()) == NOTOK
&& i
< 5; i
++)
521 /* oops -- fork error */
522 advise ("fork", "unable to");
526 /* child process -- send it */
527 SIGNAL (SIGHUP
, SIG_IGN
);
528 SIGNAL (SIGINT
, SIG_IGN
);
529 SIGNAL (SIGQUIT
, SIG_IGN
);
530 SIGNAL (SIGTERM
, SIG_IGN
);
532 if ((in
= open (file
, O_RDONLY
)) == NOTOK
) {
533 admonish (file
, "unable to re-open");
535 lseek (out
, (off_t
) 0, SEEK_END
);
536 strncpy (buf
, "\nMessage not delivered to anyone.\n", sizeof(buf
));
537 if (write (out
, buf
, strlen (buf
)) < 0) {
538 advise (file
, "write");
540 strncpy (buf
, "\n------- Unsent Draft\n\n", sizeof(buf
));
541 if (write (out
, buf
, strlen (buf
)) < 0) {
542 advise (file
, "write");
544 cpydgst (in
, out
, file
, "temporary file");
546 strncpy (buf
, "\n------- End of Unsent Draft\n", sizeof(buf
));
547 if (write (out
, buf
, strlen (buf
)) < 0) {
548 advise (file
, "write");
550 if (rename (file
, strncpy (buf
, m_backup (file
), sizeof(buf
))) == NOTOK
)
551 admonish (buf
, "unable to rename %s to", file
);
554 lseek (out
, (off_t
) 0, SEEK_SET
);
555 dup2 (out
, fileno (stdin
));
557 /* create subject for error notification */
558 snprintf (buf
, sizeof(buf
), "send failed on %s",
559 forwsw
? "enclosed draft" : file
);
561 arglist
= argsplit(mailproc
, &program
, &argp
);
563 arglist
[argp
++] = getusername();
564 arglist
[argp
++] = "-subject";
565 arglist
[argp
++] = buf
;
566 arglist
[argp
] = NULL
;
568 execvp (program
, arglist
);
569 fprintf (stderr
, "unable to exec ");
573 default: /* no waiting... */
585 if ((tfile
= m_mktemp2(NULL
, invo_name
, &fd
, NULL
)) == NULL
) return NOTOK
;
588 inform("temporary file %s selected", tfile
);
590 if (m_unlink (tfile
) == NOTOK
)
591 advise (tfile
, "unable to remove");
598 anno (int fd
, struct stat
*st
)
602 static char *cwd
= NULL
;
606 (stat (altmsg
, &st2
) == NOTOK
607 || st
->st_mtime
!= st2
.st_mtime
608 || st
->st_dev
!= st2
.st_dev
609 || st
->st_ino
!= st2
.st_ino
)) {
611 inform("$mhaltmsg mismatch, continuing...");
615 child_id
= debugsw
? NOTOK
: fork ();
617 case NOTOK
: /* oops */
619 inform("unable to fork, so doing annotations by hand...");
621 cwd
= mh_xstrdup(pwd ());
625 /* block a few signals */
627 sigaddset (&set
, SIGHUP
);
628 sigaddset (&set
, SIGINT
);
629 sigaddset (&set
, SIGQUIT
);
630 sigaddset (&set
, SIGTERM
);
631 sigprocmask (SIG_BLOCK
, &set
, &oset
);
633 unregister_for_removal(0);
639 /* reset the signal mask */
640 sigprocmask (SIG_SETMASK
, &oset
, &set
);
642 if (chdir (cwd
) < 0) {
643 advise (cwd
, "chdir");
647 default: /* no waiting... */
657 int fd2
, fd3
, msgnum
;
658 char *cp
, *folder
, *maildir
;
659 char buffer
[BUFSIZ
], **ap
;
663 if ((folder
= getenv ("mhfolder")) == NULL
|| *folder
== 0) {
665 inform("$mhfolder not set, continuing...");
668 maildir
= m_maildir (folder
);
669 if (chdir (maildir
) == NOTOK
) {
671 admonish (maildir
, "unable to change directory to");
674 if (!(mp
= folder_read (folder
, 0))) {
676 inform("unable to read folder %s, continuing...", folder
);
680 /* check for empty folder */
681 if (mp
->nummsg
== 0) {
683 inform("no messages in %s, continuing...", folder
);
687 if ((cp
= getenv ("mhmessages")) == NULL
|| *cp
== 0) {
689 inform("$mhmessages not set, continuing...");
692 if (!debugsw
/* MOBY HACK... */
694 && (fd3
= open ("/dev/null", O_RDWR
)) != NOTOK
695 && (fd2
= dup (fileno (stderr
))) != NOTOK
) {
696 dup2 (fd3
, fileno (stderr
));
701 for (ap
= brkstring (cp
= mh_xstrdup(cp
), " ", NULL
); *ap
; ap
++)
705 dup2 (fd2
, fileno (stderr
));
706 if (mp
->numsel
== 0) {
708 inform("no messages to annotate, continuing...");
712 lseek (fd
, (off_t
) 0, SEEK_SET
);
713 if ((fp
= fdopen (fd
, "r")) == NULL
) {
715 inform("unable to fdopen annotation list, continuing...");
719 while (fgets (buffer
, sizeof(buffer
), fp
) != NULL
)
720 cp
= add (buffer
, cp
);
724 inform("annotate%s with %s: \"%s\"",
725 inplace
? " inplace" : "", annotext
, cp
);
726 for (msgnum
= mp
->lowsel
; msgnum
<= mp
->hghsel
; msgnum
++) {
727 if (is_selected(mp
, msgnum
)) {
729 inform("annotate message %d", msgnum
);
730 annotate (m_name (msgnum
), annotext
, cp
, inplace
, 1, -2, 0);
737 folder_free (mp
); /* free folder/message structure */
743 handle_sendfrom(char **vec
, int *vecp
, char *draft
, const char *auth_svc
) {
744 const char *addr
, *host
;
747 /* Extract address and host from From: header line in draft. */
748 if (get_from_header_info(draft
, &addr
, &host
, &message
) != OK
) {
749 adios(draft
, message
);
752 /* Merge in any address or host specific switches to post(1) from profile. */
753 merge_profile_entry(addr
, host
, vec
, vecp
);
762 for (vp
= vec
; *vp
; ++vp
) {
763 if (strcmp(*vp
, "xoauth2") == 0) {
765 if (setup_oauth_params(vec
, vecp
, auth_svc
, &message
) != OK
) {
766 adios(NULL
, message
);
770 NMH_UNUSED(auth_svc
);
771 adios(NULL
, "send built without OAUTH_SUPPORT, "
772 "so -saslmech xoauth2 is not supported");
773 #endif /* OAUTH_SUPPORT */
782 * For XOAUTH2, append profile entries so post can do the heavy lifting
785 setup_oauth_params(char *vec
[], int *vecp
, const char *auth_svc
,
786 const char **message
) {
787 const char *saslmech
= NULL
, *user
= NULL
;
788 mh_oauth_service_info svc
;
792 /* Make sure we have all the information we need. */
793 for (i
= 1; i
< *vecp
; ++i
) {
794 /* Don't support abbreviated switches, to avoid collisions in the
795 future if new ones are added. */
796 if (! strcmp(vec
[i
-1], "-saslmech")) {
798 } else if (! strcmp(vec
[i
-1], "-user")) {
800 } else if (! strcmp(vec
[i
-1], "-authservice")) {
805 if (auth_svc
== NULL
) {
806 if (saslmech
&& ! strcasecmp(saslmech
, "xoauth2")) {
807 *message
= "must specify -authservice with -saslmech xoauth2";
812 *message
= "must specify -user with -saslmech xoauth2";
816 if (saslmech
&& ! strcasecmp(saslmech
, "xoauth2")) {
817 if (! mh_oauth_get_service_info(auth_svc
, &svc
, errbuf
,
819 adios(NULL
, "Unable to retrieve oauth profile entries: %s",
822 vec
[(*vecp
)++] = mh_xstrdup("-authservice");
823 vec
[(*vecp
)++] = mh_xstrdup(auth_svc
);
824 vec
[(*vecp
)++] = mh_xstrdup("-oauthcredfile");
825 vec
[(*vecp
)++] = mh_xstrdup(mh_oauth_cred_fn(auth_svc
));
826 vec
[(*vecp
)++] = mh_xstrdup("-oauthclientid");
827 vec
[(*vecp
)++] = getcpy(svc
.client_id
);
828 vec
[(*vecp
)++] = mh_xstrdup("-oauthclientsecret");
829 vec
[(*vecp
)++] = getcpy(svc
.client_secret
);
830 vec
[(*vecp
)++] = mh_xstrdup("-oauthauthendpoint");
831 vec
[(*vecp
)++] = getcpy(svc
.auth_endpoint
);
832 vec
[(*vecp
)++] = mh_xstrdup("-oauthredirect");
833 vec
[(*vecp
)++] = getcpy(svc
.redirect_uri
);
834 vec
[(*vecp
)++] = mh_xstrdup("-oauthtokenendpoint");
835 vec
[(*vecp
)++] = getcpy(svc
.token_endpoint
);
836 vec
[(*vecp
)++] = mh_xstrdup("-oauthscope");
837 vec
[(*vecp
)++] = getcpy(svc
.scope
);
843 #endif /* OAUTH_SUPPORT */
847 * Extract user and domain from From: header line in draft.
851 get_from_header_info(const char *filename
, const char **addr
, const char **host
, const char **message
) {
855 if (stat (filename
, &st
) == NOTOK
) {
856 *message
= "unable to stat draft file";
860 if ((in
= fopen (filename
, "r")) != NULL
) {
861 /* There must be a non-blank Envelope-From or {Resent-}Sender or
862 {Resent-}From header. */
863 char *addrformat
= "%(addr{Envelope-From})";
864 char *hostformat
= "%(host{Envelope-From})";
866 if ((*addr
= get_message_header_info (in
, addrformat
)) == NULL
||
868 addrformat
= distfile
== NULL
? "%(addr{Sender})" : "%(addr{Resent-Sender})";
869 hostformat
= distfile
== NULL
? "%(host{Sender})" : "%(host{Resent-Sender})";
871 if ((*addr
= get_message_header_info (in
, addrformat
)) == NULL
) {
872 addrformat
= distfile
== NULL
? "%(addr{From})" : "%(addr{Resent-From})";
873 hostformat
= distfile
== NULL
? "%(host{From})" : "%(host{Resent-From})";
875 if ((*addr
= get_message_header_info (in
, addrformat
)) == NULL
) {
876 *message
= "unable to find sender address in";
883 /* Use the hostformat that corresponds to the successful addrformat. */
884 if ((*host
= get_message_header_info(in
, hostformat
)) == NULL
) {
886 *message
= "unable to find sender host in";
895 *message
= "unable to open";
901 * Get formatted information from header of a message.
902 * Adapted from process_single_file() in uip/fmttest.c.
906 get_message_header_info(FILE *in
, char *format
) {
911 m_getfld_state_t gstate
= 0;
912 charstring_t buffer
= charstring_create(0);
915 dat
[0] = dat
[1] = dat
[4] = 0;
916 dat
[2] = fstat(fileno(in
), &st
) == 0 ? st
.st_size
: 0;
919 (void) fmt_compile(new_fs(NULL
, NULL
, format
), &fmt
, 1);
923 * Read in the message and process the header.
928 char name
[NAMESZ
], rbuf
[NMH_BUFSIZ
];
929 int bufsz
= sizeof rbuf
;
930 int state
= m_getfld(&gstate
, name
, rbuf
, &bufsz
, in
);
935 int bucket
= fmt_addcomptext(name
, rbuf
);
938 while (state
== FLDPLUS
) {
940 state
= m_getfld(&gstate
, name
, rbuf
, &bufsz
, in
);
941 fmt_appendcomp(bucket
, name
, rbuf
);
945 while (state
== FLDPLUS
) {
947 state
= m_getfld(&gstate
, name
, rbuf
, &bufsz
, in
);
954 } while (parsing_header
);
955 m_getfld_state_destroy(&gstate
);
957 fmt_scan(fmt
, buffer
, INT_MAX
, dat
, NULL
);
960 /* Trim trailing newline, if any. */
961 retval
= rtrim(charstring_buffer_copy((buffer
)));
962 charstring_free(buffer
);
972 * Look in profile for entry corresponding to addr or host, and add its contents to vec.
974 * Could do some of this automatically, by looking for:
975 * 1) access-$(mbox{from}) in oauth-svc file using mh_oauth_cred_load(), which isn't
976 * static and doesn't have side effects; free the result with mh_oauth_cred_free())
977 * 2) machine $(mbox{from}) in creds
978 * If no -server passed in from profile or commandline, could use smtp.<svc>.com for gmail,
979 * but that might not generalize for other svcs.
983 merge_profile_entry(const char *addr
, const char *host
, char *vec
[], int *vecp
) {
984 char *addr_entry
= concat("sendfrom-", addr
, NULL
);
985 char *profile_entry
= context_find(addr_entry
);
988 if (profile_entry
== NULL
) {
989 /* No entry for the user. Look for one for the host. */
990 char *host_entry
= concat("sendfrom-", host
, NULL
);
992 profile_entry
= context_find(host_entry
);
996 /* Use argsplit() to do the real work of splitting the args in the profile entry. */
997 if (profile_entry
&& *profile_entry
) {
1000 char **profile_vec
= argsplit(profile_entry
, &file
, &profile_vecp
);
1003 for (i
= 0; i
< profile_vecp
; ++i
) {
1004 vec
[(*vecp
)++] = getcpy(profile_vec
[i
]);
1007 arglist_free(file
, profile_vec
);
1013 armed_done (int status
)
1015 longjmp (env
, status
? status
: NOTOK
);