diff options
Diffstat (limited to 'usr/src/lib/libbrand')
-rw-r--r-- | usr/src/lib/libbrand/common/libbrand.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/usr/src/lib/libbrand/common/libbrand.c b/usr/src/lib/libbrand/common/libbrand.c index 3112e31771..afd03abb02 100644 --- a/usr/src/lib/libbrand/common/libbrand.c +++ b/usr/src/lib/libbrand/common/libbrand.c @@ -326,6 +326,7 @@ i_substitute_tokens(const char *sbuf, char *dbuf, int dbuf_size, const char *curr_zone) { int dst, src; + static char *env_pool = NULL; /* * Walk through the characters, substituting values as needed. @@ -342,6 +343,13 @@ i_substitute_tokens(const char *sbuf, char *dbuf, int dbuf_size, case '%': dst += strlcpy(dbuf + dst, "%", dbuf_size - dst); break; + case 'P': + if (env_pool == NULL) + env_pool = getenv("_ZONEADMD_ZPOOL"); + if (env_pool == NULL) + break; + dst += strlcpy(dbuf + dst, env_pool, dbuf_size - dst); + break; case 'R': if (zonepath == NULL) break; @@ -847,6 +855,7 @@ i_brand_platform_iter_mounts(struct brand_handle *bhp, const char *zonename, xmlNodePtr node; xmlChar *special, *dir, *type, *opt; char special_exp[MAXPATHLEN]; + char dir_exp[MAXPATHLEN]; char opt_exp[MAXPATHLEN]; int ret; @@ -873,6 +882,10 @@ i_brand_platform_iter_mounts(struct brand_handle *bhp, const char *zonename, special_exp, sizeof (special_exp), zonename, zonepath, NULL, NULL)) != 0) goto next; + if ((ret = i_substitute_tokens((char *)dir, + dir_exp, sizeof (dir_exp), + zonename, zonepath, NULL, NULL)) != 0) + goto next; /* opt might not be defined */ if (strlen((const char *)opt) == 0) { @@ -885,7 +898,7 @@ i_brand_platform_iter_mounts(struct brand_handle *bhp, const char *zonename, goto next; } - ret = func(data, (char *)special_exp, (char *)dir, + ret = func(data, (char *)special_exp, (char *)dir_exp, (char *)type, ((opt != NULL) ? opt_exp : NULL)); next: |