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

Contents of /trunk/sandbox.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 84 - (show annotations) (download) (as text)
Wed May 11 15:39:13 2005 UTC (9 years, 5 months ago) by azarah
File MIME type: text/x-chdr
File size: 2390 byte(s)
Remove USE_SYSTEM_SHELL stuff, as it is not secure, and not in use.

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 /* Uncommend to not have the protected shell forked, just run in parent process */
20 /* ONLY FOR DEBUGGING PURPOSES!! (strace needs it like that) */
21 /* #define NO_FORK */
22
23 #define LD_PRELOAD_FILE "/etc/ld.so.preload"
24 #define LIB_NAME "libsandbox.so"
25 #define BASHRC_NAME "sandbox.bashrc"
26 #define PIDS_FILE "/tmp/sandboxpids.tmp"
27 #define LOG_FILE_PREFIX "/tmp/sandbox-"
28 #define DEBUG_LOG_FILE_PREFIX "/tmp/sandbox-debug-"
29 #define LOG_FILE_EXT ".log"
30
31 #define ENV_SANDBOX_DEBUG_LOG "SANDBOX_DEBUG_LOG"
32 #define ENV_SANDBOX_LOG "SANDBOX_LOG"
33 #define ENV_SANDBOX_DIR "SANDBOX_DIR"
34 #define ENV_SANDBOX_LIB "SANDBOX_LIB"
35 #define ENV_SANDBOX_BASHRC "SANDBOX_BASHRC"
36
37 #define ENV_SANDBOX_DENY "SANDBOX_DENY"
38 #define ENV_SANDBOX_READ "SANDBOX_READ"
39 #define ENV_SANDBOX_WRITE "SANDBOX_WRITE"
40 #define ENV_SANDBOX_PREDICT "SANDBOX_PREDICT"
41
42 #define ENV_SANDBOX_ON "SANDBOX_ON"
43 #define ENV_SANDBOX_BEEP "SANDBOX_BEEP"
44
45 #define DEFAULT_BEEP_COUNT 3
46
47 #if !HAVE_DLVSYM
48 # define dlvsym(lib, sym, ver) dlsym(lib, sym)
49 #endif
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