summaryrefslogtreecommitdiff
path: root/debian/patches/fixes0003-utils-settrans-implement-active-translator-stacking.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/fixes0003-utils-settrans-implement-active-translator-stacking.patch')
-rw-r--r--debian/patches/fixes0003-utils-settrans-implement-active-translator-stacking.patch88
1 files changed, 88 insertions, 0 deletions
diff --git a/debian/patches/fixes0003-utils-settrans-implement-active-translator-stacking.patch b/debian/patches/fixes0003-utils-settrans-implement-active-translator-stacking.patch
new file mode 100644
index 00000000..517dbd4d
--- /dev/null
+++ b/debian/patches/fixes0003-utils-settrans-implement-active-translator-stacking.patch
@@ -0,0 +1,88 @@
+From a997b1b4dec0c5de8165f34b66840d270b489788 Mon Sep 17 00:00:00 2001
+From: Justus Winter <justus@gnupg.org>
+Date: Sat, 23 Apr 2016 17:39:47 +0200
+Subject: [PATCH hurd 3/5] utils/settrans: implement active translator stacking
+
+* utils/settrans.c (OPT_STACK): New macro.
+(options): New option.
+(main): Handle new option.
+(open_node): Use different flags for the lookup of the underlying
+node.
+---
+ utils/settrans.c | 21 ++++++++++++++++++++-
+ 1 file changed, 20 insertions(+), 1 deletion(-)
+
+diff --git a/utils/settrans.c b/utils/settrans.c
+index e01906b..ee7cba5 100644
+--- a/utils/settrans.c
++++ b/utils/settrans.c
+@@ -47,6 +47,7 @@ const char *argp_program_version = STANDARD_HURD_VERSION (settrans);
+ #define STRINGIFY(arg) _STRINGIFY (arg)
+
+ #define OPT_CHROOT_CHDIR -1
++#define OPT_STACK -2
+
+ static struct argp_option options[] =
+ {
+@@ -66,6 +67,8 @@ static struct argp_option options[] =
+ "(do not ask it to go away)"},
+ {"underlying", 'U', "NODE", 0, "Open NODE and hand it to the translator "
+ "as the underlying node"},
++ {"stack", OPT_STACK, 0, 0, "Replace an existing translator, but keep it "
++ "running, and put the new one on top"},
+
+ {"chroot", 'C', 0, 0,
+ "Instead of setting the node's translator, take following arguments up to"
+@@ -156,10 +159,12 @@ main(int argc, char *argv[])
+ int passive = 0, active = 0, keep_active = 0, pause = 0, kill_active = 0,
+ orphan = 0;
+ int start = 0;
++ int stack = 0;
+ char *pid_file = NULL;
+ int excl = 0;
+ int timeout = DEFAULT_TIMEOUT * 1000; /* ms */
+ char *underlying_node_name = NULL;
++ int underlying_lookup_flags;
+ char **chroot_command = 0;
+ char *chroot_chdir = "/";
+
+@@ -193,6 +198,11 @@ main(int argc, char *argv[])
+ start = 1;
+ active = 1; /* start implies active */
+ break;
++ case OPT_STACK:
++ stack = 1;
++ active = 1; /* stack implies active */
++ orphan = 1; /* stack implies orphan */
++ break;
+ case 'p': passive = 1; break;
+ case 'k': keep_active = 1; break;
+ case 'g': kill_active = 1; break;
+@@ -261,6 +271,14 @@ main(int argc, char *argv[])
+
+ argp_parse (&argp, argc, argv, ARGP_IN_ORDER, 0, 0);
+
++ if (stack)
++ {
++ underlying_node_name = node_name;
++ underlying_lookup_flags = lookup_flags && ~O_NOTRANS;
++ }
++ else
++ underlying_lookup_flags = lookup_flags;
++
+ if (!active && !passive && !chroot_command)
+ passive = 1; /* By default, set the passive translator. */
+
+@@ -341,7 +359,8 @@ main(int argc, char *argv[])
+ if (underlying_node_name)
+ {
+ *underlying = file_name_lookup (underlying_node_name,
+- flags | lookup_flags, 0666);
++ flags | underlying_lookup_flags,
++ 0666);
+ if (! MACH_PORT_VALID (*underlying))
+ {
+ /* For the error message. */
+--
+2.1.4
+