summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/os/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/uts/common/os/main.c')
-rw-r--r--usr/src/uts/common/os/main.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/usr/src/uts/common/os/main.c b/usr/src/uts/common/os/main.c
index 148916d4d8..c57f8a7d2c 100644
--- a/usr/src/uts/common/os/main.c
+++ b/usr/src/uts/common/os/main.c
@@ -159,7 +159,7 @@ exec_init(const char *initpath, const char *args)
int error = 0, count = 0;
proc_t *p = ttoproc(curthread);
klwp_t *lwp = ttolwp(curthread);
- int brand_action;
+ int brand_action = EBA_NONE;
if (args == NULL)
args = "";
@@ -289,7 +289,15 @@ exec_init(const char *initpath, const char *args)
*/
sigemptyset(&curthread->t_hold);
- brand_action = ZONE_IS_BRANDED(p->p_zone) ? EBA_BRAND : EBA_NONE;
+ /*
+ * Only instruct exec_common to brand the process if necessary. It is
+ * possible that the init process is already properly branded due to the
+ * proc_exit -> restart_init -> exec_init call chain.
+ */
+ if (ZONE_IS_BRANDED(p->p_zone) &&
+ p->p_brand != p->p_zone->zone_brand) {
+ brand_action = EBA_BRAND;
+ }
again:
error = exec_common((const char *)exec_fnamep,
(const char **)uap, NULL, brand_action);