X-Git-Url: http://www.dolda2000.com/gitweb/?a=blobdiff_plain;f=src%2Fuserplex.c;h=77f79d74e2f76ebc873705b13acafa73316c37eb;hb=c703cd40b144284a46eb4a59294b4b1757b8faa6;hp=592c1b2f62c0bfc409a8dc12dd34d3335596e31f;hpb=b9e7ec7a81ea631891cae27448069784a2768490;p=ashd.git diff --git a/src/userplex.c b/src/userplex.c index 592c1b2..77f79d7 100644 --- a/src/userplex.c +++ b/src/userplex.c @@ -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); @@ -242,7 +242,7 @@ int main(int argc, char **argv) int fd; struct charvbuf csbuf; - while((c = getopt(argc, argv, "hIg:m:d:")) >= 0) { + while((c = getopt(argc, argv, "+hIg:m:d:")) >= 0) { switch(c) { case 'I': ignore = 1;