Print this page
OS-3280 need a way to specify the root of a native system in the lx brand
OS-3279 lx brand should allow delegated datasets
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
        
@@ -19,14 +19,13 @@
  * CDDL HEADER END
  */
 /*
  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
+ * Copyright (c) 2014, Joyent, Inc.  All rights reserved.
  */
 
-#pragma ident   "%Z%%M% %I%     %E% SMI"
-
 #include <stdio.h>
 #include <stdio_ext.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <ctype.h>
@@ -35,10 +34,11 @@
 #include <signal.h>
 #include <stddef.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <libproc.h>
+#include "ptools_common.h"
 
 /* evil knowledge of libc internals */
 #include "../../../lib/libc/inc/thr_uberdata.h"
 
 #define MAX_SYMNAMLEN   1024    /* Recommended max symbol name length */
@@ -170,11 +170,11 @@
 }
 
 static int
 look(char *arg)
 {
-        char pathname[100];
+        char pathname[PATH_MAX];
         struct stat statb;
         int fd = -1;
         int sig, gcode;
         sigset_t holdmask;
         int maxsig;
@@ -197,11 +197,12 @@
                 goto look_error;
         }
         (void) memcpy(&psinfo, psinfop, sizeof (psinfo_t));
         proc_unctrl_psinfo(&psinfo);
 
-        (void) sprintf(pathname, "/proc/%d/sigact", (int)psinfo.pr_pid);
+        (void) proc_snprintf(pathname, sizeof (pathname), "/proc/%d/sigact",
+            (int)psinfo.pr_pid);
         if ((fd = open(pathname, O_RDONLY)) < 0) {
                 perr("open sigact");
                 goto look_error;
         }