diff options
| author | <gerald.jelinek@sun.com> | 2009-03-20 14:14:40 -0600 |
|---|---|---|
| committer | <gerald.jelinek@sun.com> | 2009-03-20 14:14:40 -0600 |
| commit | ca733e25b47e409c67716131dd8d3c8145f89a02 (patch) | |
| tree | f19d14b9213943b46767787072bbf9a1075d2165 /usr/src/cmd/zoneadm | |
| parent | 7b79d84636ec82b45f00c982cf6810db81852d17 (diff) | |
| download | illumos-joyent-ca733e25b47e409c67716131dd8d3c8145f89a02.tar.gz | |
6819579 zone attach expects zonepath to exist
Diffstat (limited to 'usr/src/cmd/zoneadm')
| -rw-r--r-- | usr/src/cmd/zoneadm/zoneadm.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/usr/src/cmd/zoneadm/zoneadm.c b/usr/src/cmd/zoneadm/zoneadm.c index 10cf749e1d..800a536e2a 100644 --- a/usr/src/cmd/zoneadm/zoneadm.c +++ b/usr/src/cmd/zoneadm/zoneadm.c @@ -2774,7 +2774,8 @@ verify_details(int cmd_num, char *argv[]) zonecfg_fini_handle(handle); return (Z_ERR); } - if (validate_zonepath(zonepath, cmd_num) != Z_OK) { + if (cmd_num != CMD_ATTACH && + validate_zonepath(zonepath, cmd_num) != Z_OK) { (void) fprintf(stderr, gettext("could not verify zonepath %s " "because of the above errors.\n"), zonepath); return_code = Z_ERR; @@ -4795,6 +4796,16 @@ attach_func(int argc, char *argv[]) } } + /* Now we can validate that the zonepath exists. */ + if (validate_zonepath(zonepath, CMD_ATTACH) != Z_OK) { + (void) fprintf(stderr, gettext("could not verify zonepath %s " + "because of the above errors.\n"), zonepath); + + assert(zonecfg_lock_file_held(&lockfd)); + zonecfg_release_lock_file(target_zone, lockfd); + return (Z_ERR); + } + if ((handle = zonecfg_init_handle()) == NULL) { zperror(cmd_to_str(CMD_ATTACH), B_TRUE); err = Z_ERR; |
