Lines 95-104
Link Here
|
95 |
//memset ((char *) &access_write, 0, sizeof (access_write)); |
95 |
//memset ((char *) &access_write, 0, sizeof (access_write)); |
96 |
//memset ((char *) &access_execute, 0, sizeof (access_execute)); |
96 |
//memset ((char *) &access_execute, 0, sizeof (access_execute)); |
97 |
|
97 |
|
98 |
strcpy(expr_read, "^\\("); |
98 |
strcpy(expr_read, "^("); |
99 |
strcpy(expr_write, "^\\("); |
99 |
strcpy(expr_write, "^("); |
100 |
strcpy(expr_execute, "^\\("); |
100 |
strcpy(expr_execute, "^("); |
101 |
strcpy(expr_monitor, "^\\("); |
101 |
strcpy(expr_monitor, "^("); |
102 |
|
102 |
|
103 |
do |
103 |
do |
104 |
{ |
104 |
{ |
Lines 162-168
Link Here
|
162 |
|
162 |
|
163 |
if (strlen(expr_read) == 3) |
163 |
if (strlen(expr_read) == 3) |
164 |
{ |
164 |
{ |
165 |
strcat(expr_read, "\\)"); |
165 |
strcat(expr_read, ")"); |
166 |
} |
166 |
} |
167 |
else |
167 |
else |
168 |
{ |
168 |
{ |
Lines 171-177
Link Here
|
171 |
strcat(expr_read, "$"); |
171 |
strcat(expr_read, "$"); |
172 |
if (strlen(expr_write) == 3) |
172 |
if (strlen(expr_write) == 3) |
173 |
{ |
173 |
{ |
174 |
strcat(expr_write, "\\)"); |
174 |
strcat(expr_write, ")"); |
175 |
} |
175 |
} |
176 |
else |
176 |
else |
177 |
{ |
177 |
{ |
Lines 180-186
Link Here
|
180 |
strcat(expr_write, "$"); |
180 |
strcat(expr_write, "$"); |
181 |
if (strlen(expr_execute) == 3) |
181 |
if (strlen(expr_execute) == 3) |
182 |
{ |
182 |
{ |
183 |
strcat(expr_execute, "\\)"); |
183 |
strcat(expr_execute, ")"); |
184 |
} |
184 |
} |
185 |
else |
185 |
else |
186 |
{ |
186 |
{ |
Lines 189-195
Link Here
|
189 |
strcat(expr_execute, "$"); |
189 |
strcat(expr_execute, "$"); |
190 |
if (strlen(expr_monitor) == 3) |
190 |
if (strlen(expr_monitor) == 3) |
191 |
{ |
191 |
{ |
192 |
strcat(expr_monitor, "\\)"); |
192 |
strcat(expr_monitor, ")"); |
193 |
} |
193 |
} |
194 |
else |
194 |
else |
195 |
{ |
195 |
{ |
Lines 197-231
Link Here
|
197 |
} |
197 |
} |
198 |
strcat(expr_monitor, "$"); |
198 |
strcat(expr_monitor, "$"); |
199 |
|
199 |
|
200 |
error = regncomp(&access_read, expr_read, strlen(expr_read), |
200 |
error = regcomp(&access_read, expr_read, |
201 |
REG_ICASE | REG_NOSUB); |
201 |
REG_EXTENDED | REG_ICASE | REG_NOSUB); |
202 |
if (error) |
202 |
if (error) |
203 |
{ |
203 |
{ |
204 |
report(REPORT_ERROR, "host_read: regncomp: %d\n", error); |
204 |
report(REPORT_ERROR, "host_read: regcomp: %d\n", error); |
205 |
done(1); |
205 |
done(1); |
206 |
} |
206 |
} |
207 |
|
207 |
|
208 |
error = regncomp(&access_write, expr_write, strlen(expr_write), |
208 |
error = regcomp(&access_write, expr_write, |
209 |
REG_ICASE | REG_NOSUB); |
209 |
REG_EXTENDED | REG_ICASE | REG_NOSUB); |
210 |
if (error) |
210 |
if (error) |
211 |
{ |
211 |
{ |
212 |
report(REPORT_ERROR, "host_read: regncomp: %d\n", error); |
212 |
report(REPORT_ERROR, "host_read: regcomp: %d\n", error); |
213 |
done(1); |
213 |
done(1); |
214 |
} |
214 |
} |
215 |
|
215 |
|
216 |
error = regncomp(&access_execute, expr_execute, strlen(expr_execute), |
216 |
error = regcomp(&access_execute, expr_execute, |
217 |
REG_ICASE | REG_NOSUB); |
217 |
REG_EXTENDED | REG_ICASE | REG_NOSUB); |
218 |
if (error) |
218 |
if (error) |
219 |
{ |
219 |
{ |
220 |
report(REPORT_ERROR, "host_read: regncomp: %d\n", error); |
220 |
report(REPORT_ERROR, "host_read: regcomp: %d\n", error); |
221 |
done(1); |
221 |
done(1); |
222 |
} |
222 |
} |
223 |
|
223 |
|
224 |
error = regncomp(&access_monitor, expr_monitor, strlen(expr_monitor), |
224 |
error = regcomp(&access_monitor, expr_monitor, |
225 |
REG_ICASE | REG_NOSUB); |
225 |
REG_EXTENDED | REG_ICASE | REG_NOSUB); |
226 |
if (error) |
226 |
if (error) |
227 |
{ |
227 |
{ |
228 |
report(REPORT_ERROR, "host_read: regncomp: %d\n", error); |
228 |
report(REPORT_ERROR, "host_read: regcomp: %d\n", error); |
229 |
done(1); |
229 |
done(1); |
230 |
} |
230 |
} |
231 |
} |
231 |
} |
Lines 354-375
Link Here
|
354 |
{ |
354 |
{ |
355 |
case HOST_READ: |
355 |
case HOST_READ: |
356 |
strcat(expr_read, re_name); |
356 |
strcat(expr_read, re_name); |
357 |
strcat(expr_read, "\\|"); |
357 |
strcat(expr_read, "|"); |
358 |
break; |
358 |
break; |
359 |
|
359 |
|
360 |
case HOST_WRITE: |
360 |
case HOST_WRITE: |
361 |
strcat(expr_write, re_name); |
361 |
strcat(expr_write, re_name); |
362 |
strcat(expr_write, "\\|"); |
362 |
strcat(expr_write, "|"); |
363 |
break; |
363 |
break; |
364 |
|
364 |
|
365 |
case HOST_EXECUTE: |
365 |
case HOST_EXECUTE: |
366 |
strcat(expr_execute, re_name); |
366 |
strcat(expr_execute, re_name); |
367 |
strcat(expr_execute, "\\|"); |
367 |
strcat(expr_execute, "|"); |
368 |
break; |
368 |
break; |
369 |
|
369 |
|
370 |
case HOST_MONITOR: |
370 |
case HOST_MONITOR: |
371 |
strcat(expr_monitor, re_name); |
371 |
strcat(expr_monitor, re_name); |
372 |
strcat(expr_monitor, "\\|"); |
372 |
strcat(expr_monitor, "|"); |
373 |
break; |
373 |
break; |
374 |
|
374 |
|
375 |
default: |
375 |
default: |
Lines 432-438
Link Here
|
432 |
done(1); |
432 |
done(1); |
433 |
} |
433 |
} |
434 |
|
434 |
|
435 |
n = regnexec(re, p, strlen(p), 0, 0, 0); |
435 |
n = regexec(re, p, 0, 0, 0); |
436 |
|
436 |
|
437 |
return !n; |
437 |
return !n; |
438 |
} |
438 |
} |