X-Git-Url: http://www.dolda2000.com/gitweb/?a=blobdiff_plain;f=src%2Fuserplex.c;h=8493f487bf4bbf9e77fb0d82a30fd38880ab1cbf;hb=da75c835b71b9ed9cf1d2c8fcbcfb7631dd24a05;hp=565884d0d0632a31506a3d5f2935e7e7ee2613d9;hpb=42384d2a2870e2cc119fdaa4db42de9865c6cea1;p=ashd.git diff --git a/src/userplex.c b/src/userplex.c index 565884d..8493f48 100644 --- a/src/userplex.c +++ b/src/userplex.c @@ -43,7 +43,7 @@ struct user { static int ignore = 0; static char *mgroup = NULL; -static char *dirname = "htpub"; +static char *dirname = NULL; static char **childspec; static uid_t minuid = 0; static struct user *users = NULL; @@ -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); @@ -269,8 +269,9 @@ int main(int argc, char **argv) } if(optind < argc) { childspec = argv + optind; - dirname = NULL; } else { + if(dirname == NULL) + dirname = "htpub"; bufinit(csbuf); bufadd(csbuf, "dirplex"); bufadd(csbuf, dirname);