aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2008-12-31 09:37:42 -0500
committerMike Frysinger <vapier@gentoo.org>2008-12-31 09:56:48 -0500
commit498b431f68db3b8d53f8c08d17857c860487bfda (patch)
tree713e99f901c6bcca9f479681dd75ecb4ed597a8a /libsandbox/wrapper-funcs
parentlibsbutil: cleanup x* memory functions (diff)
downloadsandbox-498b431f68db3b8d53f8c08d17857c860487bfda.tar.gz
sandbox-498b431f68db3b8d53f8c08d17857c860487bfda.tar.bz2
sandbox-498b431f68db3b8d53f8c08d17857c860487bfda.zip
libsandbox: optimize!
Kill off string operations where unnecessary, and convert the sets of prefixes to arrays that we can iterate over. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'libsandbox/wrapper-funcs')
-rw-r--r--libsandbox/wrapper-funcs/unlinkat.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libsandbox/wrapper-funcs/unlinkat.c b/libsandbox/wrapper-funcs/unlinkat.c
index 02a3e20..c370920 100644
--- a/libsandbox/wrapper-funcs/unlinkat.c
+++ b/libsandbox/wrapper-funcs/unlinkat.c
@@ -24,8 +24,9 @@ static inline bool sb_unlinkat_pre_check(WRAPPER_ARGS_PROTO)
/* XXX: Hack to make sure sandboxed process cannot remove
* a device node, bug #79836. */
- if ((0 == strncmp(canonic, "/dev/null", 9)) ||
- (0 == strncmp(canonic, "/dev/zero", 9))) {
+ if (0 == strcmp(canonic, "/dev/null") ||
+ 0 == strcmp(canonic, "/dev/zero"))
+ {
errno = EACCES;
return false;
}