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

Diff of /trunk/src/sandbox.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 279 Revision 280
10#ifndef __SANDBOX_H__ 10#ifndef __SANDBOX_H__
11#define __SANDBOX_H__ 11#define __SANDBOX_H__
12 12
13#include "localdecls.h" 13#include "localdecls.h"
14#include "config.h" 14#include "config.h"
15#include "rcscripts/rctypes.h"
15 16
16#define LD_PRELOAD_EQ "LD_PRELOAD=" 17#define LD_PRELOAD_EQ "LD_PRELOAD="
17#define LD_PRELOAD_FILE "/etc/ld.so.preload" 18#define LD_PRELOAD_FILE "/etc/ld.so.preload"
18#define LIB_NAME "libsandbox.so" 19#define LIB_NAME "libsandbox.so"
19#define BASHRC_NAME "sandbox.bashrc" 20#define BASHRC_NAME "sandbox.bashrc"
91 else \ 92 else \
92 fprintf(stderr, _hilight _args); \ 93 fprintf(stderr, _hilight _args); \
93 errno = old_errno; \ 94 errno = old_errno; \
94 } while (0) 95 } while (0)
95 96
96typedef enum {
97 false,
98 true
99} bool;
100
101void get_sandbox_lib(char *path); 97void get_sandbox_lib(char *path);
102#ifdef OUTSIDE_LIBSANDBOX 98#ifdef OUTSIDE_LIBSANDBOX
103void get_sandbox_rc(char *path); 99void get_sandbox_rc(char *path);
104void get_sandbox_log(char *path); 100void get_sandbox_log(char *path);
105void get_sandbox_debug_log(char *path); 101void get_sandbox_debug_log(char *path);
106int get_tmp_dir(char *path); 102int get_tmp_dir(char *path);
107#endif /* OUTSIDE_LIBSANDBOX */
108int exists(const char *pathname);
109#ifdef OUTSIDE_LIBSANDBOX
110int is_file(const char *pathname);
111int is_dir(const char *pathname, int follow_link);
112long file_length(int fd); 103long file_length(int);
113#endif /* OUTSIDE_LIBSANDBOX */ 104#endif /* OUTSIDE_LIBSANDBOX */
114bool is_env_on (const char *); 105bool is_env_on (const char *);
115bool is_env_off (const char *); 106bool is_env_off (const char *);
116 107
108#ifndef OUTSIDE_LIBSANDBOX
117/* Compat functions for GNU extensions */ 109/* Compat functions for GNU extensions */
118char *gstrndup (const char *str, size_t size); 110char *gstrndup (const char *str, size_t size);
119/* Same as basename(3), but do not modify path */ 111/* Same as basename(3), but do not modify path */
120char *gbasename (const char *path); 112char *gbasename (const char *path);
113#endif /* !OUTSIDE_LIBSANDBOX */
121 114
122/* glibc modified realpath() function */ 115/* glibc modified realpath() function */
123char *erealpath(const char *, char *); 116char *erealpath(const char *, char *);
124#ifndef OUTSIDE_LIBSANDBOX 117#ifndef OUTSIDE_LIBSANDBOX
125char *egetcwd(char *, size_t); 118char *egetcwd(char *, size_t);
126#endif 119#endif /* !OUTSIDE_LIBSANDBOX */
127 120
128#endif /* __SANDBOX_H__ */ 121#endif /* __SANDBOX_H__ */
129 122
130// vim:noexpandtab noai:cindent ai 123// vim:noexpandtab noai:cindent ai

Legend:
Removed from v.279  
changed lines
  Added in v.280

  ViewVC Help
Powered by ViewVC 1.1.20