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

Contents of /trunk/sandbox.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 43 - (show annotations) (download) (as text)
Sat Apr 23 20:44:15 2005 UTC (9 years ago) by azarah
File MIME type: text/x-chdr
File size: 2355 byte(s)
Make sure all functions used in libsandbox.c is declared static.  Define
SB_STATIC in localdecls.h for this.  Include sandbox_futils.c rather than
linking with its object.  Hopefully this will fix bug #90153.

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
15 /* Uncomment below to use flock instead of fcntl (POSIX way) to lock/unlock files */
16 /* #define USE_FLOCK */
17
18 /* Uncomment below to use system() to execute the shell rather than execv */
19 /* #define USE_SYSTEM_SHELL */
20
21 /* Uncomment below to use /etc/ld.so.preload (could be very intrusive!!) */
22 /* #define USE_LD_SO_PRELOAD */
23
24 /* Uncommend to not have the protected shell forked, just run in parent process */
25 /* ONLY FOR DEBUGGING PURPOSES!! (strace needs it like that) */
26 /* #define NO_FORK */
27
28 #define LD_PRELOAD_FILE "/etc/ld.so.preload"
29 #define LIB_NAME "libsandbox.so"
30 #define BASHRC_NAME "sandbox.bashrc"
31 #define PIDS_FILE "/tmp/sandboxpids.tmp"
32 #define LOG_FILE_PREFIX "/tmp/sandbox-"
33 #define DEBUG_LOG_FILE_PREFIX "/tmp/sandbox-debug-"
34 #define LOG_FILE_EXT ".log"
35
36 #define ENV_SANDBOX_DEBUG_LOG "SANDBOX_DEBUG_LOG"
37 #define ENV_SANDBOX_LOG "SANDBOX_LOG"
38 #define ENV_SANDBOX_DIR "SANDBOX_DIR"
39 #define ENV_SANDBOX_LIB "SANDBOX_LIB"
40
41 #define ENV_SANDBOX_DENY "SANDBOX_DENY"
42 #define ENV_SANDBOX_READ "SANDBOX_READ"
43 #define ENV_SANDBOX_WRITE "SANDBOX_WRITE"
44 #define ENV_SANDBOX_PREDICT "SANDBOX_PREDICT"
45
46 #define ENV_SANDBOX_ON "SANDBOX_ON"
47 #define ENV_SANDBOX_BEEP "SANDBOX_BEEP"
48
49 #define DEFAULT_BEEP_COUNT 3
50
51 SB_STATIC char *get_sandbox_path(char *argv0);
52 SB_STATIC char *get_sandbox_lib(char *sb_path);
53 SB_STATIC char *get_sandbox_pids_file(void);
54 SB_STATIC char *get_sandbox_rc(char *sb_path);
55 SB_STATIC char *get_sandbox_log();
56 SB_STATIC char *sb_dirname(const char *path);
57 SB_STATIC int file_getmode(char *mode);
58 SB_STATIC long file_tell(int fp);
59 SB_STATIC int file_lock(int fd, int lock, char *filename);
60 SB_STATIC int file_unlock(int fd);
61 SB_STATIC int file_locktype(char *mode);
62 SB_STATIC int file_open(char *filename, char *mode, int perm_specified, ...);
63 SB_STATIC void file_close(int fd);
64 SB_STATIC long file_length(int fd);
65 SB_STATIC int file_truncate(int fd);
66 SB_STATIC int file_exist(char *filename, int checkmode);
67
68 #endif
69
70 // 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