Print this page
Reduce lint

@@ -846,13 +846,15 @@
  * Get the app-svc-dependent flag for this zone's init process. This is a
  * zone-specific attr which controls the type of contract we create for the
  * zone's init. When true, the contract will include CT_PR_EV_EXIT in the fatal
  * set, so that when any service which is in the same contract exits, the init
  * application will be terminated.
+ *
+ * We use the global "snap_hndl", so no parameters get passed here.
  */
 static boolean_t
-is_app_svc_dep(brand_handle_t bh)
+is_app_svc_dep(void)
 {
         struct zone_attrtab a;
 
         bzero(&a, sizeof (a));
         (void) strlcpy(a.zone_attr_name, "app-svc-dependent",

@@ -938,11 +940,11 @@
 
         /*
          * See if we need to setup contract dependencies between the zone's
          * primary application and any of its services.
          */
-        app_svc_dep = is_app_svc_dep(bh);
+        app_svc_dep = is_app_svc_dep();
 
         brand_close(bh);
 
         err = filter_bootargs(zlogp, bootargs, nbootargs, init_file);
         if (err != Z_OK)

@@ -964,13 +966,15 @@
         if (lstat(initpath, &st) == -1) {
                 zerror(zlogp, B_TRUE, "could not stat %s", initpath);
                 goto bad;
         }
 
-        if ((st.st_mode & S_IFMT) == S_IFLNK) {
-                /* symlink, we'll have to wait and resolve when we boot */
-        } else if ((st.st_mode & S_IXUSR) == 0) {
+        /*
+         * If a symlink, we'll have to wait and resolve when we boot,
+         * otherwise check the executable bits now.
+         */
+        if ((st.st_mode & S_IFMT) != S_IFLNK && (st.st_mode & S_IXUSR) == 0) {
                 zerror(zlogp, B_FALSE, "%s is not executable", initpath);
                 goto bad;
         }
 
         /*

@@ -1294,11 +1298,10 @@
         ucred_t *uc = NULL;
         const priv_set_t *eset;
 
         zone_state_t zstate;
         zone_cmd_t cmd;
-        boolean_t debug;
         int init_status;
         zone_cmd_arg_t *zargp;
 
         boolean_t kernelcall;
 

@@ -1348,11 +1351,10 @@
                     "unexpected (expected %d bytes)", alen,
                     sizeof (zone_cmd_arg_t));
                 goto out;
         }
         cmd = zargp->cmd;
-        debug = zargp->debug;
         init_status = zargp->status;
 
         if (door_ucred(&uc) != 0) {
                 zerror(&logsys, B_TRUE, "door_ucred");
                 goto out;