diff options
author | Mike Frysinger <vapier@gentoo.org> | 2009-02-07 07:05:59 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2009-02-07 07:08:33 -0500 |
commit | dbf1c6bd951a2d30a78a4cdf183e2361a0b52400 (patch) | |
tree | 6cce55133a9439a0b0f2fe082ba844373174769f /libsandbox | |
parent | libsandbox: fix call to backtrace() (diff) | |
download | sandbox-dbf1c6bd951a2d30a78a4cdf183e2361a0b52400.tar.gz sandbox-dbf1c6bd951a2d30a78a4cdf183e2361a0b52400.tar.bz2 sandbox-dbf1c6bd951a2d30a78a4cdf183e2361a0b52400.zip |
libsandbox: ignore *.py[co] files for nowv1.3.4
A very common bug (apparently) is for .py[co] files to fall out of sync
with their .py source files. Rather than trigger a hard failure, let's
just whine about it. Once python itself gets sorted out, we can drop
this.
URL: http://bugs.gentoo.org/256953
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'libsandbox')
-rw-r--r-- | libsandbox/libsandbox.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libsandbox/libsandbox.c b/libsandbox/libsandbox.c index e881f59..df875b9 100644 --- a/libsandbox/libsandbox.c +++ b/libsandbox/libsandbox.c @@ -668,6 +668,20 @@ static int check_access(sbcontext_t *sbcontext, int sb_nr, const char *func, con goto out; } + /* A very common bug (apparently) is for .py[co] files to fall out + * of sync with their .py source files. Rather than trigger a hard + * failure, let's just whine about it. Once python itself gets + # sorted out, we can drop this #256953. + */ + size_t len = strlen(resolv_path); + if (len > 4) { + const char *py = resolv_path + len - 4; + if (!strcmp(py, ".pyc") || !strcmp(py, ".pyo")) { + sbcontext->show_access_violation = 0; + goto out; + } + } + /* If we are here, and still no joy, and its the access() call, * do not log it, but just return -1 */ if (sb_nr == SB_NR_ACCESS_WR) { |