[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 12/28: boot: Use the smallest possible name when inserting rights
From: |
Samuel Thibault |
Subject: |
[hurd] 12/28: boot: Use the smallest possible name when inserting rights. |
Date: |
Wed, 16 Nov 2016 08:30:26 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit dfd5134090dd80957dce5a65b467aafaff47ca3b
Author: Justus Winter <address@hidden>
Date: Tue Nov 1 12:29:25 2016 +0100
boot: Use the smallest possible name when inserting rights.
* boot/userland-boot.c (boot_script_insert_right): Use the smallest
possible name instead of the local name.
---
boot/userland-boot.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/boot/userland-boot.c b/boot/userland-boot.c
index d048c00..7b85614 100644
--- a/boot/userland-boot.c
+++ b/boot/userland-boot.c
@@ -90,14 +90,23 @@ boot_script_free_task (task_t task, int aborting)
int
boot_script_insert_right (struct cmd *cmd, mach_port_t port, mach_port_t *name)
{
- error_t err = mach_port_insert_right (cmd->task,
- port, port, MACH_MSG_TYPE_COPY_SEND);
+ error_t err;
+
+ *name = MACH_PORT_NULL;
+ do
+ {
+ *name += 1;
+ err = mach_port_insert_right (cmd->task,
+ *name, port, MACH_MSG_TYPE_COPY_SEND);
+ }
+ while (err == KERN_NAME_EXISTS);
+
if (err)
{
error (0, err, "%s: mach_port_insert_right", cmd->path);
return BOOT_SCRIPT_MACH_ERROR;
}
- *name = port;
+
return 0;
}
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] branch upstream updated (341f43d -> 385d9bf), Samuel Thibault, 2016/11/16
- [hurd] 06/28: libdiskfs: fix removal of socket nodes, Samuel Thibault, 2016/11/16
- [hurd] 01/28: libdiskfs: Fix timestamp update on file close, Samuel Thibault, 2016/11/16
- [hurd] 04/28: wire console display pages, Samuel Thibault, 2016/11/16
- [hurd] 02/28: libdiskfs: Make utimes RPC flush pending timestamp updates, Samuel Thibault, 2016/11/16
- [hurd] 11/28: startup: Dump processes if we cannot find the kernel., Samuel Thibault, 2016/11/16
- [hurd] 03/28: Fix typo, Samuel Thibault, 2016/11/16
- [hurd] 12/28: boot: Use the smallest possible name when inserting rights.,
Samuel Thibault <=
- [hurd] 15/28: boot: restore terminal state on exit, Samuel Thibault, 2016/11/16
- [hurd] 18/28: boot: Tidy up the argument parser., Samuel Thibault, 2016/11/16
- [hurd] 24/28: eth-multiplexer: Avoid local definitions., Samuel Thibault, 2016/11/16
- [hurd] 28/28: libpager: fix returning error on data_unlock, Samuel Thibault, 2016/11/16
- [hurd] 08/28: proc: Fix new task notifications., Samuel Thibault, 2016/11/16
- [hurd] 19/28: Adjust to the fixed new task notifications., Samuel Thibault, 2016/11/16
- [hurd] 22/28: eth-multiplexer: Fix packet delivery., Samuel Thibault, 2016/11/16
- [hurd] 16/28: boot: Allow unprivileged users to boot Subhurds., Samuel Thibault, 2016/11/16
- [hurd] 17/28: boot: Add a default boot script., Samuel Thibault, 2016/11/16
- [hurd] 10/28: Add missing spinlock initializers, Samuel Thibault, 2016/11/16