summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjv227347 <Jordan.Vaughan@Sun.com>2008-11-10 12:08:25 -0800
committerjv227347 <Jordan.Vaughan@Sun.com>2008-11-10 12:08:25 -0800
commit2ad45a84935be6f65ad11ebefa3108f8b882a1c7 (patch)
tree505a2f1593c51c8e7dc43c5e21b1b2284b79ca92
parentbbd65dd21832305e14110aacf248e9081638d663 (diff)
downloadillumos-gate-2ad45a84935be6f65ad11ebefa3108f8b882a1c7.tar.gz
6400006 libzonecfg.so.1 zonecfg_strerror() doesn't handle Z_SYSTEM
6579865 zone_rctl_name incorrectly used like a char * in libzonecfg.c 6554794 zoneadm.c: return value of strcmp(3C) compared with NULL pointer
-rw-r--r--usr/src/cmd/zoneadm/zoneadm.c2
-rw-r--r--usr/src/lib/libzonecfg/common/libzonecfg.c18
2 files changed, 10 insertions, 10 deletions
diff --git a/usr/src/cmd/zoneadm/zoneadm.c b/usr/src/cmd/zoneadm/zoneadm.c
index 12d0dd6711..fa70490978 100644
--- a/usr/src/cmd/zoneadm/zoneadm.c
+++ b/usr/src/cmd/zoneadm/zoneadm.c
@@ -5590,7 +5590,7 @@ main(int argc, char **argv)
* brand type and determine whether it is native or not.
*/
if ((target_zone != NULL) &&
- (strcmp(target_zone, GLOBAL_ZONENAME) != NULL)) {
+ (strcmp(target_zone, GLOBAL_ZONENAME) != 0)) {
if (zone_get_brand(target_zone, target_brand,
sizeof (target_brand)) != Z_OK) {
zerror(gettext("missing or invalid brand"));
diff --git a/usr/src/lib/libzonecfg/common/libzonecfg.c b/usr/src/lib/libzonecfg/common/libzonecfg.c
index 67bc6a5dcc..921e66ea7c 100644
--- a/usr/src/lib/libzonecfg/common/libzonecfg.c
+++ b/usr/src/lib/libzonecfg/common/libzonecfg.c
@@ -24,8 +24,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <libsysevent.h>
#include <pthread.h>
#include <stdlib.h>
@@ -2643,8 +2641,10 @@ zonecfg_devperms_apply(zone_dochandle_t hdl, const char *inpath, uid_t owner,
if ((acltxt == NULL) || (strcmp(acltxt, "") == 0))
return (Z_OK);
- if (acl_fromtext(acltxt, &aclp) != 0)
+ if (acl_fromtext(acltxt, &aclp) != 0) {
+ errno = EINVAL;
return (Z_SYSTEM);
+ }
errno = 0;
if (acl_set(path, aclp) == -1) {
@@ -2994,8 +2994,7 @@ zonecfg_lookup_rctl(zone_dochandle_t handle, struct zone_rctltab *tabptr)
struct zone_rctlvaltab *valptr;
int err;
- if (tabptr->zone_rctl_name == NULL ||
- strlen(tabptr->zone_rctl_name) == 0)
+ if (strlen(tabptr->zone_rctl_name) == 0)
return (Z_INVAL);
if ((err = operation_prep(handle)) != Z_OK)
@@ -3076,7 +3075,7 @@ zonecfg_add_rctl(zone_dochandle_t handle, struct zone_rctltab *tabptr)
{
int err;
- if (tabptr == NULL || tabptr->zone_rctl_name == NULL)
+ if (tabptr == NULL)
return (Z_INVAL);
if ((err = operation_prep(handle)) != Z_OK)
@@ -3120,7 +3119,7 @@ zonecfg_delete_rctl(zone_dochandle_t handle, struct zone_rctltab *tabptr)
{
int err;
- if (tabptr == NULL || tabptr->zone_rctl_name == NULL)
+ if (tabptr == NULL)
return (Z_INVAL);
if ((err = operation_prep(handle)) != Z_OK)
@@ -3140,8 +3139,7 @@ zonecfg_modify_rctl(
{
int err;
- if (oldtabptr == NULL || oldtabptr->zone_rctl_name == NULL ||
- newtabptr == NULL || newtabptr->zone_rctl_name == NULL)
+ if (oldtabptr == NULL || newtabptr == NULL)
return (Z_INVAL);
if ((err = operation_prep(handle)) != Z_OK)
@@ -3375,6 +3373,8 @@ zonecfg_strerror(int errnum)
"Could not create a temporary pool"));
case Z_POOL_BIND:
return (dgettext(TEXT_DOMAIN, "Could not bind zone to pool"));
+ case Z_SYSTEM:
+ return (strerror(errno));
default:
return (dgettext(TEXT_DOMAIN, "Unknown error"));
}