/[path-sandbox]/trunk/src/libsandbox.c
Gentoo

Diff of /trunk/src/libsandbox.c

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

Revision 210 Revision 211
363int _name(const char *pathname, mode_t mode) \ 363int _name(const char *pathname, mode_t mode) \
364{ \ 364{ \
365 int result = -1; \ 365 int result = -1; \
366\ 366\
367 if FUNCTION_SANDBOX_SAFE("creat", pathname) { \ 367 if FUNCTION_SANDBOX_SAFE("creat", pathname) { \
368 check_dlsym(__open); \ 368 check_dlsym(open_DEFAULT); \
369 result = true___open(pathname, O_CREAT | O_WRONLY | O_TRUNC, mode); \ 369 result = true_open_DEFAULT(pathname, O_CREAT | O_WRONLY | O_TRUNC, mode); \
370 } \ 370 } \
371\ 371\
372 return result; \ 372 return result; \
373} 373}
374 374
680int _name(const char *pathname, __mode_t mode) \ 680int _name(const char *pathname, __mode_t mode) \
681{ \ 681{ \
682 int result = -1; \ 682 int result = -1; \
683\ 683\
684 if FUNCTION_SANDBOX_SAFE("creat64", pathname) { \ 684 if FUNCTION_SANDBOX_SAFE("creat64", pathname) { \
685 check_dlsym(__open64); \ 685 check_dlsym(open64_DEFAULT); \
686 result = true___open64(pathname, O_CREAT | O_WRONLY | O_TRUNC, mode); \ 686 result = true_open64_DEFAULT(pathname, O_CREAT | O_WRONLY | O_TRUNC, mode); \
687 } \ 687 } \
688\ 688\
689 return result; \ 689 return result; \
690} 690}
691 691
1243 if ((0 == lstat(log_path, &log_stat)) && 1243 if ((0 == lstat(log_path, &log_stat)) &&
1244 (0 == S_ISREG(log_stat.st_mode))) { 1244 (0 == S_ISREG(log_stat.st_mode))) {
1245 EERROR(color, "SECURITY BREACH", " '%s' %s\n", log_path, 1245 EERROR(color, "SECURITY BREACH", " '%s' %s\n", log_path,
1246 "already exists and is not a regular file!"); 1246 "already exists and is not a regular file!");
1247 } else { 1247 } else {
1248 check_dlsym(__open); 1248 check_dlsym(open_DEFAULT);
1249 log_file = true___open(log_path, O_APPEND | O_WRONLY | 1249 log_file = true_open_DEFAULT(log_path, O_APPEND | O_WRONLY |
1250 O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | 1250 O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP |
1251 S_IROTH); 1251 S_IROTH);
1252 if (log_file >= 0) { 1252 if (log_file >= 0) {
1253 write(log_file, buffer, strlen(buffer)); 1253 write(log_file, buffer, strlen(buffer));
1254 close(log_file); 1254 close(log_file);
1259 if ((0 == lstat(debug_log_path, &log_stat)) && 1259 if ((0 == lstat(debug_log_path, &log_stat)) &&
1260 (0 == S_ISREG(log_stat.st_mode))) { 1260 (0 == S_ISREG(log_stat.st_mode))) {
1261 EERROR(color, "SECURITY BREACH", " '%s' %s\n", debug_log_path, 1261 EERROR(color, "SECURITY BREACH", " '%s' %s\n", debug_log_path,
1262 "already exists and is not a regular file!"); 1262 "already exists and is not a regular file!");
1263 } else { 1263 } else {
1264 check_dlsym(__open); 1264 check_dlsym(open_DEFAULT);
1265 debug_log_file = true___open(debug_log_path, O_APPEND | O_WRONLY | 1265 debug_log_file = true_open_DEFAULT(debug_log_path, O_APPEND | O_WRONLY |
1266 O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | 1266 O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP |
1267 S_IROTH); 1267 S_IROTH);
1268 if (debug_log_file >= 0) { 1268 if (debug_log_file >= 0) {
1269 write(debug_log_file, buffer, strlen(buffer)); 1269 write(debug_log_file, buffer, strlen(buffer));
1270 close(debug_log_file); 1270 close(debug_log_file);

Legend:
Removed from v.210  
changed lines
  Added in v.211

  ViewVC Help
Powered by ViewVC 1.1.20