aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-11-23 07:11:47 -0500
committerMike Frysinger <vapier@gentoo.org>2010-11-23 07:11:47 -0500
commit4a383c33005f7ffad6edeed01f78d8e2cca5203d (patch)
tree392d927cd6b10f1bc0a2c9d643658aabb8be7c0d /libsandbox/libsandbox.h
parenttests: add another unlinkat test for long paths (diff)
downloadsandbox-4a383c33005f7ffad6edeed01f78d8e2cca5203d.tar.gz
sandbox-4a383c33005f7ffad6edeed01f78d8e2cca5203d.tar.bz2
sandbox-4a383c33005f7ffad6edeed01f78d8e2cca5203d.zip
libsandbox: fix bug in previous dirfd unificationv2.4
The previous commit (libsandbox: handle dirfd in mkdir/open/unlink *at prechecks) left a sizeof() in place but unfortunately no longer held the same meaning. In previous code, the function had access to the buffer decl and so could get the byte count. In the new code, the function has access to the pointer only. So sizeof() now wrongly returns the size of pointers rather than the length of the buffer. Extend the new helper function to take the length of the buffer it is given to fix this issue. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'libsandbox/libsandbox.h')
-rw-r--r--libsandbox/libsandbox.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/libsandbox/libsandbox.h b/libsandbox/libsandbox.h
index 3ef7c71..0324b5b 100644
--- a/libsandbox/libsandbox.h
+++ b/libsandbox/libsandbox.h
@@ -71,7 +71,7 @@ __attribute__((noreturn)) void sb_abort(void);
char *erealpath(const char *, char *);
char *egetcwd(char *, size_t);
int canonicalize(const char *, char *);
-int resolve_dirfd_path(int, const char *, char *);
+int resolve_dirfd_path(int, const char *, char *, size_t);
/* most linux systems use ENAMETOOLONG, but some (ia64) use ERANGE, as do some BSDs */
#define errno_is_too_long() (errno == ENAMETOOLONG || errno == ERANGE)