9static const char *server;
10static const char *
dir;
14static char outbuf[1024];
17void init(
const char *d,
const char *f)
22 if (mkdir(
dir,0700) == -1)
23 logmsg(server,111,FATAL,B(
"unable to create: ",
dir));
24 if (chmod(
dir,03755) == -1)
25 logmsg(server,111,FATAL,B(
"unable to set mode of: ",
dir));
27 logmsg(server,111,FATAL,B(
"unable to switch to: ",
dir));
32 logmsg(server,111,FATAL,B(
"unable to create: ",
dir,
"/",
fn));
38 if (mkdir(
fn,0700) == -1)
fail();
46 buffer_init(&bo,buffer_unixwrite,
fd,outbuf,
sizeof(outbuf));
51 if (buffer_puts(&bo,s) == -1)
fail();
54void out(
const char *s,
unsigned int len)
56 if (buffer_put(&bo,s,
len) == -1)
fail();
61 if (buffer_copy(&bo,
b) < 0)
fail();
66 if (buffer_flush(&bo) == -1)
fail();
67 if (fsync(
fd) == -1)
fail();
78 if (chown(
fn,uid,gid) == -1)
fail();
94 outs(
"#!/bin/sh\nexec");
96 outs(
" multilog t ./main\n");
void owner(int uid, int gid)
void init(const char *d, const char *f)
void start(const char *s)
void makedir(const char *s)
void out(const char *s, unsigned int len)
void makelog(const char *user, int uid, int gid)
void d(const char *home, const char *subdir, int uid, int gid, int mode)