diff options
Diffstat (limited to 'src/install.c')
-rw-r--r-- | src/install.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/install.c b/src/install.c index c738fb7..e7d1a82 100644 --- a/src/install.c +++ b/src/install.c @@ -12,7 +12,7 @@ extern void hier(); int fdsourcedir = -1; -void h(char *home,int uid,int gid,int mode) +void h(char *home,char *queue,int uid,int gid,int mode) { if (mkdir(home,0700) == -1) if (errno != EEXIST) @@ -21,6 +21,16 @@ void h(char *home,int uid,int gid,int mode) logmsg(WHO,111,FATAL,B("unable to chown: ",home)); if (chmod(home,mode) == -1) logmsg(WHO,111,FATAL,B("unable to chmod: ",home)); + + if (mkdir(queue,0700) == -1) { + if (errno != EEXIST) + logmsg(WHO,111,FATAL,B("unable to mkdir: ",queue)); + } else { + if (chown(queue,uid,gid) == -1) + logmsg(WHO,111,FATAL,B("unable to chown: ",queue)); + if (chmod(queue,mode) == -1) + logmsg(WHO,111,FATAL,B("unable to chmod: ",queue)); + } } void d(char *home,char *subdir,int uid,int gid,int mode) @@ -36,17 +46,17 @@ void d(char *home,char *subdir,int uid,int gid,int mode) logmsg(WHO,111,FATAL,B("unable to chmod: ",home,"/",subdir)); } -void p(char *home,char *fifo,int uid,int gid,int mode) +void p(char *queue,char *fifo,int uid,int gid,int mode) { - if (chdir(home) == -1) - logmsg(WHO,110,FATAL,B("unable to switch to: ",home)); + if (chdir(queue) == -1) + logmsg(WHO,110,FATAL,B("unable to switch to: ",queue,"/queue")); if (fifo_make(fifo,0700) == -1) if (errno != EEXIST) - logmsg(WHO,111,FATAL,B("unable to mkfifo: ",home,"/",fifo)); + logmsg(WHO,111,FATAL,B("unable to mkfifo: ",queue,"/queue/",fifo)); if (chown(fifo,uid,gid) == -1) - logmsg(WHO,111,FATAL,B("unable to chown: ",home,"/",fifo)); + logmsg(WHO,111,FATAL,B("unable to chown: ",queue,"/queue/",fifo)); if (chmod(fifo,mode) == -1) - logmsg(WHO,111,FATAL,B("unable to chmod: ",home,"/",fifo)); + logmsg(WHO,111,FATAL,B("unable to chmod: ",queue,"/queue/",fifo)); } char inbuf[BUFFER_INSIZE]; |