aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-02-20 02:30:03 -0500
committerMike Frysinger <vapier@gentoo.org>2009-02-20 02:30:03 -0500
commitff0dd36d8f038d29d72f0d5d7c43edaa4c2385bc (patch)
treec77b7064bb3b4d68f584442c81e127682947cfe7 /libsandbox/wrapper-funcs
parentlibsandbox: use sb_unwrapped_open() in creat wrapper (diff)
downloadsandbox-ff0dd36d8f038d29d72f0d5d7c43edaa4c2385bc.tar.gz
sandbox-ff0dd36d8f038d29d72f0d5d7c43edaa4c2385bc.tar.bz2
sandbox-ff0dd36d8f038d29d72f0d5d7c43edaa4c2385bc.zip
libsandbox: unify creat/creat64 wrappers
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'libsandbox/wrapper-funcs')
-rw-r--r--libsandbox/wrapper-funcs/creat64.c24
1 files changed, 3 insertions, 21 deletions
diff --git a/libsandbox/wrapper-funcs/creat64.c b/libsandbox/wrapper-funcs/creat64.c
index b892808..e512fa4 100644
--- a/libsandbox/wrapper-funcs/creat64.c
+++ b/libsandbox/wrapper-funcs/creat64.c
@@ -3,26 +3,8 @@
*
* Copyright 1999-2008 Gentoo Foundation
* Licensed under the GPL-2
- *
- * Partly Copyright (C) 1998-9 Pancrazio `Ezio' de Mauro <p@demauro.net>,
- * as some of the InstallWatch code was used.
*/
-#define WRAPPER_ARGS_PROTO const char *pathname, mode_t mode
-#define WRAPPER_ARGS pathname, mode
-extern int EXTERN_NAME(WRAPPER_ARGS_PROTO);
-/* XXX: We use the open64() call to simulate creat64() */
-/* static int (*WRAPPER_TRUE_NAME)(WRAPPER_ARGS_PROTO) = NULL; */
-
-int WRAPPER_NAME(WRAPPER_ARGS_PROTO)
-{
- int result = -1;
-
- if (FUNCTION_SANDBOX_SAFE(pathname)) {
- check_dlsym(true_open64_DEFAULT, symname_open64_DEFAULT,
- symver_open64_DEFAULT);
- result = true_open64_DEFAULT(pathname, O_CREAT | O_WRONLY | O_TRUNC, mode);
- }
-
- return result;
-}
+#define sb_unwrapped_open_DEFAULT sb_unwrapped_open64_DEFAULT
+#include "creat.c"
+#undef sb_unwrapped_open_DEFAULT