summaryrefslogtreecommitdiff
path: root/mu/shell.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2010-12-07 17:58:15 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2010-12-07 18:14:03 +0200
commit04c2931bb963fefd4654ef2de2cf0667cf8a333d (patch)
tree6590f36036e32f9aaf84e4eb9355cf810fbfd5e5 /mu/shell.c
parentac08a8575ae8ea3b85180bd05464a48768f398ee (diff)
downloadmailutils-04c2931bb963fefd4654ef2de2cf0667cf8a333d.tar.gz
mailutils-04c2931bb963fefd4654ef2de2cf0667cf8a333d.tar.bz2
Rewrite prog stream support.
Two interfaces are provided: mu_prog_stream_create offers full control over the program execution environment (i.e. running privileges, cwd, resource limits) via a set of hints. A simpler interface, mu_command_stream_create, runs the command in the current environment. mu_filter_prog_stream_create is removed, because its functionality can be achieved by a correspondingly crafted set of hints to mu_prog_stream_create. * include/mailutils/prog.h: New file. * include/mailutils/mailutils.h: Include mailutils/prog.h * include/mailutils/Makefile.am (pkginclude_HEADERS): Add prog.h * include/mailutils/stream.h (mu_prog_stream_create) (mu_filter_prog_stream_create): Remove prototypes. * include/mailutils/sys/prog_stream.h (_mu_prog_stream): Change structure. (_mu_prog_limit_codes, _mu_prog_limit_flags): New externs. * include/mailutils/util.h (mu_set_user_privileges) (mu_switch_to_privs): New prototypes. * lib/userprivs.c: Move to libmailutils/base. * lib/Makefile.am (libmuaux_a_SOURCES): Remove userprivs.c * libmailutils/base/Makefile.am (libbase_la_SOURCES): Add userprivs.c * libmailutils/base/userprivs.c (mu_set_user_privileges): New function. (mu_switch_to_privs): Rewrite as another entry point to mu_set_user_privileges. * libmailutils/stream/prog_stream.c (_mu_prog_limit_flags) (_mu_prog_limit_codes): New global variables. (start_program_filter): Use hints to control execution environment. (_prog_stream_create): Save hints. (mu_prog_stream_create): Change signature. (mu_command_stream_create): New function (corresponds to the prior mu_prog_stream_create). (mu_filter_prog_stream_create): Remove function. * comsat/action.c (action_exec): Use new mu_prog_stream_create calling convention. * examples/murun.c: Rewrite. * mh/mhn.c (show_internal): Use new mu_prog_stream_create calling convention. * mh/tests/mhn.at: Reflect changes to mhn. * imap4d/preauth.c: Use mu_command_stream_create. * libmu_sieve/extensions/pipe.c * mail/decode.c * mail/pipe.c * mail/send.c * mh/mhl.c * mu/shell.c * mail/mail.h: Include mailutils/prog.h * mh/mh.h * po/POTFILES.in: Add libmailutils/base/userprivs.c.
Diffstat (limited to 'mu/shell.c')
-rw-r--r--mu/shell.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mu/shell.c b/mu/shell.c
index 76bd2c604..45e3797b3 100644
--- a/mu/shell.c
+++ b/mu/shell.c
@@ -240,7 +240,7 @@ mutool_open_pager ()
if (mutool_shell_interactive && (pager = getenv ("PAGER")) != NULL)
{
mu_stream_t stream;
- int rc = mu_prog_stream_create (&stream, pager, MU_STREAM_WRITE);
+ int rc = mu_command_stream_create (&stream, pager, MU_STREAM_WRITE);
if (rc == 0)
return stream;
mu_error (_("cannot start pager: %s"), mu_strerror (rc));

Return to:

Send suggestions and report system problems to the System administrator.