include "mvedsua.h" open(_, _, _) as o => o(path, flags, _) {{ return (strstr((char*)$(path), "/tmp/kitsune") && ((((long)$(flags)) & O_DIRECTORY) == 0)); }} -> {{ extern int kitsune_log_fd; kitsune_log_fd = $(ret); }} // Ignore log messages written by the leader write(fd, _, _) {{ extern int kitsune_log_fd; return (int)$(fd) == kitsune_log_fd; }} => nothing // Redis 2.0.0 -> 2.0.1 setsockopt(_, _, _, _, _) as s {{ return mvedsua_enable_redis_update; }}, time(_) as t, epoll_ctl(_, _, _, _) as e => s(), e(), t() setsockopt(_, _, _, _, _) as s {{ return mvedsua_enable_redis_update_reversed; }}, epoll_ctl(_, _, _, _) as e, time(_) as t => s(), t(), e() // Redis re-installs signals after an update nothing => rt_sigaction(1,_,_), rt_sigaction(13,_,_), rt_sigaction(11,_,_), rt_sigaction(7,_,_), rt_sigaction(8,_,_), rt_sigaction(4,_,_), rt_sigaction(7,_,_), rt_sigaction(15,_,_) // Let log messages written by the follower just go ahead nothing => write(fd, _, _) {{ extern int kitsune_log_fd; return (int)$(fd) == kitsune_log_fd; }} nothing => open(path, _, _) {{ char buf[1024] = "/tmp/"; char pid[1024] = { '\0' }; int pid_n = syscall_getpid(); snprintf(pid, sizeof(pid), "%u", pid_n); // Terminate string correctly because this snprintf is incorrectly implemented for (size_t i = 0 ; i < sizeof(pid) ; i++) { if (pid_n > 0) { pid_n = pid_n / 10; } else { pid[i] = '\0'; break; } } memcpy(buf+strlen(buf), pid, strlen(pid) + 1); snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), ".upd"); // Terminate string correctly because this snprintf is incorrectly implemented if (buf[strlen(buf)-1] < '0') buf[strlen(buf)-1] = '\0'; _nx_debug_dprintf(2, "%s\n", buf); return !strcmp(buf, (char*)$(path)); }}, fstat(_, _), brk(_) * , read(_, _, _) * , // unlink(_), open(_, _, _), fstat(_, _), read(_, _, _) * , close(_) // An extra fstat sometimes comes after the previous rule nothing => fstat(_, _) nothing => getpid()