[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 08/31: utils/settrans: add option to specify the underlying node
From: |
Samuel Thibault |
Subject: |
[hurd] 08/31: utils/settrans: add option to specify the underlying node |
Date: |
Mon, 02 May 2016 23:48:31 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit 6ff6261bb8b2bcf419689fdae4b68f6114f014a3
Author: Justus Winter <address@hidden>
Date: Thu Mar 24 20:45:01 2016 +0100
utils/settrans: add option to specify the underlying node
* utils/settrans.c (options): Add '--underlying'.
(main): Handle new option.
(open_node): Open the node if given.
---
utils/settrans.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/utils/settrans.c b/utils/settrans.c
index 399bd12..e01906b 100644
--- a/utils/settrans.c
+++ b/utils/settrans.c
@@ -64,6 +64,8 @@ static struct argp_option options[] =
{"exclusive", 'x', 0, 0, "Only set the translator if there is not one
already"},
{"orphan", 'o', 0, 0, "Disconnect old translator from the filesystem "
"(do not ask it to go away)"},
+ {"underlying", 'U', "NODE", 0, "Open NODE and hand it to the translator "
+ "as the underlying node"},
{"chroot", 'C', 0, 0,
"Instead of setting the node's translator, take following arguments up to"
@@ -157,6 +159,7 @@ main(int argc, char *argv[])
char *pid_file = NULL;
int excl = 0;
int timeout = DEFAULT_TIMEOUT * 1000; /* ms */
+ char *underlying_node_name = NULL;
char **chroot_command = 0;
char *chroot_chdir = "/";
@@ -202,6 +205,11 @@ main(int argc, char *argv[])
break;
case 'o': orphan = 1; break;
+ case 'U':
+ underlying_node_name = strdup (arg);
+ if (underlying_node_name == NULL)
+ error(3, ENOMEM, "Failed to duplicate argument");
+ break;
case 'C':
if (chroot_command)
@@ -330,7 +338,20 @@ main(int argc, char *argv[])
return open_err;
}
- *underlying = node;
+ if (underlying_node_name)
+ {
+ *underlying = file_name_lookup (underlying_node_name,
+ flags | lookup_flags, 0666);
+ if (! MACH_PORT_VALID (*underlying))
+ {
+ /* For the error message. */
+ node_name = underlying_node_name;
+ open_err = errno;
+ return open_err;
+ }
+ }
+ else
+ *underlying = node;
*underlying_type = MACH_MSG_TYPE_COPY_SEND;
return 0;
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 12/31: Fix access mode of temporary files, (continued)
- [hurd] 12/31: Fix access mode of temporary files, Samuel Thibault, 2016/05/02
- [hurd] 02/31: Fix swap information numbers, Samuel Thibault, 2016/05/02
- [hurd] 19/31: libpager: add missing include, Samuel Thibault, 2016/05/02
- [hurd] 09/31: Make make install idempotent, Samuel Thibault, 2016/05/02
- [hurd] 23/31: startup: implement bits of the fs and io protocols, Samuel Thibault, 2016/05/02
- [hurd] 11/31: libfshelp: pass cookie to the callback function, Samuel Thibault, 2016/05/02
- [hurd] 13/31: Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/hurd, Samuel Thibault, 2016/05/02
- [hurd] 20/31: libshouldbeinlibc: add assert(3) variant that prints backtraces, Samuel Thibault, 2016/05/02
- [hurd] 07/31: utils/settrans: get an authenticated root node in chroot mode, Samuel Thibault, 2016/05/02
- [hurd] 06/31: isofs: make superblock detection more robust, Samuel Thibault, 2016/05/02
- [hurd] 08/31: utils/settrans: add option to specify the underlying node,
Samuel Thibault <=
- [hurd] 31/31: Fix build, Samuel Thibault, 2016/05/02
- [hurd] 29/31: libihash: keep track of free slots, Samuel Thibault, 2016/05/02
- [hurd] 10/31: mach-defpager: fix error handling, Samuel Thibault, 2016/05/02
- [hurd] 30/31: libihash: rehash if effective load exceeds the threshold, Samuel Thibault, 2016/05/02
- [hurd] 26/31: startup: write all messages to stderr, Samuel Thibault, 2016/05/02
- [hurd] 27/31: Fix root operations on trivfs-translated nodes, Samuel Thibault, 2016/05/02
- [hurd] 16/31: libtrivfs: fix notion of privileged user, Samuel Thibault, 2016/05/02
- [hurd] 28/31: libihash: fix index computation, Samuel Thibault, 2016/05/02
- [hurd] 24/31: startup: add verbose parameter, Samuel Thibault, 2016/05/02
- [hurd] 25/31: startup: use the generated default server implementations, Samuel Thibault, 2016/05/02