Changeset 80069
- Timestamp:
- 07/03/11 15:06:21 (4 years ago)
- File:
-
- 1 edited
-
trunk/base/src/darwintracelib1.0/darwintrace.c (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/base/src/darwintracelib1.0/darwintrace.c
r79593 r80069 164 164 #if __STDC_VERSION__>=199901L 165 165 #if DARWINTRACE_DEBUG_OUTPUT 166 #define d printf(...) fprintf(stderr, __VA_ARGS__)166 #define debug_printf(...) fprintf(stderr, __VA_ARGS__) 167 167 #else 168 #define d printf(...)168 #define debug_printf(...) 169 169 #endif 170 170 #else … … 172 172 __attribute__ ((format (printf, 1, 2))) 173 173 static inline 174 int d printf(const char *format, ...) {174 int debug_printf(const char *format, ...) { 175 175 int ret; 176 176 va_list args; … … 181 181 } 182 182 #else 183 #define d printf(format, param)183 #define debug_printf(format, param) 184 184 #endif 185 185 #endif … … 363 363 if(connect(sock, (struct sockaddr*)&sun, strlen(__env_darwintrace_log)+1+sizeof(sun.sun_family))!=-1) 364 364 { 365 d printf("darwintrace: connect successful. socket %d\n", sock);365 debug_printf("darwintrace: connect successful. socket %d\n", sock); 366 366 __darwintrace_fd=sock; 367 367 ask_for_filemap(); 368 368 } else { 369 d printf("connect failed: %s\n", strerror(errno));369 debug_printf("connect failed: %s\n", strerror(errno)); 370 370 abort(); 371 371 } … … 470 470 } 471 471 472 d printf("darwintrace: cleanup resulted in %s\n", path);472 debug_printf("darwintrace: cleanup resulted in %s\n", path); 473 473 } 474 474 … … 664 664 isInSandbox = __darwintrace_is_in_sandbox(path, newpath); 665 665 if (isInSandbox == 0) { 666 d printf("darwintrace: creation/writing was forbidden at %s\n", path);666 debug_printf("darwintrace: creation/writing was forbidden at %s\n", path); 667 667 errno = EACCES; 668 668 result = -1; … … 810 810 int isInSandbox = __darwintrace_is_in_sandbox(path, 0); 811 811 if (isInSandbox == 1) { 812 d printf("darwintrace: unlink was allowed at %s\n", path);812 debug_printf("darwintrace: unlink was allowed at %s\n", path); 813 813 } else if (isInSandbox == 0) { 814 814 /* outside sandbox, but sandbox is defined: forbid */ 815 d printf("darwintrace: unlink was forbidden at %s\n", path);815 debug_printf("darwintrace: unlink was forbidden at %s\n", path); 816 816 errno = EACCES; 817 817 result = -1; … … 832 832 int isInSandbox = __darwintrace_is_in_sandbox(path, 0); 833 833 if (isInSandbox == 1) { 834 d printf("darwintrace: mkdir was allowed at %s\n", path);834 debug_printf("darwintrace: mkdir was allowed at %s\n", path); 835 835 } else if (isInSandbox == 0) { 836 836 /* outside sandbox, but sandbox is defined: forbid */ … … 841 841 if ((err == -1) && (errno == ENOENT)) 842 842 { 843 d printf("darwintrace: mkdir was forbidden at %s\n", path);843 debug_printf("darwintrace: mkdir was forbidden at %s\n", path); 844 844 errno = EACCES; 845 845 result = -1; … … 862 862 int isInSandbox = __darwintrace_is_in_sandbox(path, 0); 863 863 if (isInSandbox == 1) { 864 d printf("darwintrace: rmdir was allowed at %s\n", path);864 debug_printf("darwintrace: rmdir was allowed at %s\n", path); 865 865 } else if (isInSandbox == 0) { 866 866 /* outside sandbox, but sandbox is defined: forbid */ 867 d printf("darwintrace: removing directory %s was forbidden\n", path);867 debug_printf("darwintrace: removing directory %s was forbidden\n", path); 868 868 errno = EACCES; 869 869 result = -1; … … 884 884 int isInSandbox = __darwintrace_is_in_sandbox(from, 0); 885 885 if (isInSandbox == 1) { 886 d printf("darwintrace: rename was allowed at %s\n", from);886 debug_printf("darwintrace: rename was allowed at %s\n", from); 887 887 } else if (isInSandbox == 0) { 888 888 /* outside sandbox, but sandbox is defined: forbid */ 889 d printf("darwintrace: renaming from %s was forbidden\n", from);889 debug_printf("darwintrace: renaming from %s was forbidden\n", from); 890 890 errno = EACCES; 891 891 result = -1; … … 895 895 isInSandbox = __darwintrace_is_in_sandbox(to, 0); 896 896 if (isInSandbox == 1) { 897 d printf("darwintrace: rename was allowed at %s\n", to);897 debug_printf("darwintrace: rename was allowed at %s\n", to); 898 898 } else if (isInSandbox == 0) { 899 899 /* outside sandbox, but sandbox is defined: forbid */ 900 d printf("darwintrace: renaming to %s was forbidden\n", to);900 debug_printf("darwintrace: renaming to %s was forbidden\n", to); 901 901 errno = EACCES; 902 902 result = -1;
Note: See TracChangeset
for help on using the changeset viewer.

