]> granicus.if.org Git - strace/blobdiff - pathtrace.c
mips n32: fix preadv/pwritev offset decoding
[strace] / pathtrace.c
index 03f6681fff3d2ab93634e7deab06b6ac94f051c6..28fc7c9ad8773c82c16bcc206a4514da922b6ec3 100644 (file)
@@ -80,7 +80,7 @@ fdmatch(struct tcb *tcp, int fd)
 
 /*
  * Add a path to the set we're tracing.
- * Secifying NULL will delete all paths.
+ * Specifying NULL will delete all paths.
  */
 static void
 storepath(const char *path)
@@ -158,7 +158,7 @@ pathtrace_match(struct tcb *tcp)
 
        s = tcp->s_ent;
 
-       if (!(s->sys_flags & (TRACE_FILE | TRACE_DESC)))
+       if (!(s->sys_flags & (TRACE_FILE | TRACE_DESC | TRACE_NETWORK)))
                return 0;
 
        /*
@@ -181,7 +181,6 @@ pathtrace_match(struct tcb *tcp)
            s->sys_func == sys_faccessat ||
            s->sys_func == sys_fchmodat ||
            s->sys_func == sys_futimesat ||
-           s->sys_func == sys_mkdirat ||
            s->sys_func == sys_unlinkat ||
            s->sys_func == sys_newfstatat ||
            s->sys_func == sys_mknodat ||
@@ -211,6 +210,7 @@ pathtrace_match(struct tcb *tcp)
        }
 
        if (s->sys_func == sys_renameat ||
+           s->sys_func == sys_renameat2 ||
            s->sys_func == sys_linkat)
        {
                /* fd, path, fd, path */
@@ -251,6 +251,12 @@ pathtrace_match(struct tcb *tcp)
                return fdmatch(tcp, tcp->u_arg[2]);
        }
 
+       if (s->sys_func == sys_fanotify_mark) {
+               /* x, x, x, fd, path */
+               return fdmatch(tcp, tcp->u_arg[3]) ||
+                       upathmatch(tcp, tcp->u_arg[4]);
+       }
+
        if (s->sys_func == sys_select ||
            s->sys_func == sys_oldselect ||
            s->sys_func == sys_pselect6)
@@ -339,11 +345,13 @@ pathtrace_match(struct tcb *tcp)
            s->sys_func == sys_timerfd_settime ||
            s->sys_func == sys_timerfd_gettime ||
            s->sys_func == sys_epoll_create ||
-           strcmp(s->sys_name, "fanotify_init") == 0)
+           s->sys_func == sys_socket ||
+           s->sys_func == sys_socketpair ||
+           s->sys_func == sys_fanotify_init)
        {
                /*
-                * These have TRACE_FILE or TRACE_DESCRIPTOR set, but they
-                * don't have any file descriptor or path args to test.
+                * These have TRACE_FILE or TRACE_DESCRIPTOR or TRACE_NETWORK set,
+                * but they don't have any file descriptor or path args to test.
                 */
                return 0;
        }
@@ -356,7 +364,7 @@ pathtrace_match(struct tcb *tcp)
        if (s->sys_flags & TRACE_FILE)
                return upathmatch(tcp, tcp->u_arg[0]);
 
-       if (s->sys_flags & TRACE_DESC)
+       if (s->sys_flags & (TRACE_DESC | TRACE_NETWORK))
                return fdmatch(tcp, tcp->u_arg[0]);
 
        return 0;