23 if (stat(file,&st) == -1) {
25 logmsg(
WHO,-99,WARN,B(prefix1,prefix2,prefix3,file,
" does not exist"));
27 logmsg(
WHO,-99,WARN,B(
"unable to stat: .../",file));
31 if ((uid != -1) && (st.st_uid != uid))
32 logmsg(
WHO,-99,WARN,B(prefix1,prefix2,prefix3,file,
" has wrong owner"));
33 if ((gid != -1) && (st.st_gid != gid))
34 logmsg(
WHO,-99,WARN,B(prefix1,prefix2,prefix3,file,
" has wrong group"));
35 if ((st.st_mode & 07777) !=
mode)
36 logmsg(
WHO,-99,WARN,B(prefix1,prefix2,prefix3,file,
" has wrong permissions"));
37 if ((st.st_mode & S_IFMT) !=
type)
38 logmsg(
WHO,-99,WARN,B(prefix1,prefix2,prefix3,file,
" has wrong type"));
47 perm(
"",
"",
"",home,S_IFDIR,uid,gid,
mode);
57 if (chdir(home) == -1)
58 logmsg(
WHO,111,FATAL,B(
"unable to switch to: ",home));
59 perm(
"",home,
"/",subdir,S_IFDIR,uid,gid,
mode);
69 if (chdir(home) == -1)
70 logmsg(
WHO,111,FATAL,B(
"unable to switch to: ",home));
71 perm(
"",home,
"/",fifo,S_IFIFO,uid,gid,
mode);
74void c(home,subdir,file,uid,gid,
mode)
82 if (chdir(home) == -1)
83 logmsg(
WHO,111,FATAL,B(
"unable to switch to: ",home));
84 if (chdir(subdir) == -1)
85 logmsg(
WHO,111,FATAL,B(
"unable to switch to: ",home,
"/",subdir));
86 perm(
".../",subdir,
"/",file,S_IFREG,uid,gid,
mode);
97 if (chdir(home) == -1)
98 logmsg(
WHO,111,FATAL,B(
"unable to switch to; ",home));
99 perm(
"",home,
"/",file,S_IFREG,uid,gid,
mode);
void c(const char *home, const char *subdir, const char *file, int uid, int gid, int mode)
void d(const char *home, const char *subdir, 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 h(char *home, int uid, int gid, int mode)
void z(char *home, char *file, int len, int uid, int gid, int mode)