summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2015-07-30 21:35:04 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2015-07-30 21:35:04 +0000
commit3ba00567d296bc2c7c16b9fe6cb2976af0ec2c0b (patch)
treed4a79b5356f16c9000ca3044795f90481c64eefa
parent092a4fbb8cf2c1e30d1e8a493d44fd9b6010511b (diff)
downloadillumos-joyent-3ba00567d296bc2c7c16b9fe6cb2976af0ec2c0b.tar.gz
OS-4577 regression in zlogin argument handling [backout OS-4569]
-rw-r--r--usr/src/cmd/zlogin/zlogin.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/usr/src/cmd/zlogin/zlogin.c b/usr/src/cmd/zlogin/zlogin.c
index 7c57edc146..17ea786f42 100644
--- a/usr/src/cmd/zlogin/zlogin.c
+++ b/usr/src/cmd/zlogin/zlogin.c
@@ -1174,11 +1174,7 @@ prep_args(brand_handle_t bh, char *zonename, const char *login, char **argv)
argc++;
for (i = 0; i < argc; i++) {
- /*
- * Allocate enough space for the delimiter and 2
- * quotes which might be needed.
- */
- subshell_len += strlen(argv[i]) + 3;
+ subshell_len += strlen(argv[i]) + 1;
}
if ((subshell = calloc(1, subshell_len)) == NULL)
return (NULL);
@@ -1186,13 +1182,7 @@ prep_args(brand_handle_t bh, char *zonename, const char *login, char **argv)
for (i = 0; i < argc; i++) {
if (i > 0)
(void) strcat(subshell, " ");
- if (strchr(argv[i], ' ') != NULL) {
- (void) strcat(subshell, "'");
- (void) strcat(subshell, argv[i]);
- (void) strcat(subshell, "'");
- } else {
- (void) strcat(subshell, argv[i]);
- }
+ (void) strcat(subshell, argv[i]);
}
if (failsafe) {