1.1 --- a/libexec/lib/src/process.cc Sun Jan 21 17:56:36 2024 +0100
1.2 +++ b/libexec/lib/src/process.cc Sun Jan 21 18:44:44 2024 +0100
1.3 @@ -1,7 +1,7 @@
1.4 /*
1.5 * Support for initialising programs in new tasks and threads.
1.6 *
1.7 - * Copyright (C) 2022, 2023 Paul Boddie <paul@boddie.org.uk>
1.8 + * Copyright (C) 2022, 2023, 2024 Paul Boddie <paul@boddie.org.uk>
1.9 *
1.10 * This program is free software; you can redistribute it and/or
1.11 * modify it under the terms of the GNU General Public License as
1.12 @@ -144,7 +144,7 @@
1.13 {_env.log, l4re_env()->log, L4_CAP_FPAGE_RWS, 0},
1.14 {_env.scheduler, l4re_env()->scheduler, L4_CAP_FPAGE_RWS, 0},
1.15 {_env.mem_alloc, l4re_env()->mem_alloc, L4_CAP_FPAGE_RWS, 0},
1.16 - {0, L4_INVALID_CAP, 0, 0},
1.17 + {L4_INVALID_CAP, L4_INVALID_CAP, 0, 0},
1.18 };
1.19
1.20 /* Return the capability details for the task. */
2.1 --- a/libexec/lib/src/process_creating.cc Sun Jan 21 17:56:36 2024 +0100
2.2 +++ b/libexec/lib/src/process_creating.cc Sun Jan 21 18:44:44 2024 +0100
2.3 @@ -1,7 +1,7 @@
2.4 /*
2.5 * Support for executing code in new tasks and threads.
2.6 *
2.7 - * Copyright (C) 2022, 2023 Paul Boddie <paul@boddie.org.uk>
2.8 + * Copyright (C) 2022, 2023, 2024 Paul Boddie <paul@boddie.org.uk>
2.9 *
2.10 * This program is free software; you can redistribute it and/or
2.11 * modify it under the terms of the GNU General Public License as
2.12 @@ -215,7 +215,7 @@
2.13 rm_mapped_caps[rm_index++] = (struct ipc_mapped_cap) {_mapped_internal_pager,
2.14 _internal_pager, L4_CAP_FPAGE_RWS,
2.15 L4_FPAGE_C_OBJ_RIGHTS};
2.16 - rm_mapped_caps[rm_index] = (struct ipc_mapped_cap) {0, L4_INVALID_CAP, 0, 0};
2.17 + rm_mapped_caps[rm_index] = (struct ipc_mapped_cap) {L4_INVALID_CAP, L4_INVALID_CAP, 0, 0};
2.18
2.19 /* Map these additional capabilities. */
2.20
2.21 @@ -326,7 +326,7 @@
2.22 struct ipc_mapped_cap program_mapped_caps[] = {
2.23 {fsserver_cap, fsserver, L4_CAP_FPAGE_RWS, L4_FPAGE_C_OBJ_RIGHTS},
2.24 {writer_cap, writer, L4_CAP_FPAGE_RWS, L4_FPAGE_C_OBJ_RIGHTS},
2.25 - {0, L4_INVALID_CAP, 0, 0},
2.26 + {L4_INVALID_CAP, L4_INVALID_CAP, 0, 0},
2.27 };
2.28
2.29 /* Map these additional capabilities. */
3.1 --- a/libipc/lib/src/map.c Sun Jan 21 17:56:36 2024 +0100
3.2 +++ b/libipc/lib/src/map.c Sun Jan 21 18:44:44 2024 +0100
3.3 @@ -1,7 +1,7 @@
3.4 /*
3.5 * Capability mapping between tasks.
3.6 *
3.7 - * Copyright (C) 2022, 2023 Paul Boddie <paul@boddie.org.uk>
3.8 + * Copyright (C) 2022, 2023, 2024 Paul Boddie <paul@boddie.org.uk>
3.9 *
3.10 * This program is free software; you can redistribute it and/or
3.11 * modify it under the terms of the GNU General Public License as
3.12 @@ -46,8 +46,13 @@
3.13 long err = L4_EOK;
3.14 unsigned int i;
3.15
3.16 - for (i = 0; l4_is_valid_cap(mapped_caps[i].cap) && !err; i++)
3.17 - err = ipc_map_capability(task, mapped_caps[i]);
3.18 + /* Use an invalid mapped capability as the sentinel. */
3.19 +
3.20 + for (i = 0; l4_is_valid_cap(mapped_caps[i].mapped_cap) && !err; i++)
3.21 + {
3.22 + if (l4_is_valid_cap(mapped_caps[i].cap))
3.23 + err = ipc_map_capability(task, mapped_caps[i]);
3.24 + }
3.25
3.26 if (count != NULL)
3.27 *count = i;