/* 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);
static void usage(FILE *out)
{
- fprintf(out, "usage: userplex [-hI] [-g GROUP] [-m MIN-UID] [-d PUB-DIR] [PROGRAM ARGS...]");
+ fprintf(out, "usage: userplex [-hI] [-g GROUP] [-m MIN-UID] [-d PUB-DIR] [PROGRAM ARGS...]\n");
}
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;