/[path-sandbox]/trunk/sandbox.h
Gentoo

Contents of /trunk/sandbox.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 62 - (show annotations) (download) (as text)
Mon May 2 23:53:39 2005 UTC (9 years, 3 months ago) by vapier
File MIME type: text/x-chdr
File size: 2447 byte(s)
dlvsym doesnt exist in uClibc

1 /*
2 * Copyright (C) 2002 Brad House <brad@mainstreetsoftworks.com>,
3 * Possibly based on code from Geert Bevin, Uwyn, http://www.uwyn.com
4 * Distributed under the terms of the GNU General Public License, v2 or later
5 * Author: Brad House <brad@mainstreetsoftworks.com>
6 *
7 * $Header$
8 */
9
10 #ifndef __SANDBOX_H__
11 #define __SANDBOX_H__
12
13 #include "localdecls.h"
14 #include "config.h"
15
16 /* Uncomment below to use flock instead of fcntl (POSIX way) to lock/unlock files */
17 /* #define USE_FLOCK */
18
19 /* Uncomment below to use system() to execute the shell rather than execv */
20 /* #define USE_SYSTEM_SHELL */
21
22 /* Uncomment below to use /etc/ld.so.preload (could be very intrusive!!) */
23 /* #define USE_LD_SO_PRELOAD */
24
25 /* Uncommend to not have the protected shell forked, just run in parent process */
26 /* ONLY FOR DEBUGGING PURPOSES!! (strace needs it like that) */
27 /* #define NO_FORK */
28
29 #define LD_PRELOAD_FILE "/etc/ld.so.preload"
30 #define LIB_NAME "libsandbox.so"
31 #define BASHRC_NAME "sandbox.bashrc"
32 #define PIDS_FILE "/tmp/sandboxpids.tmp"
33 #define LOG_FILE_PREFIX "/tmp/sandbox-"
34 #define DEBUG_LOG_FILE_PREFIX "/tmp/sandbox-debug-"
35 #define LOG_FILE_EXT ".log"
36
37 #define ENV_SANDBOX_DEBUG_LOG "SANDBOX_DEBUG_LOG"
38 #define ENV_SANDBOX_LOG "SANDBOX_LOG"
39 #define ENV_SANDBOX_DIR "SANDBOX_DIR"
40 #define ENV_SANDBOX_LIB "SANDBOX_LIB"
41
42 #define ENV_SANDBOX_DENY "SANDBOX_DENY"
43 #define ENV_SANDBOX_READ "SANDBOX_READ"
44 #define ENV_SANDBOX_WRITE "SANDBOX_WRITE"
45 #define ENV_SANDBOX_PREDICT "SANDBOX_PREDICT"
46
47 #define ENV_SANDBOX_ON "SANDBOX_ON"
48 #define ENV_SANDBOX_BEEP "SANDBOX_BEEP"
49
50 #define DEFAULT_BEEP_COUNT 3
51
52 #if !HAVE_DLVSYM
53 # define dlvsym(lib, sym, ver) dlsym(lib, sym)
54 #endif
55
56 SB_STATIC char *get_sandbox_path(char *argv0);
57 SB_STATIC char *get_sandbox_lib(char *sb_path);
58 SB_STATIC char *get_sandbox_pids_file(void);
59 SB_STATIC char *get_sandbox_rc(char *sb_path);
60 SB_STATIC char *get_sandbox_log();
61 SB_STATIC char *sb_dirname(const char *path);
62 SB_STATIC int file_getmode(char *mode);
63 SB_STATIC long file_tell(int fp);
64 SB_STATIC int file_lock(int fd, int lock, char *filename);
65 SB_STATIC int file_unlock(int fd);
66 SB_STATIC int file_locktype(char *mode);
67 SB_STATIC int file_open(char *filename, char *mode, int perm_specified, ...);
68 SB_STATIC void file_close(int fd);
69 SB_STATIC long file_length(int fd);
70 SB_STATIC int file_truncate(int fd);
71 SB_STATIC int file_exist(char *filename, int checkmode);
72
73 #endif
74
75 // vim:noexpandtab noai:cindent ai

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.20