10#define WHO "instcheck"
12void perm(
char *prefix1,
char *prefix2,
char *prefix3,
char *
file,
int type,
int uid,
int gid,
int mode)
16 if (stat(
file,&st) == -1) {
18 logmsg(
WHO,0,WARN,B(
"file does nost exist:",prefix1,prefix2,prefix3,
file));
20 logmsg(
WHO,errno,WARN,B(
"unable to stat: ../",
file));
24 if ((
uid != -1) && (st.st_uid !=
uid))
25 logmsg(
WHO,0,WARN,B(
"file has wrong owner: ",prefix1,prefix2,prefix3,
file));
26 if ((gid != -1) && (st.st_gid != gid))
27 logmsg(
WHO,0,WARN,B(
"file has wrong group: ",prefix1,prefix2,prefix3,
file));
28 if ((st.st_mode & 07777) != mode)
29 logmsg(
WHO,0,WARN,B(
"file has wrong permissions: ",prefix1,prefix2,prefix3,
file));
30 if ((st.st_mode & S_IFMT) != type)
31 logmsg(
WHO,0,WARN,B(
"file has wrong type: ",prefix1,prefix2,prefix3,
file));
34void h(
char *
home,
char *queue,
int uid,
int gid,
int mode)
39void d(
char *
home,
char *subdir,
int uid,
int gid,
int mode)
41 if (chdir(
home) == -1)
42 logmsg(
WHO,111,FATAL,B(
"unable to switch to: ",
home));
46void p(
char *
home,
char *fifo,
int uid,
int gid,
int mode)
48 if (chdir(
home) == -1)
49 logmsg(
WHO,111,FATAL,B(
"unable to switch to: ",
home));
55 if (chdir(
home) == -1)
56 logmsg(
WHO,111,FATAL,B(
"unable to switch to: ",
home));
57 if (chdir(subdir) == -1)
58 logmsg(
WHO,111,FATAL,B(
"unable to switch to: ",
home,
"/",subdir));
64 if (chdir(
home) == -1)
65 logmsg(
WHO,111,FATAL,B(
"unable to switch to: ",
home));
void c(char *, char *, char *, int, int, int)
void p(char *home, char *fifo, int uid, int gid, int mode)
void perm(char *prefix1, char *prefix2, char *prefix3, char *file, int type, int uid, int gid, int mode)
void z(char *home, char *file, int len, int uid, int gid, int mode)
void h(char *home, char *queue, int uid, int gid, int mode)