summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/os/exec.c
diff options
context:
space:
mode:
authorRobert Mustacchi <rm@joyent.com>2014-07-28 05:15:24 +0000
committerRobert Mustacchi <rm@joyent.com>2014-07-30 10:12:47 +0000
commit29e61af1e4197a2257d9f07c6ea4da563d19856a (patch)
tree890a31a717d54243d68553828cb3011b24f4b6b7 /usr/src/uts/common/os/exec.c
parent773ec6987ca1e06d93c1cadbada051c3be95aaed (diff)
downloadillumos-joyent-29e61af1e4197a2257d9f07c6ea4da563d19856a.tar.gz
OS-3280 need a way to specify the root of a native system in the lx brand
OS-3279 lx brand should allow delegated datasets Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Diffstat (limited to 'usr/src/uts/common/os/exec.c')
-rw-r--r--usr/src/uts/common/os/exec.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/usr/src/uts/common/os/exec.c b/usr/src/uts/common/os/exec.c
index d421483279..1d16255cc5 100644
--- a/usr/src/uts/common/os/exec.c
+++ b/usr/src/uts/common/os/exec.c
@@ -1628,8 +1628,9 @@ stk_copyin(execa_t *uap, uarg_t *args, intpdata_t *intp, void **auxvpp)
args->ne = args->na - argc;
/*
- * Add AT_SUN_PLATFORM, AT_SUN_EXECNAME, AT_SUN_BRANDNAME, and
- * AT_SUN_EMULATOR strings, as well as AT_RANDOM array, to the stack.
+ * Add AT_SUN_PLATFORM, AT_SUN_EXECNAME, AT_SUN_BRANDNAME,
+ * AT_SUN_BRAND_NROOT, and AT_SUN_EMULATOR strings, as well as AT_RANDOM
+ * array, to the stack.
*/
if (auxvpp != NULL && *auxvpp != NULL) {
if ((error = stk_add(args, platform, UIO_SYSSPACE)) != 0)
@@ -1664,6 +1665,11 @@ stk_copyin(execa_t *uap, uarg_t *args, intpdata_t *intp, void **auxvpp)
if ((error = stk_byte_add(args, rdata, sizeof (rdata))) != 0)
return (error);
+
+ if (args->brand_nroot != NULL &&
+ (error = stk_add(args, args->brand_nroot,
+ UIO_SYSSPACE)) != 0)
+ return (error);
}
/*
@@ -1784,6 +1790,10 @@ stk_copyout(uarg_t *args, char *usrstack, void **auxvpp, user_t *up)
ADDAUX(*a,
AT_SUN_EMULATOR, (long)&ustrp[*--offp])
ADDAUX(*a, AT_RANDOM, (long)&ustrp[*--offp])
+ if (args->brand_nroot != NULL) {
+ ADDAUX(*a,
+ AT_SUN_BRAND_NROOT, (long)&ustrp[*--offp])
+ }
} else {
auxv32_t **a = (auxv32_t **)auxvpp;
ADDAUX(*a,
@@ -1797,6 +1807,10 @@ stk_copyout(uarg_t *args, char *usrstack, void **auxvpp, user_t *up)
ADDAUX(*a, AT_SUN_EMULATOR,
(int)(uintptr_t)&ustrp[*--offp])
ADDAUX(*a, AT_RANDOM, (int)(uintptr_t)&ustrp[*--offp])
+ if (args->brand_nroot != NULL) {
+ ADDAUX(*a, AT_SUN_BRAND_NROOT,
+ (int)(uintptr_t)&ustrp[*--offp])
+ }
}
}