Description:
added /dev/urandom to file allowed to be accessed, probably needed after ubuntu 9.04
git-svn-id: http://theory.cpe.ku.ac.th/grader/judge/trunk/scripts@417 6386c4cd-e34a-4fa8-8920-d93eb39b512e
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r76:4469d653fe5f - - 1 file changed: 1 inserted, 0 deleted
@@ -178,24 +178,25 | |||||
|
178 | return; |
|
178 | return; |
|
179 | if (!strchr(namebuf, '/') && strcmp(namebuf, "..")) |
|
179 | if (!strchr(namebuf, '/') && strcmp(namebuf, "..")) |
|
180 | return; |
|
180 | return; |
|
181 | if (file_access >= 2) |
|
181 | if (file_access >= 2) |
|
182 | { |
|
182 | { |
|
183 | if ((!strncmp(namebuf, "/etc/", 5) || |
|
183 | if ((!strncmp(namebuf, "/etc/", 5) || |
|
184 | !strncmp(namebuf, "/lib/", 5) || |
|
184 | !strncmp(namebuf, "/lib/", 5) || |
|
185 | !strncmp(namebuf, "/usr/lib/", 9)) |
|
185 | !strncmp(namebuf, "/usr/lib/", 9)) |
|
186 | && !strstr(namebuf, "..")) |
|
186 | && !strstr(namebuf, "..")) |
|
187 | return; |
|
187 | return; |
|
188 | if (!strcmp(namebuf, "/dev/null") || |
|
188 | if (!strcmp(namebuf, "/dev/null") || |
|
189 | !strcmp(namebuf, "/dev/zero") || |
|
189 | !strcmp(namebuf, "/dev/zero") || |
|
|
190 | + !strcmp(namebuf, "/dev/urandom") || | ||
|
190 | !strcmp(namebuf, "/proc/meminfo") || |
|
191 | !strcmp(namebuf, "/proc/meminfo") || |
|
191 | !strcmp(namebuf, "/proc/self/stat") || |
|
192 | !strcmp(namebuf, "/proc/self/stat") || |
|
192 | !strncmp(namebuf, "/usr/share/zoneinfo/", 20)) |
|
193 | !strncmp(namebuf, "/usr/share/zoneinfo/", 20)) |
|
193 | return; |
|
194 | return; |
|
194 | } |
|
195 | } |
|
195 | die("Forbidden access to file `%s'.", namebuf); |
|
196 | die("Forbidden access to file `%s'.", namebuf); |
|
196 | } |
|
197 | } |
|
197 |
|
198 | ||
|
198 | static int |
|
199 | static int |
|
199 | valid_syscall(struct user *u) |
|
200 | valid_syscall(struct user *u) |
|
200 | { |
|
201 | { |
|
201 | switch (u->regs.orig_eax) |
|
202 | switch (u->regs.orig_eax) |
You need to be logged in to leave comments.
Login now