> // setup a honeypot file > int trap_fd = open(…); > // Create new function to detect writes to the honeypot > static WRITE_FUNC_T original_write = dlsym(RTLD_DEFAULT, "write");; > ssize_t corruption_write(int fd, const void *buf, size_t size) { > FBFatal(fd != trap_fd, @"Writing to the honeypot file"); > } > return original_write(fd, buf, size); > } > // Replace the system write with our “checked version” > rebind_…
1. I added an extra brace after FBFatal in a final revision :( I'll ask for a revision 2. FBFatal has the same semantics as assert(), so that's correct. 3. The 'rebind_symbols' line truncates and is missing a horizontal scroll. You can view the rest of it if you click drag.
> 2. FBFatal has the same semantics as assert(), so that's correct.
Ah, this makes sense to me now. Thanks!