diff -urN otp_src_R12B-5-dist/erts/doc/src/run_erl.xml otp_src_R12B-5/erts/doc/src/run_erl.xml
--- otp_src_R12B-5-dist/erts/doc/src/run_erl.xml	2007-11-26 19:58:17.000000000 +0100
+++ otp_src_R12B-5/erts/doc/src/run_erl.xml	2008-11-11 11:01:18.000000000 +0100
@@ -146,6 +146,12 @@
       <item>The size (in bytes) of a log file before switching to a
        new log file. Default is 100000, minimum is 1000 and maximum is
        approximately 2^30.</item>
+       <tag>PIPE_PERMISSIONS</tag>
+       <item>Permissions to set on the pipes that are created <c><![CDATA[pipe_dir]]></c>. Shall be specified as an octal number. Default is 0600.</item>
+       <tag>PIPE_USER</tag>
+       <item>Owner for the pipes that are created in <c><![CDATA[pipe_dir]]></c>. Default is the user that starts the process.</item>
+       <tag>PIPE_GROUP</tag>
+       <item>Group for pipe permissions in <c><![CDATA[pipe_dir]]></c>. Default is group that starts the current process.</item>
     </taglist>
   </section>
 
diff -urN otp_src_R12B-5-dist/erts/etc/unix/run_erl.c otp_src_R12B-5/erts/etc/unix/run_erl.c
--- otp_src_R12B-5-dist/erts/etc/unix/run_erl.c	2008-06-10 14:47:25.000000000 +0200
+++ otp_src_R12B-5/erts/etc/unix/run_erl.c	2008-11-11 11:00:45.000000000 +0100
@@ -55,6 +55,9 @@
 #include <dirent.h>
 #include <termios.h>
 #include <time.h>
+#include <pwd.h>
+#include <grp.h>
+#include <limits.h>
 #ifndef NO_SYSLOG
 #  include <syslog.h>
 #endif
@@ -152,6 +155,9 @@
 static char statusfile[FILENAME_BUFSIZ];
 static char log_dir[FILENAME_BUFSIZ];
 static char pipename[FILENAME_BUFSIZ];
+static int pipeperm = PERM;
+static int pipeuid = -1;
+static int pipegid = -1;
 static FILE *stdstatus = NULL;
 static int log_generations = DEFAULT_LOG_GENERATIONS;
 static int log_maxsize     = DEFAULT_LOG_MAXSIZE;
@@ -283,6 +289,30 @@
       ERROR1(LOG_ERR,"Minimum RUN_ERL_LOG_MAXSIZE is %d", LOG_MIN_MAXSIZE);
   }
 
+  /* Get values for PIPE file handling from the environment */
+  if ((p = getenv("PIPE_PERMISSIONS"))) {
+    pipeperm = strtol(p, (char**)NULL, 8);
+    if ((errno == ERANGE && (pipeperm == LONG_MAX || pipeperm == LONG_MIN))
+	|| (errno != 0 && pipeperm == 0)) {
+      ERRNO_ERR0(LOG_ERR, "Failed to convert the value in PIPE_PERMISSIONS");
+      pipeperm = PERM;
+    }
+  }
+
+  if ((p = getenv("PIPE_USER"))) {
+    struct passwd *pw = getpwnam(p);
+    if (!pw)
+      ERRNO_ERR1(LOG_ERR, "Unknown user '%s'.", p);
+    pipeuid = pw->pw_uid;
+  }
+
+  if ((p = getenv("PIPE_GROUP"))) {
+    struct group *grp = getgrnam(p);
+    if (!grp)
+      ERRNO_ERR1(LOG_ERR, "Unknown group '%s'.", p);
+    pipegid = grp->gr_gid;
+  }
+
   /*
    * Create FIFOs and open them 
    */
@@ -317,7 +347,7 @@
   /* write FIFO - is read FIFO for `to_erl' program */
   strn_cpy(fifo1, sizeof(fifo1), pipename);
   strn_cat(fifo1, sizeof(fifo1), ".r");
-  if (create_fifo(fifo1, PERM) < 0) {
+  if (create_fifo(fifo1, pipeperm) < 0) {
     ERRNO_ERR1(LOG_ERR,"Cannot create FIFO %s for writing.", fifo1);
     exit(1);
   }
@@ -333,7 +363,7 @@
     close(fd);
     exit(1);
   }
-  if (create_fifo(fifo2, PERM) < 0) { 
+  if (create_fifo(fifo2, pipeperm) < 0) { 
     ERRNO_ERR1(LOG_ERR,"Cannot create FIFO %s for reading.", fifo2);
     exit(1);
   }
@@ -843,8 +873,15 @@
  */
 static int create_fifo(char *name, int perm)
 {
+  ERRNO_ERR1(LOG_ERR, "Setting pipe permissions to '%d'", perm);
   if ((mkfifo(name, perm) < 0) && (errno != EEXIST))
     return -1;
+  
+  if (chown(name, pipeuid, pipegid)) {
+    ERRNO_ERR1(LOG_ERR,"Failed to change ownership on '%s'", name);
+    return -1;
+  }
+
   return 0;
 }
 
@@ -1082,6 +1119,9 @@
   fprintf(stderr, "\nYou may also set the environment variables RUN_ERL_LOG_GENERATIONS\n");
   fprintf(stderr, "and RUN_ERL_LOG_MAXSIZE to the number of log files to use and the\n");
   fprintf(stderr, "size of the log file when to switch to the next log file\n");
+  fprintf(stderr, "You may set PIPE_PERMISSIONS to any octal permission to override\n");
+  fprintf(stderr, "the default permissions that are set on the pipes in pipe_dir.\n");
+  fprintf(stderr, "Also you can set PIPE_OWNER and PIPE_GROUP to change owner and group.\n");
 }
 
 /* Instead of making sure basename exists, we do our own */


