Commit | Line | Data |
---|---|---|
2117e02e MW |
1 | #include "subfd.h" |
2 | #include "substdio.h" | |
3 | #include "auto_split.h" | |
4 | #include "auto_uids.h" | |
5 | #include "fmt.h" | |
6 | ||
7 | char strnum[FMT_ULONG]; | |
8 | ||
9 | void uidgid(uid) | |
10 | int uid; | |
11 | { | |
12 | substdio_put(subfdout,strnum,fmt_ulong(strnum,(unsigned long) uid)); | |
13 | substdio_puts(subfdout,":"); | |
14 | substdio_put(subfdout,strnum,fmt_ulong(strnum,(unsigned long) auto_gidq)); | |
15 | substdio_puts(subfdout,":"); | |
16 | } | |
17 | ||
18 | void copy(uid,mode,sub,fn) | |
19 | int uid; | |
20 | char *mode; | |
21 | char *sub; | |
22 | char *fn; | |
23 | { | |
24 | substdio_puts(subfdout,"c:"); | |
25 | uidgid(uid); | |
26 | substdio_puts(subfdout,mode); | |
27 | substdio_puts(subfdout,":"); | |
28 | substdio_puts(subfdout,sub); | |
29 | substdio_puts(subfdout,":"); | |
30 | substdio_puts(subfdout,fn); | |
31 | substdio_puts(subfdout,":\n"); | |
32 | } | |
33 | ||
34 | void dir(uid,mode,fn) | |
35 | int uid; | |
36 | char *mode; | |
37 | char *fn; | |
38 | { | |
39 | substdio_puts(subfdout,"d:"); | |
40 | uidgid(uid); | |
41 | substdio_puts(subfdout,mode); | |
42 | substdio_puts(subfdout,":"); | |
43 | substdio_puts(subfdout,fn); | |
44 | substdio_puts(subfdout,"::\n"); | |
45 | } | |
46 | ||
47 | void dirsplit(uid,mode,fn) | |
48 | int uid; | |
49 | char *mode; | |
50 | char *fn; | |
51 | { | |
52 | unsigned long i; | |
53 | dir(uid,mode,fn); | |
54 | for (i = 0;i < auto_split;++i) { | |
55 | substdio_puts(subfdout,"d:"); | |
56 | uidgid(uid); | |
57 | substdio_puts(subfdout,mode); | |
58 | substdio_puts(subfdout,":"); | |
59 | substdio_puts(subfdout,fn); | |
60 | substdio_puts(subfdout,":/"); | |
61 | substdio_put(subfdout,strnum,fmt_ulong(strnum,i)); | |
62 | substdio_puts(subfdout,":\n"); | |
63 | } | |
64 | } | |
65 | ||
66 | void main() | |
67 | { | |
68 | dir(auto_uido,"755",""); | |
69 | dir(auto_uido,"755","/control"); | |
70 | dir(auto_uido,"755","/users"); | |
71 | dir(auto_uido,"755","/bin"); | |
72 | dir(auto_uido,"755","/man"); | |
73 | dir(auto_uido,"755","/man/cat1"); | |
74 | dir(auto_uido,"755","/man/cat5"); | |
75 | dir(auto_uido,"755","/man/cat7"); | |
76 | dir(auto_uido,"755","/man/cat8"); | |
77 | dir(auto_uido,"755","/man/man1"); | |
78 | dir(auto_uido,"755","/man/man5"); | |
79 | dir(auto_uido,"755","/man/man7"); | |
80 | dir(auto_uido,"755","/man/man8"); | |
81 | ||
82 | dir(auto_uida,"755","/alias"); | |
83 | dir(auto_uidq,"750","/queue"); | |
84 | dir(auto_uidq,"700","/queue/pid"); | |
85 | dir(auto_uidq,"700","/queue/intd"); | |
86 | dir(auto_uidq,"750","/queue/todo"); | |
87 | dir(auto_uidq,"750","/queue/lock"); | |
88 | dir(auto_uids,"700","/queue/bounce"); | |
89 | ||
90 | substdio_puts(subfdout,"z0:"); | |
91 | uidgid(auto_uids); | |
92 | substdio_puts(subfdout,"600:/queue/lock/:sendmutex:\n"); | |
93 | ||
94 | substdio_puts(subfdout,"z1024:"); | |
95 | uidgid(auto_uidr); | |
96 | substdio_puts(subfdout,"644:/queue/lock/:tcpto:\n"); | |
97 | ||
98 | substdio_puts(subfdout,"p:"); | |
99 | uidgid(auto_uids); | |
100 | substdio_puts(subfdout,"622:/queue/lock/:trigger:\n"); | |
101 | ||
102 | dirsplit(auto_uidq,"750","/queue/mess"); | |
103 | dirsplit(auto_uids,"700","/queue/info"); | |
104 | dirsplit(auto_uids,"700","/queue/local"); | |
105 | dirsplit(auto_uids,"700","/queue/remote"); | |
106 | ||
107 | copy(auto_uidq,"4711","/bin/","qmail-queue"); | |
108 | copy(auto_uido,"700","/bin/","qmail-lspawn"); | |
109 | copy(auto_uido,"700","/bin/","qmail-start"); | |
110 | copy(auto_uido,"711","/bin/","qmail-getpw"); | |
111 | copy(auto_uido,"711","/bin/","qmail-local"); | |
112 | copy(auto_uido,"711","/bin/","qmail-remote"); | |
113 | copy(auto_uido,"711","/bin/","qmail-rspawn"); | |
114 | copy(auto_uido,"711","/bin/","qmail-clean"); | |
115 | copy(auto_uido,"711","/bin/","qmail-send"); | |
116 | copy(auto_uido,"711","/bin/","splogger"); | |
117 | copy(auto_uido,"700","/bin/","qmail-newu"); | |
118 | copy(auto_uido,"711","/bin/","qmail-pw2u"); | |
119 | copy(auto_uido,"755","/bin/","qmail-inject"); | |
120 | copy(auto_uido,"755","/bin/","predate"); | |
121 | copy(auto_uido,"755","/bin/","datemail"); | |
122 | copy(auto_uido,"755","/bin/","mailsubj"); | |
123 | copy(auto_uido,"755","/bin/","qmail-showctl"); | |
124 | copy(auto_uido,"755","/bin/","qmail-qread"); | |
125 | copy(auto_uido,"755","/bin/","qmail-qstat"); | |
126 | copy(auto_uido,"755","/bin/","qmail-tcpto"); | |
127 | copy(auto_uido,"755","/bin/","qmail-pop3d"); | |
128 | copy(auto_uido,"700","/bin/","qmail-popup"); | |
129 | copy(auto_uido,"755","/bin/","qmail-qmtpd"); | |
130 | copy(auto_uido,"755","/bin/","qmail-smtpd"); | |
131 | copy(auto_uido,"755","/bin/","sendmail"); | |
132 | copy(auto_uido,"755","/bin/","tcp-env"); | |
133 | copy(auto_uido,"755","/bin/","qlist"); | |
134 | copy(auto_uido,"755","/bin/","qlist2"); | |
135 | copy(auto_uido,"755","/bin/","qreceipt"); | |
136 | copy(auto_uido,"755","/bin/","qsmhook"); | |
137 | copy(auto_uido,"755","/bin/","qbiff"); | |
138 | copy(auto_uido,"755","/bin/","forward"); | |
139 | copy(auto_uido,"755","/bin/","preline"); | |
140 | copy(auto_uido,"755","/bin/","condredirect"); | |
141 | copy(auto_uido,"755","/bin/","maildirmake"); | |
142 | copy(auto_uido,"755","/bin/","maildir2mbox"); | |
143 | copy(auto_uido,"755","/bin/","maildirwatch"); | |
144 | copy(auto_uido,"755","/bin/","qail"); | |
145 | copy(auto_uido,"755","/bin/","elq"); | |
146 | copy(auto_uido,"755","/bin/","pinq"); | |
147 | ||
148 | copy(auto_uido,"644","/man/man5/","addresses.5"); | |
149 | copy(auto_uido,"644","/man/cat5/","addresses.0"); | |
150 | copy(auto_uido,"644","/man/man5/","envelopes.5"); | |
151 | copy(auto_uido,"644","/man/cat5/","envelopes.0"); | |
152 | copy(auto_uido,"644","/man/man5/","maildir.5"); | |
153 | copy(auto_uido,"644","/man/cat5/","maildir.0"); | |
154 | copy(auto_uido,"644","/man/man5/","mbox.5"); | |
155 | copy(auto_uido,"644","/man/cat5/","mbox.0"); | |
156 | copy(auto_uido,"644","/man/man5/","dot-qmail.5"); | |
157 | copy(auto_uido,"644","/man/cat5/","dot-qmail.0"); | |
158 | copy(auto_uido,"644","/man/man5/","qmail-control.5"); | |
159 | copy(auto_uido,"644","/man/cat5/","qmail-control.0"); | |
160 | copy(auto_uido,"644","/man/man5/","qmail-header.5"); | |
161 | copy(auto_uido,"644","/man/cat5/","qmail-header.0"); | |
162 | copy(auto_uido,"644","/man/man5/","qmail-log.5"); | |
163 | copy(auto_uido,"644","/man/cat5/","qmail-log.0"); | |
164 | copy(auto_uido,"644","/man/man5/","qmail-users.5"); | |
165 | copy(auto_uido,"644","/man/cat5/","qmail-users.0"); | |
166 | copy(auto_uido,"644","/man/man5/","tcp-environ.5"); | |
167 | copy(auto_uido,"644","/man/cat5/","tcp-environ.0"); | |
168 | ||
169 | copy(auto_uido,"644","/man/man7/","forgeries.7"); | |
170 | copy(auto_uido,"644","/man/cat7/","forgeries.0"); | |
171 | copy(auto_uido,"644","/man/man7/","qmail-limits.7"); | |
172 | copy(auto_uido,"644","/man/cat7/","qmail-limits.0"); | |
173 | copy(auto_uido,"644","/man/man7/","qmail-upgrade.7"); | |
174 | copy(auto_uido,"644","/man/cat7/","qmail-upgrade.0"); | |
175 | copy(auto_uido,"644","/man/man7/","qmail.7"); | |
176 | copy(auto_uido,"644","/man/cat7/","qmail.0"); | |
177 | ||
178 | copy(auto_uido,"644","/man/man1/","forward.1"); | |
179 | copy(auto_uido,"644","/man/cat1/","forward.0"); | |
180 | copy(auto_uido,"644","/man/man1/","condredirect.1"); | |
181 | copy(auto_uido,"644","/man/cat1/","condredirect.0"); | |
182 | copy(auto_uido,"644","/man/man1/","maildirmake.1"); | |
183 | copy(auto_uido,"644","/man/cat1/","maildirmake.0"); | |
184 | copy(auto_uido,"644","/man/man1/","maildir2mbox.1"); | |
185 | copy(auto_uido,"644","/man/cat1/","maildir2mbox.0"); | |
186 | copy(auto_uido,"644","/man/man1/","maildirwatch.1"); | |
187 | copy(auto_uido,"644","/man/cat1/","maildirwatch.0"); | |
188 | copy(auto_uido,"644","/man/man1/","mailsubj.1"); | |
189 | copy(auto_uido,"644","/man/cat1/","mailsubj.0"); | |
190 | copy(auto_uido,"644","/man/man1/","qlist.1"); | |
191 | copy(auto_uido,"644","/man/cat1/","qlist.0"); | |
192 | copy(auto_uido,"644","/man/man1/","qreceipt.1"); | |
193 | copy(auto_uido,"644","/man/cat1/","qreceipt.0"); | |
194 | copy(auto_uido,"644","/man/man1/","qbiff.1"); | |
195 | copy(auto_uido,"644","/man/cat1/","qbiff.0"); | |
196 | copy(auto_uido,"644","/man/man1/","preline.1"); | |
197 | copy(auto_uido,"644","/man/cat1/","preline.0"); | |
198 | copy(auto_uido,"644","/man/man1/","tcp-env.1"); | |
199 | copy(auto_uido,"644","/man/cat1/","tcp-env.0"); | |
200 | ||
201 | copy(auto_uido,"644","/man/man8/","qmail-local.8"); | |
202 | copy(auto_uido,"644","/man/cat8/","qmail-local.0"); | |
203 | copy(auto_uido,"644","/man/man8/","qmail-lspawn.8"); | |
204 | copy(auto_uido,"644","/man/cat8/","qmail-lspawn.0"); | |
205 | copy(auto_uido,"644","/man/man8/","qmail-getpw.8"); | |
206 | copy(auto_uido,"644","/man/cat8/","qmail-getpw.0"); | |
207 | copy(auto_uido,"644","/man/man8/","qmail-remote.8"); | |
208 | copy(auto_uido,"644","/man/cat8/","qmail-remote.0"); | |
209 | copy(auto_uido,"644","/man/man8/","qmail-rspawn.8"); | |
210 | copy(auto_uido,"644","/man/cat8/","qmail-rspawn.0"); | |
211 | copy(auto_uido,"644","/man/man8/","qmail-clean.8"); | |
212 | copy(auto_uido,"644","/man/cat8/","qmail-clean.0"); | |
213 | copy(auto_uido,"644","/man/man8/","qmail-send.8"); | |
214 | copy(auto_uido,"644","/man/cat8/","qmail-send.0"); | |
215 | copy(auto_uido,"644","/man/man8/","qmail-start.8"); | |
216 | copy(auto_uido,"644","/man/cat8/","qmail-start.0"); | |
217 | copy(auto_uido,"644","/man/man8/","splogger.8"); | |
218 | copy(auto_uido,"644","/man/cat8/","splogger.0"); | |
219 | copy(auto_uido,"644","/man/man8/","qmail-queue.8"); | |
220 | copy(auto_uido,"644","/man/cat8/","qmail-queue.0"); | |
221 | copy(auto_uido,"644","/man/man8/","qmail-inject.8"); | |
222 | copy(auto_uido,"644","/man/cat8/","qmail-inject.0"); | |
223 | copy(auto_uido,"644","/man/man8/","qmail-showctl.8"); | |
224 | copy(auto_uido,"644","/man/cat8/","qmail-showctl.0"); | |
225 | copy(auto_uido,"644","/man/man8/","qmail-newu.8"); | |
226 | copy(auto_uido,"644","/man/cat8/","qmail-newu.0"); | |
227 | copy(auto_uido,"644","/man/man8/","qmail-pw2u.8"); | |
228 | copy(auto_uido,"644","/man/cat8/","qmail-pw2u.0"); | |
229 | copy(auto_uido,"644","/man/man8/","qmail-qread.8"); | |
230 | copy(auto_uido,"644","/man/cat8/","qmail-qread.0"); | |
231 | copy(auto_uido,"644","/man/man8/","qmail-qstat.8"); | |
232 | copy(auto_uido,"644","/man/cat8/","qmail-qstat.0"); | |
233 | copy(auto_uido,"644","/man/man8/","qmail-tcpto.8"); | |
234 | copy(auto_uido,"644","/man/cat8/","qmail-tcpto.0"); | |
235 | copy(auto_uido,"644","/man/man8/","qmail-pop3d.8"); | |
236 | copy(auto_uido,"644","/man/cat8/","qmail-pop3d.0"); | |
237 | copy(auto_uido,"644","/man/man8/","qmail-popup.8"); | |
238 | copy(auto_uido,"644","/man/cat8/","qmail-popup.0"); | |
239 | copy(auto_uido,"644","/man/man8/","qmail-qmtpd.8"); | |
240 | copy(auto_uido,"644","/man/cat8/","qmail-qmtpd.0"); | |
241 | copy(auto_uido,"644","/man/man8/","qmail-smtpd.8"); | |
242 | copy(auto_uido,"644","/man/cat8/","qmail-smtpd.0"); | |
243 | copy(auto_uido,"644","/man/man8/","qmail-command.8"); | |
244 | copy(auto_uido,"644","/man/cat8/","qmail-command.0"); | |
245 | ||
246 | substdio_flush(subfdout); | |
247 | _exit(0); | |
248 | } |