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

Contents of /trunk/sandbox.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 93 - (show annotations) (download) (as text)
Thu May 12 00:07:21 2005 UTC (9 years, 6 months ago) by azarah
File MIME type: text/x-chdr
File size: 2257 byte(s)
More path limit fixes.  Declare SB_BUF_LEN global and use it where needed.

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 #define LD_PRELOAD_FILE "/etc/ld.so.preload"
20 #define LIB_NAME "libsandbox.so"
21 #define BASHRC_NAME "sandbox.bashrc"
22 #define PIDS_FILE "/tmp/sandboxpids.tmp"
23 #define LOG_FILE_PREFIX "/tmp/sandbox-"
24 #define DEBUG_LOG_FILE_PREFIX "/tmp/sandbox-debug-"
25 #define LOG_FILE_EXT ".log"
26
27 #define ENV_SANDBOX_DEBUG_LOG "SANDBOX_DEBUG_LOG"
28 #define ENV_SANDBOX_LOG "SANDBOX_LOG"
29 #define ENV_SANDBOX_DIR "SANDBOX_DIR"
30 #define ENV_SANDBOX_LIB "SANDBOX_LIB"
31 #define ENV_SANDBOX_BASHRC "SANDBOX_BASHRC"
32
33 #define ENV_SANDBOX_DENY "SANDBOX_DENY"
34 #define ENV_SANDBOX_READ "SANDBOX_READ"
35 #define ENV_SANDBOX_WRITE "SANDBOX_WRITE"
36 #define ENV_SANDBOX_PREDICT "SANDBOX_PREDICT"
37
38 #define ENV_SANDBOX_ON "SANDBOX_ON"
39 #define ENV_SANDBOX_BEEP "SANDBOX_BEEP"
40
41 #define DEFAULT_BEEP_COUNT 3
42
43 #define SB_BUF_LEN 2048
44
45 #if !HAVE_DLVSYM
46 # define dlvsym(lib, sym, ver) dlsym(lib, sym)
47 #endif
48
49 SB_STATIC char *get_sandbox_path(char *argv0);
50 SB_STATIC char *get_sandbox_lib(char *sb_path);
51 SB_STATIC char *get_sandbox_pids_file(void);
52 SB_STATIC char *get_sandbox_rc(char *sb_path);
53 SB_STATIC char *get_sandbox_log();
54 SB_STATIC char *sb_dirname(const char *path);
55 SB_STATIC int file_getmode(char *mode);
56 SB_STATIC long file_tell(int fp);
57 SB_STATIC int file_lock(int fd, int lock, char *filename);
58 SB_STATIC int file_unlock(int fd);
59 SB_STATIC int file_locktype(char *mode);
60 SB_STATIC int file_open(char *filename, char *mode, int perm_specified, ...);
61 SB_STATIC void file_close(int fd);
62 SB_STATIC long file_length(int fd);
63 SB_STATIC int file_truncate(int fd);
64 SB_STATIC int file_exist(char *filename, int checkmode);
65
66 #endif
67
68 // 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