userplex: Actually open stdout and stderr for writing...
authorFredrik Tolf <fredrik@dolda2000.com>
Fri, 3 Sep 2010 04:56:24 +0000 (06:56 +0200)
committerFredrik Tolf <fredrik@dolda2000.com>
Fri, 3 Sep 2010 04:56:24 +0000 (06:56 +0200)
src/userplex.c

index 565884d..77f79d7 100644 (file)
@@ -80,12 +80,12 @@ static void login(struct passwd *pwd)
     /* There's whole load of other stuff one could want to do here --
      * getting Kerberos credentials, running PAM session modules, and
      * who knows what. I'll add them along as I find them useful. */
-    if(((fd = open(".ashd/output", O_APPEND)) >= 0) ||
+    if(((fd = open(".ashd/output", O_WRONLY | O_APPEND)) >= 0) ||
        ((fd = open("/dev/null", 0)) >= 0)) {
        dup2(fd, 1);
        close(fd);
     }
-    if(((fd = open(".ashd/error", O_APPEND)) >= 0) ||
+    if(((fd = open(".ashd/error", O_WRONLY | O_APPEND)) >= 0) ||
        ((fd = open("/dev/null", 0)) >= 0)) {
        dup2(fd, 2);
        close(fd);