Print this page
Code review comments from pmooney (sundry), and igork (screwups in zonecfg refactoring)
*** 2115,2135 ****
(void) fprintf(of, "%s\n", cmd_to_str(CMD_END));
}
(void) zonecfg_endadminent(handle);
! if ((err = zonecfg_getsecflagsent(handle, &secflagstab)) != Z_OK) {
! zone_perror(zone, err, B_FALSE);
! goto done;
! }
!
(void) fprintf(of, "%s %s\n", cmd_to_str(CMD_ADD),
rt_to_str(RT_SECFLAGS));
export_prop(of, PT_DEFAULT, secflagstab.zone_secflags_default);
export_prop(of, PT_LOWER, secflagstab.zone_secflags_lower);
export_prop(of, PT_UPPER, secflagstab.zone_secflags_upper);
(void) fprintf(of, "%s\n", cmd_to_str(CMD_END));
/*
* There is nothing to export for pcap since this resource is just
* a container for an rctl alias.
*/
--- 2115,2132 ----
(void) fprintf(of, "%s\n", cmd_to_str(CMD_END));
}
(void) zonecfg_endadminent(handle);
! if (zonecfg_getsecflagsent(handle, &secflagstab) == Z_OK) {
(void) fprintf(of, "%s %s\n", cmd_to_str(CMD_ADD),
rt_to_str(RT_SECFLAGS));
export_prop(of, PT_DEFAULT, secflagstab.zone_secflags_default);
export_prop(of, PT_LOWER, secflagstab.zone_secflags_lower);
export_prop(of, PT_UPPER, secflagstab.zone_secflags_upper);
(void) fprintf(of, "%s\n", cmd_to_str(CMD_END));
+ }
/*
* There is nothing to export for pcap since this resource is just
* a container for an rctl alias.
*/
*** 5622,5639 ****
static void
info_secflags(zone_dochandle_t handle, FILE *fp)
{
struct zone_secflagstab sftab;
- int err;
-
- if ((err = zonecfg_lookup_secflags(handle, &sftab)) != Z_OK) {
- zone_perror(zone, err, B_TRUE);
- return;
- }
output_secflags(fp, &sftab);
}
void
info_func(cmd_t *cmd)
{
--- 5619,5632 ----
static void
info_secflags(zone_dochandle_t handle, FILE *fp)
{
struct zone_secflagstab sftab;
+ if (zonecfg_lookup_secflags(handle, &sftab) == Z_OK) {
output_secflags(fp, &sftab);
+ }
}
void
info_func(cmd_t *cmd)
{
*** 6391,6413 ****
ret_val = Z_BAD_PROPERTY;
}
}
(void) zonecfg_endadminent(handle);
! if ((err = zonecfg_getsecflagsent(handle, &secflagstab)) != Z_OK) {
! zone_perror(zone, err, B_TRUE);
! return;
! }
!
/*
* No properties are required, but any specified should be
* valid
*/
if (verify_secflags(&secflagstab) != B_TRUE) {
/* Error is reported from verify_secflags */
ret_val = Z_BAD_PROPERTY;
}
if (!global_scope) {
zerr(gettext("resource specification incomplete"));
saw_error = B_TRUE;
if (ret_val == Z_OK)
--- 6384,6403 ----
ret_val = Z_BAD_PROPERTY;
}
}
(void) zonecfg_endadminent(handle);
! if (zonecfg_getsecflagsent(handle, &secflagstab) == Z_OK) {
/*
* No properties are required, but any specified should be
* valid
*/
if (verify_secflags(&secflagstab) != B_TRUE) {
/* Error is reported from verify_secflags */
ret_val = Z_BAD_PROPERTY;
}
+ }
if (!global_scope) {
zerr(gettext("resource specification incomplete"));
saw_error = B_TRUE;
if (ret_val == Z_OK)