/[path-sandbox]/trunk/libsbutil/get_sandbox_lib.c
Gentoo

Diff of /trunk/libsbutil/get_sandbox_lib.c

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

Revision 142 Revision 143
32 if (0 >= exists(path)) { 32 if (0 >= exists(path)) {
33 snprintf(path, SB_PATH_MAX, "%s", LIB_NAME); 33 snprintf(path, SB_PATH_MAX, "%s", LIB_NAME);
34 } 34 }
35#endif 35#endif
36} 36}
37
38#ifdef OUTSIDE_LIBSANDBOX
37 39
38SB_STATIC void get_sandbox_rc(char *path) 40SB_STATIC void get_sandbox_rc(char *path)
39{ 41{
40 snprintf(path, SB_PATH_MAX, "%s/%s", SANDBOX_BASHRC_PATH, BASHRC_NAME); 42 snprintf(path, SB_PATH_MAX, "%s/%s", SANDBOX_BASHRC_PATH, BASHRC_NAME);
41 if (0 >= exists(path)) { 43 if (0 >= exists(path)) {
94 } 96 }
95 97
96 return 0; 98 return 0;
97} 99}
98 100
101#endif /* OUTSIDE_LIBSANDBOX */
102
99SB_STATIC int exists(const char *pathname) 103SB_STATIC int exists(const char *pathname)
100{ 104{
101 struct stat buf; 105 struct stat buf;
102 int retval; 106 int retval;
103 107
111 if (ENOENT != errno) 115 if (ENOENT != errno)
112 return -1; 116 return -1;
113 117
114 return 0; 118 return 0;
115} 119}
120
121#ifdef OUTSIDE_LIBSANDBOX
116 122
117SB_STATIC int is_file(const char *pathname) 123SB_STATIC int is_file(const char *pathname)
118{ 124{
119 struct stat buf; 125 struct stat buf;
120 int retval; 126 int retval;
141 lseek(fd, pos, SEEK_SET); 147 lseek(fd, pos, SEEK_SET);
142 148
143 return (len); 149 return (len);
144} 150}
145 151
152#endif /* OUTSIDE_LIBSANDBOX */
153
146 154
147// vim:noexpandtab noai:cindent ai 155// vim:noexpandtab noai:cindent ai

Legend:
Removed from v.142  
changed lines
  Added in v.143

  ViewVC Help
Powered by ViewVC 1.1.20